Skip to content

Commit

Permalink
Introduce nightly Docker tag (#824)
Browse files Browse the repository at this point in the history
Changes to how we build/publish Quesma Docker images:
* what used to be `quesma/quesma:latest` now becomes a pointer to
**latest released version**
* introducing `quesma/quesma:nightly` image which becomes the most
recent (not necessarily released/stable) version, always built and
pushed from the `main` branch
* removing image pushes to GCR for `quesma/quesma:nightly`. Release
images will stay, as GCP's products don't support pulling from DockerHub
(😢)
  • Loading branch information
mieciu authored Oct 1, 2024
1 parent 8634a06 commit 7d8973d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/docker-image-latest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Docker image build (latest)
# Pipeline which builds latest / nightly Docker images for Quesma
# pushes them to Docker Hub and GCR with `latest` tag,
# triggered by a push/merge to the `main` branch
name: Docker image build (nightly)
# Pipeline which builds `nightly` Docker images for Quesma
# pushes them to Docker Hub as `quesma/quesma:nightly` (and `quesma/quesma:<VERSION>`, if VERSION is specified explicitly)
#
# This workflow is triggered by a push/merge to the `main` branch
# quesma/quesma:latest image is a pointer to latest released version.

on:
push:
Expand All @@ -10,7 +12,7 @@ on:
inputs:
VERSION:
description: 'Version number to tag the image with (optional)'
default: latest
default: nightly
required: true
PUSH:
description: 'Whether to push the image to the registry'
Expand All @@ -35,13 +37,6 @@ jobs:
cache-dependency-path: ${{ matrix.module }}/go.sum
go-version: '1.22'

- name: Login to GCR (only for build running on `main` branch)
uses: docker/login-action@v3
with:
registry: europe-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_SERVICE_ACCOUNT_PRIVATE_KEY }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -57,11 +52,9 @@ jobs:
context: ${{ matrix.module }}/.
# when called from the main branch, `github.event.inputs.VERSION` doesn't use default value and is just empty
tags: |
europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:${{ github.sha }}
europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:${{ github.event.inputs.VERSION || 'latest' }}
quesma/quesma:${{ github.event.inputs.VERSION || 'latest' }}
quesma/quesma:latest
# Pushes to GCR only for `main` branch builds, unless set explicitly in the job input
quesma/quesma:${{ github.event.inputs.VERSION || 'nightly' }}
quesma/quesma:nightly
# Pushes to DockerHub only for `main` branch builds, unless set explicitly in the job input
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event.inputs.PUSH }}
build-args: |
QUESMA_BUILD_SHA=${{ github.sha }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
context: ${{ matrix.module }}/.
tags: |
europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:${{ github.event.inputs.VERSION }}
europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:latest
quesma/quesma:${{ github.event.inputs.VERSION }}
quesma/quesma:latest
push: true
build-args: |
QUESMA_BUILD_SHA=${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.7"
services:
quesma:
build: ../quesma
image: quesma:latest
image: quesma:nightly
environment:
- QUESMA_CONFIG_FILE=/mnt/ci-config.yaml
- QUESMA_logging_path=/var/quesma/logs
Expand Down
2 changes: 1 addition & 1 deletion ci/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.7"
services:
quesma:
build: ../quesma
image: quesma:latest
image: quesma:nightly
environment:
- QUESMA_CONFIG_FILE=/mnt/ci-config.yaml
- QUESMA_elasticsearch_url=http://elasticsearch:9200
Expand Down

0 comments on commit 7d8973d

Please sign in to comment.