From 75d34278938dd0f30fd498756e43a611198f2bd7 Mon Sep 17 00:00:00 2001 From: Mirco Date: Thu, 1 Jun 2023 12:15:45 +0200 Subject: [PATCH] Add severspec test, rm resources --- infrastructure/docker-federated/build.py | 1 - infrastructure/docker-federated/image/Dockerfile | 7 ++----- .../docker-federated/image/resources/install.sh | 4 ---- infrastructure/docker-federated/test/Dockerfile | 10 ++++++++++ infrastructure/docker-federated/test/serverspec.edn | 8 ++++++++ 5 files changed, 20 insertions(+), 10 deletions(-) delete mode 100755 infrastructure/docker-federated/image/resources/install.sh create mode 100644 infrastructure/docker-federated/test/Dockerfile create mode 100644 infrastructure/docker-federated/test/serverspec.edn diff --git a/infrastructure/docker-federated/build.py b/infrastructure/docker-federated/build.py index 89be081..6b3cf58 100644 --- a/infrastructure/docker-federated/build.py +++ b/infrastructure/docker-federated/build.py @@ -49,4 +49,3 @@ def publish(project): def test(project): build = get_devops_build(project) build.test() - diff --git a/infrastructure/docker-federated/image/Dockerfile b/infrastructure/docker-federated/image/Dockerfile index 4dc288c..bf2e710 100644 --- a/infrastructure/docker-federated/image/Dockerfile +++ b/infrastructure/docker-federated/image/Dockerfile @@ -11,26 +11,23 @@ ARG CGO_EXTRA_CFLAGS ENV FORGEJO_GIT_URL "https://codeberg.org/forgejo/forgejo.git" ENV FORGEJO_BRANCH "forgejo-federation" -#ENV FORGEJO_FOLDER "forgejo-fed" #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} ${GOPATH}/src/code.gitea.io/gitea -#${FORGEJO_FOLDER} -#COPY ${FORGEJO_FOLDER} ${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 \ 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 diff --git a/infrastructure/docker-federated/image/resources/install.sh b/infrastructure/docker-federated/image/resources/install.sh deleted file mode 100755 index 1937557..0000000 --- a/infrastructure/docker-federated/image/resources/install.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -install -m 0700 /tmp/entrypoint.sh / -install -m 0700 /tmp/functions.sh /usr/local/bin/ - diff --git a/infrastructure/docker-federated/test/Dockerfile b/infrastructure/docker-federated/test/Dockerfile new file mode 100644 index 0000000..10de78a --- /dev/null +++ b/infrastructure/docker-federated/test/Dockerfile @@ -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 diff --git a/infrastructure/docker-federated/test/serverspec.edn b/infrastructure/docker-federated/test/serverspec.edn new file mode 100644 index 0000000..7c95886 --- /dev/null +++ b/infrastructure/docker-federated/test/serverspec.edn @@ -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"}]}