From 0a47efd048183f04461884966b4264795503f637 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Mon, 30 Mar 2026 12:47:53 +0200 Subject: [PATCH 1/4] 6871: Added release.json generation to builds --- .github/workflows/github_build_release.yml | 5 +++++ CHANGELOG.md | 1 + infrastructure/build-n-push.sh | 2 ++ infrastructure/display-api-service/Dockerfile | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/.github/workflows/github_build_release.yml b/.github/workflows/github_build_release.yml index ea6bbe7c..a59008b0 100644 --- a/.github/workflows/github_build_release.yml +++ b/.github/workflows/github_build_release.yml @@ -35,6 +35,11 @@ jobs: docker compose run --rm node npm install docker compose run --rm node npm run build + - name: Create release file + run: | + printf "{\n \"releaseTimestamp\": $(date +%s),\n \"releaseTime\": \"$(date)\",\n \"releaseVersion\": \"${{ github.ref_name }}\"\n}" > public/release.json + cat public/release.json + - name: Cleanup after install run: | sudo chown -R runner:runner . diff --git a/CHANGELOG.md b/CHANGELOG.md index 44f5ee5e..8d6f5f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ All notable changes to this project will be documented in this file. - Added relations checksum feature flag. - Fixes saving issues described in issue where saving resulted in infinite spinner. - Fixed loading of routes containing null string values. +- Fixed release.json creation in v3. ### NB! Prior to 3.x the project was split into separate repositories diff --git a/infrastructure/build-n-push.sh b/infrastructure/build-n-push.sh index feae48ab..dc133e84 100755 --- a/infrastructure/build-n-push.sh +++ b/infrastructure/build-n-push.sh @@ -12,6 +12,8 @@ docker buildx build \ --no-cache \ --pull \ --build-arg APP_VERSION=${APP_VERSION} \ + --build-arg APP_RELEASE_TIME="$(date)" \ + --build-arg APP_RELEASE_TIMESTAMP="$(date +%s)" \ --tag=ghcr.io/itk-dev/os2display-api-service:${APP_VERSION} \ --file="display-api-service/Dockerfile" ../ diff --git a/infrastructure/display-api-service/Dockerfile b/infrastructure/display-api-service/Dockerfile index 1f0d6db6..c4fb1417 100644 --- a/infrastructure/display-api-service/Dockerfile +++ b/infrastructure/display-api-service/Dockerfile @@ -29,6 +29,8 @@ FROM --platform=$BUILDPLATFORM itkdev/php8.4-fpm:latest AS api_app_builder LABEL maintainer="ITK Dev " ARG APP_VERSION="develop" +ARG APP_RELEASE_TIMESTAMP=0 +ARG APP_RELEASE_TIME="" WORKDIR /app @@ -40,6 +42,9 @@ RUN APP_ENV=prod composer install --no-dev --optimize-autoloader --classmap-auth COPY --chown=deploy:deploy --from=assets_builder /app/public/build /app/public/build +# Create release.json file in public folder +RUN echo "{\"releaseTimestamp\": $APP_RELEASE_TIMESTAMP, \"releaseTime\": \"$APP_RELEASE_TIME\", \"releaseVersion\": \"$APP_RELEASE_VERSION\"}" > public/release.json + # Remove files we do not need to the final image RUN rm -rf package* vite.config.js From 660246b7e29fb98fb4060e4d1ebb987018051db1 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Mon, 30 Mar 2026 13:04:32 +0200 Subject: [PATCH 2/4] 6871: Added release variables to GitHub workflows --- .github/workflows/docker_build_stg_images.yml | 9 ++++++++- .github/workflows/github_build_release.yml | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_build_stg_images.yml b/.github/workflows/docker_build_stg_images.yml index 781b76f6..887d7c1e 100644 --- a/.github/workflows/docker_build_stg_images.yml +++ b/.github/workflows/docker_build_stg_images.yml @@ -34,13 +34,20 @@ jobs: with: images: os2display/display-api-service + - name: Set release timestamp + run: | + echo "APP_RELEASE_TIMESTAMP=$(echo $(date +%s))" >> $GITHUB_ENV + echo "APP_RELEASE_TIME=$(echo $(date))" >> $GITHUB_ENV + - name: Build and push (API) uses: docker/build-push-action@v6 with: context: ./infrastructure/display-api-service/ file: ./infrastructure/display-api-service/Dockerfile build-args: | - VERSION=${{ env.APP_VERSION }} + APP_VERSION=${{ env.APP_VERSION }} + APP_RELEASE_TIMESTAMP=${{ env.APP_RELEASE_TIMESTAMP }} + APP_RELEASE_TIME=${{ env.APP_RELEASE_TIME }} push: true tags: ${{ steps.meta-api.outputs.tags }} labels: ${{ steps.meta-api.outputs.labels }} diff --git a/.github/workflows/github_build_release.yml b/.github/workflows/github_build_release.yml index a59008b0..191dcc70 100644 --- a/.github/workflows/github_build_release.yml +++ b/.github/workflows/github_build_release.yml @@ -107,6 +107,11 @@ jobs: tags: | type=raw,value=${{ github.ref_name }} + - name: Set release timestamp + run: | + echo "APP_RELEASE_TIMESTAMP=$(echo $(date +%s))" >> $GITHUB_ENV + echo "APP_RELEASE_TIME=$(echo $(date))" >> $GITHUB_ENV + - name: Build and push Docker image (main) id: push-main uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 @@ -115,6 +120,8 @@ jobs: file: ./infrastructure/display-api-service/Dockerfile build-args: | APP_VERSION=${{ github.ref_name }} + APP_RELEASE_TIMESTAMP=${{ env.APP_RELEASE_TIMESTAMP }} + APP_RELEASE_TIME=${{ env.APP_RELEASE_TIME }} push: true tags: ${{ steps.meta-main.outputs.tags }} labels: ${{ steps.meta-main.outputs.labels }} @@ -137,6 +144,8 @@ jobs: file: ./infrastructure/nginx/Dockerfile build-args: | APP_VERSION=${{ github.ref_name }} + APP_RELEASE_TIMESTAMP=${{ env.APP_RELEASE_TIMESTAMP }} + APP_RELEASE_TIME=${{ env.APP_RELEASE_TIME }} APP_IMAGE=${{ env.IMAGE_NAME_MAIN }} push: true pull: true From 5c0ae1c898d68298444b7167593c0686a7fd85b7 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Mon, 30 Mar 2026 13:06:05 +0200 Subject: [PATCH 3/4] 6871: Fixed releaseVersion value --- infrastructure/display-api-service/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/display-api-service/Dockerfile b/infrastructure/display-api-service/Dockerfile index c4fb1417..3d00a6be 100644 --- a/infrastructure/display-api-service/Dockerfile +++ b/infrastructure/display-api-service/Dockerfile @@ -43,7 +43,7 @@ RUN APP_ENV=prod composer install --no-dev --optimize-autoloader --classmap-auth COPY --chown=deploy:deploy --from=assets_builder /app/public/build /app/public/build # Create release.json file in public folder -RUN echo "{\"releaseTimestamp\": $APP_RELEASE_TIMESTAMP, \"releaseTime\": \"$APP_RELEASE_TIME\", \"releaseVersion\": \"$APP_RELEASE_VERSION\"}" > public/release.json +RUN echo "{\"releaseTimestamp\": $APP_RELEASE_TIMESTAMP, \"releaseTime\": \"$APP_RELEASE_TIME\", \"releaseVersion\": \"$APP_VERSION\"}" > public/release.json # Remove files we do not need to the final image RUN rm -rf package* vite.config.js From 2d598a7b537f7a7d9f06997d6b1617f840e91bc5 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Thu, 2 Apr 2026 07:35:28 +0200 Subject: [PATCH 4/4] 6871: Changed release values to be variables set in GitHub action --- .github/workflows/github_build_release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github_build_release.yml b/.github/workflows/github_build_release.yml index 191dcc70..975b32f4 100644 --- a/.github/workflows/github_build_release.yml +++ b/.github/workflows/github_build_release.yml @@ -35,9 +35,14 @@ jobs: docker compose run --rm node npm install docker compose run --rm node npm run build + - name: Set release timestamp + run: | + echo "APP_RELEASE_TIMESTAMP=$(echo $(date +%s))" >> $GITHUB_ENV + echo "APP_RELEASE_TIME=$(echo $(date))" >> $GITHUB_ENV + - name: Create release file run: | - printf "{\n \"releaseTimestamp\": $(date +%s),\n \"releaseTime\": \"$(date)\",\n \"releaseVersion\": \"${{ github.ref_name }}\"\n}" > public/release.json + printf "{\n \"releaseTimestamp\": ${{ env.APP_RELEASE_TIMESTAMP }},\n \"releaseTime\": \"${{ env.APP_RELEASE_TIME }}\",\n \"releaseVersion\": \"${{ github.ref_name }}\"\n}" > public/release.json cat public/release.json - name: Cleanup after install