Merge branch 'optional-forgejo-fed' of gitlab.com:domaindrivenarchitecture/c4k-forgejo into optional-forgejo-fed
This commit is contained in:
commit
8768c68c22
8 changed files with 44 additions and 26 deletions
|
@ -114,3 +114,11 @@ release:
|
|||
--assets-link "{\"name\":\"c4k-forgejo.js\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-forgejo/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-forgejo.js\"}" \
|
||||
--assets-link "{\"name\":\"c4k-forgejo.js.sha256\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-forgejo/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-forgejo.js.sha256\"}" \
|
||||
--assets-link "{\"name\":\"c4k-forgejo.js.sha512\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/c4k-forgejo/-/jobs/${CI_JOB_ID}/artifacts/file/target/frontend-build/c4k-forgejo.js.sha512\"}" \
|
||||
|
||||
forgejo-image-test-publish:
|
||||
image: domaindrivenarchitecture/devops-build:latest
|
||||
stage: image
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
script:
|
||||
- cd infrastructure/docker-federated && pyb image test publish
|
|
@ -12,7 +12,7 @@ class MyBuild(DevopsDockerBuild):
|
|||
|
||||
@init
|
||||
def initialize(project):
|
||||
project.build_depends_on('ddadevops>=0.12.4')
|
||||
project.build_depends_on('ddadevops>=0.15.5')
|
||||
stage = 'prod'
|
||||
dockerhub_user = environ.get('DOCKERHUB_USER')
|
||||
if not dockerhub_user:
|
||||
|
@ -49,4 +49,3 @@ def publish(project):
|
|||
def test(project):
|
||||
build = get_devops_build(project)
|
||||
build.test()
|
||||
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
#Build stage
|
||||
FROM docker.io/library/golang:1.20-alpine3.17 AS build-env
|
||||
FROM docker.io/library/golang:1.20.4-alpine3.18 AS build-env
|
||||
|
||||
ARG GOPROXY
|
||||
ENV GOPROXY ${GOPROXY:-direct}
|
||||
|
||||
ARG GITEA_VERSION
|
||||
#ARG GITEA_VERSION
|
||||
ARG TAGS="sqlite sqlite_unlock_notify"
|
||||
ENV TAGS "bindata timetzdata $TAGS"
|
||||
ARG CGO_EXTRA_CFLAGS
|
||||
|
||||
ARG FORGEJO_GIT_URL="https://codeberg.org/forgejo/forgejo.git"
|
||||
ARG FORGEJO_BRANCH="forgejo-federation"
|
||||
ARG FORGEJO_FOLDER="forgejo-fed"
|
||||
ENV FORGEJO_GIT_URL "https://codeberg.org/forgejo/forgejo.git"
|
||||
ENV FORGEJO_BRANCH "forgejo-federation"
|
||||
|
||||
#Build deps
|
||||
RUN apk --no-cache add build-base git nodejs npm
|
||||
|
||||
#Setup repo
|
||||
RUN git clone --single-branch --branch FORGEJO_BRANCH FORGEJO_GIT_URL FORGEJO_FOLDER
|
||||
COPY FORGEJO_FOLDER/* ${GOPATH}/src/code.gitea.io/gitea
|
||||
RUN git clone --single-branch --branch ${FORGEJO_BRANCH} ${FORGEJO_GIT_URL} ${GOPATH}/src/code.gitea.io/gitea
|
||||
|
||||
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
||||
|
||||
#Checkout version if set
|
||||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
||||
&& make clean-all build
|
||||
RUN make clean-all build
|
||||
|
||||
# Begin env-to-ini build
|
||||
RUN go build contrib/environment-to-ini/environment-to-ini.go
|
||||
|
||||
# Run stage
|
||||
FROM docker.io/library/alpine:3.17
|
||||
FROM docker.io/library/alpine:3.18
|
||||
LABEL maintainer="contact@forgejo.org"
|
||||
|
||||
EXPOSE 22 3000
|
||||
|
@ -67,7 +65,7 @@ VOLUME ["/data"]
|
|||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||
CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||
|
||||
COPY docker/root /
|
||||
COPY --from=build-env /go/src/code.gitea.io/gitea/docker/root /
|
||||
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
||||
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
||||
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
install -m 0700 /tmp/entrypoint.sh /
|
||||
install -m 0700 /tmp/functions.sh /usr/local/bin/
|
||||
|
10
infrastructure/docker-federated/test/Dockerfile
Normal file
10
infrastructure/docker-federated/test/Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM c4k-forgejo-fed
|
||||
|
||||
RUN apk --no-cache add openjdk11-jre-headless
|
||||
|
||||
RUN curl -L -o /tmp/serverspec.jar \
|
||||
https://github.com/DomainDrivenArchitecture/dda-serverspec-crate/releases/download/2.0.0/dda-serverspec-standalone.jar
|
||||
|
||||
COPY serverspec.edn /tmp/serverspec.edn
|
||||
|
||||
RUN java -jar /tmp/serverspec.jar /tmp/serverspec.edn -v
|
8
infrastructure/docker-federated/test/serverspec.edn
Normal file
8
infrastructure/docker-federated/test/serverspec.edn
Normal file
|
@ -0,0 +1,8 @@
|
|||
{:file [{:path "/usr/bin/entrypoint" :mod "755"}
|
||||
{:path "/app/gitea/gitea" :mod "755"}
|
||||
{:path "/usr/local/bin/gitea" :mod "755"}
|
||||
{:path "/usr/local/bin/environment-to-ini" :mod "755"}
|
||||
{:path "/etc/s6/gitea/" :mod "755"}
|
||||
{:path "/etc/s6/openssh/" :mod "755"}
|
||||
{:path "/etc/s6/.s6-svscan/" :mod "755"}
|
||||
{:path "/etc/profile.d/gitea_bash_autocomplete.sh" :mod "644"}]}
|
|
@ -47,14 +47,14 @@
|
|||
|
||||
(def config-defaults {:issuer "staging"})
|
||||
|
||||
(def config? (s/keys :req-un [::fqdn
|
||||
(def config? (s/keys :req-un [::fqdn
|
||||
::deploy-federated
|
||||
::mailer-from
|
||||
::mailer-host
|
||||
::mailer-port
|
||||
::service-noreply-address
|
||||
::deploy-federated]
|
||||
:opt-un [::issuer
|
||||
::default-app-name
|
||||
::service-noreply-address]
|
||||
:opt-un [::issuer
|
||||
::default-app-name
|
||||
::service-domain-whitelist]))
|
||||
|
||||
(def auth? (s/keys :req-un [::postgres/postgres-db-user ::postgres/postgres-db-password ::mailer-user ::mailer-pw]))
|
||||
|
|
|
@ -44,13 +44,12 @@
|
|||
})
|
||||
(cut/generate-appini-env {:default-app-name "test forgejo"
|
||||
:deploy-federated "true"
|
||||
:fqdn "test.com"
|
||||
:fqdn "test.com"
|
||||
:mailer-from "test@test.com"
|
||||
:mailer-host "mail.test.com"
|
||||
:mailer-port "456"
|
||||
:service-domain-whitelist "test.com,test.net"
|
||||
:service-noreply-address "noreply@test.com"
|
||||
})))))
|
||||
:service-noreply-address "noreply@test.com"})))))
|
||||
|
||||
(deftest should-generate-non-federated-deployment
|
||||
(is (= {:apiVersion "apps/v1",
|
||||
|
@ -131,4 +130,4 @@
|
|||
(is (= {:storage-c1 "1Gi",
|
||||
:storage-c2 "15Gi"}
|
||||
(th/map-diff (cut/generate-data-volume {:volume-total-storage-size 1})
|
||||
(cut/generate-data-volume {:volume-total-storage-size 15})))))
|
||||
(cut/generate-data-volume {:volume-total-storage-size 15})))))
|
||||
|
|
Loading…
Reference in a new issue