From 45ee0157f7885454d58f0b1f159f6516a9ad26b3 Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Thu, 29 Feb 2024 16:09:02 +0100 Subject: [PATCH] CI: update Docker image build logic - Change development image tags to "development" so that branch name and tag name are the same (and we don't need any logic to translate between branch names and tag names) - Also build images for release-1.9 branch - Also re-build images if their build workflow changes --- .github/workflows/build-push-image-davrods.yml | 13 +++++++++++-- .github/workflows/build-push-image-eus.yml | 13 +++++++++++-- .github/workflows/build-push-image-mailpit.yml | 13 ++++++++++--- .github/workflows/build-push-image-portal.yml | 13 +++++++++++-- .github/workflows/build-push-image-provider.yml | 14 ++++++++++++-- .github/workflows/build-push-image-public.yml | 14 ++++++++++++-- .github/workflows/build-push-image-web-mock.yml | 14 ++++++++++++-- docker/compose-with-bind-mounts/docker-compose.yml | 14 +++++++------- docker/compose/docker-compose.yml | 14 +++++++------- docker/images/davrods/Dockerfile | 4 +++- docker/images/davrods/build.sh | 2 +- docker/images/davrods/davrods_init.sh | 7 ++++++- docker/images/mailpit/build.sh | 9 ++++++++- docker/images/yoda_eus/Dockerfile | 4 +++- docker/images/yoda_eus/build.sh | 2 +- docker/images/yoda_eus/yoda_eus_init.sh | 7 ++++++- docker/images/yoda_irods_icat/Dockerfile | 4 +++- docker/images/yoda_irods_icat/build.sh | 2 +- docker/images/yoda_irods_icat/irods-icat-init.sh | 7 ++++++- docker/images/yoda_portal/Dockerfile | 4 +++- docker/images/yoda_portal/build.sh | 2 +- docker/images/yoda_portal/yoda_portal_init.sh | 7 ++++++- docker/images/yoda_public/Dockerfile | 4 +++- docker/images/yoda_public/build.sh | 2 +- docker/images/yoda_public/yoda_public_init.sh | 7 ++++++- docker/images/yoda_web_mock/Dockerfile | 4 +++- docker/images/yoda_web_mock/build.sh | 2 +- docker/images/yoda_web_mock/yoda_web_mock_init.sh | 7 ++++++- docs/development/docker-setup.md | 2 +- 29 files changed, 162 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build-push-image-davrods.yml b/.github/workflows/build-push-image-davrods.yml index c3323db70..26e9fe362 100644 --- a/.github/workflows/build-push-image-davrods.yml +++ b/.github/workflows/build-push-image-davrods.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-davrods.yml' - 'docker/images/davrods/**' jobs: @@ -16,12 +18,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -36,4 +43,6 @@ jobs: context: yoda/docker/images/davrods file: yoda/docker/images/davrods/Dockerfile push: true - tags: ghcr.io/utrechtuniversity/davrods:dev-1.9 + tags: ghcr.io/utrechtuniversity/davrods:${{ steps.extract_branch.outputs.branch }} + build-args: | + TAG=${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/build-push-image-eus.yml b/.github/workflows/build-push-image-eus.yml index f25a3f9c5..30e3814d2 100644 --- a/.github/workflows/build-push-image-eus.yml +++ b/.github/workflows/build-push-image-eus.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-eus.yml' - 'docker/images/yoda_eus/**' jobs: @@ -16,12 +18,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -36,4 +43,6 @@ jobs: context: yoda/docker/images/yoda_eus file: yoda/docker/images/yoda_eus/Dockerfile push: true - tags: ghcr.io/utrechtuniversity/yoda-eus:dev-1.9 + tags: ghcr.io/utrechtuniversity/yoda-eus:${{ steps.extract_branch.outputs.branch }} + build-args: | + TAG=${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/build-push-image-mailpit.yml b/.github/workflows/build-push-image-mailpit.yml index 425c770d6..55191f07a 100644 --- a/.github/workflows/build-push-image-mailpit.yml +++ b/.github/workflows/build-push-image-mailpit.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-mailpit.yml' - 'docker/images/mailpit/**' jobs: @@ -16,12 +18,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -36,5 +43,5 @@ jobs: - name: Build and push Docker image run: | cd yoda/docker/images/mailpit - ./build.sh - docker push ghcr.io/utrechtuniversity/yoda-mailpit:dev-1.9 + ./build.sh "${{ steps.extract_branch.outputs.branch }}" + docker push ghcr.io/utrechtuniversity/yoda-mailpit:${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/build-push-image-portal.yml b/.github/workflows/build-push-image-portal.yml index 3c9a69ba8..6de93147e 100644 --- a/.github/workflows/build-push-image-portal.yml +++ b/.github/workflows/build-push-image-portal.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-portal.yml' - 'docker/images/yoda_portal/**' jobs: @@ -16,12 +18,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -36,4 +43,6 @@ jobs: context: yoda/docker/images/yoda_portal file: yoda/docker/images/yoda_portal/Dockerfile push: true - tags: ghcr.io/utrechtuniversity/yoda-portal:dev-1.9 + tags: ghcr.io/utrechtuniversity/yoda-portal:${{ steps.extract_branch.outputs.branch }} + build-args: | + TAG=${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/build-push-image-provider.yml b/.github/workflows/build-push-image-provider.yml index 1bf9047ad..84d87c31b 100644 --- a/.github/workflows/build-push-image-provider.yml +++ b/.github/workflows/build-push-image-provider.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-provider.yml' - 'docker/images/yoda_irods_icat/**' - 'roles/irods_completion/files/irods_completion.sh' - 'roles/pam_python/files/pam_python.so' @@ -19,12 +21,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -44,4 +51,7 @@ jobs: context: yoda/docker/images/yoda_irods_icat file: yoda/docker/images/yoda_irods_icat/Dockerfile push: true - tags: ghcr.io/utrechtuniversity/yoda-provider:dev-1.9 + tags: ghcr.io/utrechtuniversity/yoda-provider:${{ steps.extract_branch.outputs.branch }} + build-args: | + TAG=${{ steps.extract_branch.outputs.branch }} + diff --git a/.github/workflows/build-push-image-public.yml b/.github/workflows/build-push-image-public.yml index 7d19d97fa..b0476e7a7 100644 --- a/.github/workflows/build-push-image-public.yml +++ b/.github/workflows/build-push-image-public.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-public.yml' - 'docker/images/yoda_public/**' - 'roles/yoda_landingpages/files/**' @@ -17,12 +19,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -42,4 +49,7 @@ jobs: context: yoda/docker/images/yoda_public file: yoda/docker/images/yoda_public/Dockerfile push: true - tags: ghcr.io/utrechtuniversity/yoda-public:dev-1.9 + tags: ghcr.io/utrechtuniversity/yoda-public:${{ steps.extract_branch.outputs.branch }} + build-args: | + TAG=${{ steps.extract_branch.outputs.branch }} + diff --git a/.github/workflows/build-push-image-web-mock.yml b/.github/workflows/build-push-image-web-mock.yml index c2f6e44e7..6eca50a26 100644 --- a/.github/workflows/build-push-image-web-mock.yml +++ b/.github/workflows/build-push-image-web-mock.yml @@ -5,7 +5,9 @@ on: push: branches: - 'development' + - 'release-1.9' paths: + - '.github/workflows/build-push-image-web-mock.yml' - 'docker/images/yoda_web_mock/**' jobs: @@ -16,12 +18,17 @@ jobs: contents: read packages: write steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Check out Yoda repository uses: actions/checkout@v3 with: path: yoda repository: UtrechtUniversity/yoda - ref: development + ref: ${{ steps.extract_branch.outputs.branch }} - name: Authenticate to the container registry uses: docker/login-action@v2 @@ -36,4 +43,7 @@ jobs: context: yoda/docker/images/yoda_web_mock file: yoda/docker/images/yoda_web_mock/Dockerfile push: true - tags: ghcr.io/utrechtuniversity/yoda-web-mock:dev-1.9 + tags: ghcr.io/utrechtuniversity/yoda-web-mock:${{ steps.extract_branch.outputs.branch }} + build-args: | + TAG=${{ steps.extract_branch.outputs.branch }} + diff --git a/docker/compose-with-bind-mounts/docker-compose.yml b/docker/compose-with-bind-mounts/docker-compose.yml index 78734af00..9b135e9fa 100644 --- a/docker/compose-with-bind-mounts/docker-compose.yml +++ b/docker/compose-with-bind-mounts/docker-compose.yml @@ -11,7 +11,7 @@ services: container_name: provider.yoda platform: linux/amd64 hostname: provider.yoda - image: ghcr.io/utrechtuniversity/yoda-provider:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-provider:development ports: - "8247:1247" - "20000-20199:20000-20199" @@ -62,7 +62,7 @@ services: container_name: portal.yoda platform: linux/amd64 hostname: portal.yoda - image: ghcr.io/utrechtuniversity/yoda-portal:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-portal:development depends_on: - provider - eus @@ -80,7 +80,7 @@ services: container_name: eus.yoda platform: linux/amd64 hostname: eus.yoda - image: ghcr.io/utrechtuniversity/yoda-eus:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-eus:development depends_on: - extuserdb - mailpit @@ -101,7 +101,7 @@ services: container_name: public.yoda platform: linux/amd64 hostname: public.yoda - image: ghcr.io/utrechtuniversity/yoda-public:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-public:development ports: - "8446:443" build: @@ -118,7 +118,7 @@ services: container_name: data.yoda platform: linux/amd64 hostname: data.yoda - image: ghcr.io/utrechtuniversity/davrods:dev-1.9 + image: ghcr.io/utrechtuniversity/davrods:development depends_on: - provider ports: @@ -131,7 +131,7 @@ services: container_name: mailpit.yoda platform: linux/amd64 hostname: mailpit.yoda - image: ghcr.io/utrechtuniversity/yoda-mailpit:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-mailpit:development environment: - TZ=Europe/Amsterdam build: @@ -144,7 +144,7 @@ services: container_name: datacite-mock.yoda platform: linux/amd64 hostname: datacite-mock.yoda - image: ghcr.io/utrechtuniversity/yoda-web-mock:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-web-mock:development environment: - MOCKNAME=datacite - MOCKFQDN=datacite-mock.yoda diff --git a/docker/compose/docker-compose.yml b/docker/compose/docker-compose.yml index 83d8238e2..8eaf9b0d6 100644 --- a/docker/compose/docker-compose.yml +++ b/docker/compose/docker-compose.yml @@ -11,7 +11,7 @@ services: container_name: provider.yoda platform: linux/amd64 hostname: provider.yoda - image: ghcr.io/utrechtuniversity/yoda-provider:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-provider:development ports: - "8247:1247" - "20000-20199:20000-20199" @@ -56,7 +56,7 @@ services: container_name: portal.yoda platform: linux/amd64 hostname: portal.yoda - image: ghcr.io/utrechtuniversity/yoda-portal:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-portal:development depends_on: - provider - eus @@ -70,7 +70,7 @@ services: container_name: eus.yoda platform: linux/amd64 hostname: eus.yoda - image: ghcr.io/utrechtuniversity/yoda-eus:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-eus:development depends_on: - extuserdb - mailpit @@ -84,7 +84,7 @@ services: container_name: public.yoda platform: linux/amd64 hostname: public.yoda - image: ghcr.io/utrechtuniversity/yoda-public:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-public:development ports: - "8446:443" build: @@ -98,7 +98,7 @@ services: container_name: data.yoda platform: linux/amd64 hostname: data.yoda - image: ghcr.io/utrechtuniversity/davrods:dev-1.9 + image: ghcr.io/utrechtuniversity/davrods:development depends_on: - provider ports: @@ -111,7 +111,7 @@ services: container_name: mailpit.yoda platform: linux/amd64 hostname: mailpit.yoda - image: ghcr.io/utrechtuniversity/yoda-mailpit:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-mailpit:development environment: - TZ=Europe/Amsterdam build: @@ -124,7 +124,7 @@ services: container_name: datacite-mock.yoda platform: linux/amd64 hostname: datacite-mock.yoda - image: ghcr.io/utrechtuniversity/yoda-web-mock:dev-1.9 + image: ghcr.io/utrechtuniversity/yoda-web-mock:development environment: - MOCKNAME=datacite - MOCKFQDN=datacite-mock.yoda diff --git a/docker/images/davrods/Dockerfile b/docker/images/davrods/Dockerfile index b027b3d40..6cfa1ae62 100644 --- a/docker/images/davrods/Dockerfile +++ b/docker/images/davrods/Dockerfile @@ -6,6 +6,7 @@ EXPOSE 80 EXPOSE 443 # Application settings +ARG TAG=development ENV IRODS_VERSION="4.2.11" ENV YUM_REPO_FILE_LOC "https://packages.irods.org/renci-irods.yum.repo" ENV YUM_IRODS_REPO_SIGNING_KEY_LOC="https://packages.irods.org/irods-signing-key.asc" @@ -61,4 +62,5 @@ COPY footer.html /etc/httpd/irods/footer.html VOLUME [ "/sys/fs/cgroup" ] COPY davrods_init.sh /var/lib/irods/scripts/davrods_init.sh RUN chmod 0755 /var/lib/irods/scripts/davrods_init.sh -CMD ["/var/lib/irods/scripts/davrods_init.sh"] +ENV TAG=${TAG} +CMD ["/var/lib/irods/scripts/davrods_init.sh", "$TAG"] diff --git a/docker/images/davrods/build.sh b/docker/images/davrods/build.sh index a1afdedf5..57641af71 100755 --- a/docker/images/davrods/build.sh +++ b/docker/images/davrods/build.sh @@ -1,3 +1,3 @@ #!/bin/sh export DOCKER_SCAN_SUGGEST=false -docker build . -t ghcr.io/utrechtuniversity/davrods:dev-1.9 "$@" +docker build . -t "ghcr.io/utrechtuniversity/davrods:development" "$@" diff --git a/docker/images/davrods/davrods_init.sh b/docker/images/davrods/davrods_init.sh index 52d308b3f..a77b6a048 100755 --- a/docker/images/davrods/davrods_init.sh +++ b/docker/images/davrods/davrods_init.sh @@ -4,7 +4,12 @@ set -e set -o pipefail set -u -DATA_VERSION="dev-1.9" +DATA_VERSION="$1" + +if [ -z "$DATA_VERSION" ] +then echo "Error: no data version argument provided." + exit 1 +fi function before_update { echo -e "[...] ${1}" diff --git a/docker/images/mailpit/build.sh b/docker/images/mailpit/build.sh index b84c1cf86..b0a3d513b 100755 --- a/docker/images/mailpit/build.sh +++ b/docker/images/mailpit/build.sh @@ -6,6 +6,13 @@ set -x export MAILPIT_VERSION=1.14.0 export DOCKER_SCAN_SUGGEST=false +DOCKER_TAG="$1" + +if [ -z "$DOCKER_TAG" ] +then echo "Error: no docker tag argument provided." + exit 1 +else shift +fi if [ -d "mailpit" ] then rm -rf mailpit @@ -14,4 +21,4 @@ fi git clone https://github.com/axllent/mailpit.git cd mailpit git checkout "v$MAILPIT_VERSION" -docker build . -t ghcr.io/utrechtuniversity/yoda-mailpit:dev-1.9 --build-arg VERSION="$MAILPIT_VERSION" "$@" +docker build . -t "ghcr.io/utrechtuniversity/yoda-mailpit:$DOCKER_TAG" --build-arg VERSION="$MAILPIT_VERSION" "$@" diff --git a/docker/images/yoda_eus/Dockerfile b/docker/images/yoda_eus/Dockerfile index 5b525f04e..7fa30a887 100644 --- a/docker/images/yoda_eus/Dockerfile +++ b/docker/images/yoda_eus/Dockerfile @@ -2,6 +2,7 @@ FROM centos:7 LABEL maintainer="Yoda team " # Application settings +ARG TAG=development ENV YODA_EUS_REPO "https://github.com/UtrechtUniversity/yoda-external-user-service.git" ENV YODA_EUS_BRANCH "development" ENV YODA_PORTAL_REPO "https://github.com/UtrechtUniversity/yoda-portal.git" @@ -70,4 +71,5 @@ RUN cp -Rdp /var/www/extuser /var/www/extuser-copy VOLUME [ "/sys/fs/cgroup" ] COPY yoda_eus_init.sh /var/lib/irods/scripts/yoda_eus_init.sh RUN chmod 0755 /var/lib/irods/scripts/yoda_eus_init.sh -CMD ["/var/lib/irods/scripts/yoda_eus_init.sh"] +ENV TAG=${TAG} +CMD ["/var/lib/irods/scripts/yoda_eus_init.sh", "$TAG"] diff --git a/docker/images/yoda_eus/build.sh b/docker/images/yoda_eus/build.sh index 9a48b61fc..76983e352 100755 --- a/docker/images/yoda_eus/build.sh +++ b/docker/images/yoda_eus/build.sh @@ -1,3 +1,3 @@ #!/bin/sh export DOCKER_SCAN_SUGGEST=false -docker build . -t ghcr.io/utrechtuniversity/yoda-eus:dev-1.9 "$@" +docker build . -t ghcr.io/utrechtuniversity/yoda-eus:development "$@" diff --git a/docker/images/yoda_eus/yoda_eus_init.sh b/docker/images/yoda_eus/yoda_eus_init.sh index 99f23a7dd..979f95186 100644 --- a/docker/images/yoda_eus/yoda_eus_init.sh +++ b/docker/images/yoda_eus/yoda_eus_init.sh @@ -4,7 +4,12 @@ set -e set -o pipefail set -u -DATA_VERSION="dev-1.9" +DATA_VERSION="$1" + +if [ -z "$DATA_VERSION" ] +then echo "Error: no data version argument provided." + exit 1 +fi function before_update { echo -e "[...] ${1}" diff --git a/docker/images/yoda_irods_icat/Dockerfile b/docker/images/yoda_irods_icat/Dockerfile index 038502eeb..1e306a869 100644 --- a/docker/images/yoda_irods_icat/Dockerfile +++ b/docker/images/yoda_irods_icat/Dockerfile @@ -2,6 +2,7 @@ FROM centos:7 LABEL maintainer="Yoda team " # Application settings +ARG TAG=development ENV IRODS_VERSION "4.2.12" ENV IRODS_PREP_VERSION "4.2.12.0" ENV IRODS_INDEX_VERSION "4.2.12.0-1" @@ -182,4 +183,5 @@ COPY irods-icat-init.sh /var/lib/irods/scripts/irods-icat-init.sh RUN chmod 0755 /var/lib/irods/scripts/irods-icat-init.sh VOLUME [ "/sys/fs/cgroup" ] -CMD ["/var/lib/irods/scripts/irods-icat-init.sh"] +ENV TAG=${TAG} +CMD ["/var/lib/irods/scripts/irods-icat-init.sh", "$TAG"] diff --git a/docker/images/yoda_irods_icat/build.sh b/docker/images/yoda_irods_icat/build.sh index 5111d81e0..7f4494a14 100755 --- a/docker/images/yoda_irods_icat/build.sh +++ b/docker/images/yoda_irods_icat/build.sh @@ -1,3 +1,3 @@ #!/bin/sh export DOCKER_SCAN_SUGGEST=false -docker build . -t ghcr.io/utrechtuniversity/yoda-provider:dev-1.9 "$@" +docker build . -t ghcr.io/utrechtuniversity/yoda-provider:development "$@" diff --git a/docker/images/yoda_irods_icat/irods-icat-init.sh b/docker/images/yoda_irods_icat/irods-icat-init.sh index 0bf077bc3..e910a094c 100644 --- a/docker/images/yoda_irods_icat/irods-icat-init.sh +++ b/docker/images/yoda_irods_icat/irods-icat-init.sh @@ -4,7 +4,12 @@ set -e set -o pipefail set -u -DATA_VERSION="dev-1.9" +DATA_VERSION="$1" + +if [ -z "$DATA_VERSION" ] +then echo "Error: no data version argument provided." + exit 1 +fi function before_update { echo -e "[...] ${1}" diff --git a/docker/images/yoda_portal/Dockerfile b/docker/images/yoda_portal/Dockerfile index dc59f5c26..95370366c 100644 --- a/docker/images/yoda_portal/Dockerfile +++ b/docker/images/yoda_portal/Dockerfile @@ -2,6 +2,7 @@ FROM centos:7 LABEL maintainer="Yoda team " # Application settings +ARG TAG=development ENV YODA_PORTAL_REPO "https://github.com/UtrechtUniversity/yoda-portal.git" ENV YODA_PORTAL_BRANCH "development" @@ -55,4 +56,5 @@ RUN cp -Rdp /var/www/yoda /var/www/yoda-copy VOLUME [ "/sys/fs/cgroup" ] COPY yoda_portal_init.sh /var/lib/irods/scripts/yoda_portal_init.sh RUN chmod 0755 /var/lib/irods/scripts/yoda_portal_init.sh -CMD ["/var/lib/irods/scripts/yoda_portal_init.sh"] +ENV TAG=${TAG} +CMD ["/var/lib/irods/scripts/yoda_portal_init.sh", "$TAG"] diff --git a/docker/images/yoda_portal/build.sh b/docker/images/yoda_portal/build.sh index 63e6c00c7..fdd411123 100755 --- a/docker/images/yoda_portal/build.sh +++ b/docker/images/yoda_portal/build.sh @@ -1,3 +1,3 @@ #!/bin/sh export DOCKER_SCAN_SUGGEST=false -docker build . -t ghcr.io/utrechtuniversity/yoda-portal:dev-1.9 "$@" +docker build . -t ghcr.io/utrechtuniversity/yoda-portal:development "$@" diff --git a/docker/images/yoda_portal/yoda_portal_init.sh b/docker/images/yoda_portal/yoda_portal_init.sh index 719f91d56..fa2fb2432 100644 --- a/docker/images/yoda_portal/yoda_portal_init.sh +++ b/docker/images/yoda_portal/yoda_portal_init.sh @@ -4,7 +4,12 @@ set -e set -o pipefail set -u -DATA_VERSION="dev-1.9" +DATA_VERSION="$1" + +if [ -z "$DATA_VERSION" ] +then echo "Error: no data version argument provided." + exit 1 +fi function before_update { echo -e "[...] ${1}" diff --git a/docker/images/yoda_public/Dockerfile b/docker/images/yoda_public/Dockerfile index a0fb4f58c..7114f6af1 100644 --- a/docker/images/yoda_public/Dockerfile +++ b/docker/images/yoda_public/Dockerfile @@ -2,6 +2,7 @@ FROM centos:7 LABEL maintainer="Yoda team " # Application settings +ARG TAG=development ENV MOAI_REPO "https://github.com/UtrechtUniversity/yoda-moai.git" ENV MOAI_BRANCH "development" @@ -96,4 +97,5 @@ RUN cp -Rdp /var/www/moai/yoda-moai /var/www/moai/yoda-moai-copy VOLUME [ "/sys/fs/cgroup" ] COPY yoda_public_init.sh /yoda_public_init.sh RUN chmod 0755 /yoda_public_init.sh -CMD ["/yoda_public_init.sh"] +ENV TAG=${TAG} +CMD ["/yoda_public_init.sh", "$TAG"] diff --git a/docker/images/yoda_public/build.sh b/docker/images/yoda_public/build.sh index f0c45c27a..97664eb1f 100755 --- a/docker/images/yoda_public/build.sh +++ b/docker/images/yoda_public/build.sh @@ -1,3 +1,3 @@ #!/bin/sh export DOCKER_SCAN_SUGGEST=false -docker build . -t ghcr.io/utrechtuniversity/yoda-public:dev-1.9 "$@" +docker build . -t ghcr.io/utrechtuniversity/yoda-public:development "$@" diff --git a/docker/images/yoda_public/yoda_public_init.sh b/docker/images/yoda_public/yoda_public_init.sh index cb7596602..345db59dd 100644 --- a/docker/images/yoda_public/yoda_public_init.sh +++ b/docker/images/yoda_public/yoda_public_init.sh @@ -4,7 +4,12 @@ set -e set -o pipefail set -u -DATA_VERSION="dev-1.9" +DATA_VERSION="$1" + +if [ -z "$DATA_VERSION" ] +then echo "Error: no data version argument provided." + exit 1 +fi function before_update { echo -e "[...] ${1}" diff --git a/docker/images/yoda_web_mock/Dockerfile b/docker/images/yoda_web_mock/Dockerfile index a6528eb0d..62746ce31 100644 --- a/docker/images/yoda_web_mock/Dockerfile +++ b/docker/images/yoda_web_mock/Dockerfile @@ -2,6 +2,7 @@ FROM centos:7 LABEL maintainer="Yoda team " # Application settings +ARG TAG=development ENV YODA_MOCK_REPO "https://github.com/UtrechtUniversity/yoda-web-mock.git" ENV YODA_MOCK_BRANCH "development" @@ -58,4 +59,5 @@ RUN cp -Rdp /var/www/webmock/yoda-web-mock /var/www/webmock/yoda-web-mock-copy VOLUME [ "/sys/fs/cgroup" ] COPY yoda_web_mock_init.sh /yoda_web_mock_init.sh RUN chmod 0755 /yoda_web_mock_init.sh -CMD ["/yoda_web_mock_init.sh"] +ENV TAG=${TAG} +CMD ["/yoda_web_mock_init.sh", "$TAG"] diff --git a/docker/images/yoda_web_mock/build.sh b/docker/images/yoda_web_mock/build.sh index 4d613db14..d0a23c495 100755 --- a/docker/images/yoda_web_mock/build.sh +++ b/docker/images/yoda_web_mock/build.sh @@ -1,3 +1,3 @@ #!/bin/sh export DOCKER_SCAN_SUGGEST=false -docker build . -t ghcr.io/utrechtuniversity/yoda-web-mock:dev-1.9 "$@" +docker build . -t ghcr.io/utrechtuniversity/yoda-web-mock:development "$@" diff --git a/docker/images/yoda_web_mock/yoda_web_mock_init.sh b/docker/images/yoda_web_mock/yoda_web_mock_init.sh index ffdc133ef..e7cd4ed2f 100644 --- a/docker/images/yoda_web_mock/yoda_web_mock_init.sh +++ b/docker/images/yoda_web_mock/yoda_web_mock_init.sh @@ -4,7 +4,12 @@ set -e set -o pipefail set -u -DATA_VERSION="dev-1.9" +DATA_VERSION="$1" + +if [ -z "$DATA_VERSION" ] +then echo "Error: no data version argument provided." + exit 1 +fi function before_update { echo -e "[...] ${1}" diff --git a/docs/development/docker-setup.md b/docs/development/docker-setup.md index c2df2e586..5086c9a97 100644 --- a/docs/development/docker-setup.md +++ b/docs/development/docker-setup.md @@ -170,7 +170,7 @@ cd docker/images/yoda_irods_icat ```bash cd docker/images/mailpit -./build.sh +./build.sh development ``` ### Yoda portal