Skip to content

ci/build-push-image: fix nginx FRONTEND_BUILD_MODE error#2042

Merged
alxndrsn merged 6 commits into
getodk:masterfrom
alxndrsn:ci-build-push-image-missing-env-var
Jul 7, 2026
Merged

ci/build-push-image: fix nginx FRONTEND_BUILD_MODE error#2042
alxndrsn merged 6 commits into
getodk:masterfrom
alxndrsn:ci-build-push-image-missing-env-var

Conversation

@alxndrsn

@alxndrsn alxndrsn commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Closes #2043

What has been done to verify that this works as intended?

Ran it at: https://github.com/getodk/central/actions/runs/28703543011/job/85125477082

Still failing, but with a different error:

#39 [auth] getodk/central-nginx:pull,push token for ghcr.io
#39 DONE 0.0s
#38 exporting to image
#38 pushing layers 0.7s done
#38 ERROR: failed to push ghcr.io/getodk/central-nginx:pr-2042: denied: installation not allowed to Write organization package
------
 > exporting to image:
------
ERROR: failed to build: failed to solve: failed to push ghcr.io/getodk/central-nginx:pr-2042: denied: installation not allowed to Write organization package

I think this error is correct - this build was not run on a release git tag, so it's probably correct that it doesn't have permission to upload docker images for a release docker tag.

Why is this the best possible solution? Were any other approaches considered?

Likely a better long-term solution is to change actions from docker/build-push-action to docker/bake-action. However, this close to release it's prudent to keep changes minimal by not changing action. A ticket has been filed for changing action in the future at #2044.

How does this change impact users? Describe intentional behavior changes from code updates. What are the regression risks?

No impact.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

alxndrsn added 5 commits July 4, 2026 10:08
Fixes error seen on release:

```
> [linux/amd64 intermediate 4/5] RUN files/prebuild/write-version.sh:
0.073 files/prebuild/write-version.sh: line 26: FRONTEND_BUILD_MODE: unbound variable
```
@alxndrsn alxndrsn changed the title ci: fix build-push-image for FRONTEND_BUILD_MODE ci/build-push-image: fix nginx FRONTEND_BUILD_MODE error Jul 4, 2026
@alxndrsn alxndrsn marked this pull request as ready for review July 4, 2026 10:43
run: |
touch .env
echo "FRONTEND_VERSION=$(
docker compose config --format json | jq -r .services.nginx.build.args.FRONTEND_VERSION

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making this jq -er so the whole step fails if somehow the docker compose file or specific constant are missing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very helpful 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but doesn't work out-of-the-box in this case.

I think the assignment would have to be extracted from the echo call.

@lognaturel lognaturel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think this can be merged now. But it won't give us tagged v2026.2.0 images, right? Can we somehow force this action version to run on the tagged commit? Or temporarily set the frontend version in Github variables and rerun the old action?

@alxndrsn alxndrsn merged commit 3e9b78f into getodk:master Jul 7, 2026
7 checks passed
@alxndrsn alxndrsn deleted the ci-build-push-image-missing-env-var branch July 7, 2026 02:44
alxndrsn added a commit that referenced this pull request Jul 7, 2026
Fixes error seen on release:

```
> [linux/amd64 intermediate 4/5] RUN files/prebuild/write-version.sh:
0.073 files/prebuild/write-version.sh: line 26: FRONTEND_BUILD_MODE: unbound variable
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[central] ci/build-push-image/nginx: fails due to missing build args

2 participants