Skip to content

Commit

Permalink
Update workflow publish container images
Browse files Browse the repository at this point in the history
  • Loading branch information
wkoot committed Nov 7, 2024
1 parent eb442ea commit f01914d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 51 deletions.
40 changes: 0 additions & 40 deletions .circleci/config.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Publish container images to Docker Hub

on: workflow_dispatch # Only triggered manually, must be done from a semantic version tag

jobs:
push_to_registry:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env:
IMAGE_EDITION: community
IMAGE_SUFFIX:
- env:
IMAGE_EDITION: developer
IMAGE_SUFFIX: -developer
steps:
- uses: actions/checkout@v4

- id: semver
name: Ensure that selected tag is a semantic version
uses: matt-usurp/validate-semver@v2
with:
version: ${{ github.ref }}

- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Package and push container to Docker Hub
if: ${{ github.ref_type == "tag" }}
run: |
export CONTAINER_TAG="${{ steps.semver.outputs.version }}${{ matrix.env.IMAGE_SUFFIX }}"
docker build --build-arg="IMAGE_EDITION=${{ matrix.env.IMAGE_EDITION }}" -t ictu/sonar:${CONTAINER_TAG} .
docker push ictu/sonar:${CONTAINER_TAG}
5 changes: 2 additions & 3 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Release Helm chart
name: Release Helm chart to Docker Hub

on: workflow_dispatch # Only triggered manually

Expand All @@ -9,8 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
12 changes: 4 additions & 8 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
1. Obtain the base version numbers from the vanilla SonarQube image directory `/opt/sonarqube/lib/extensions`, excluding build number
1. Update the config rules version number `rules_version` if the rules have been changed
1. Check for any runtime errors and warnings in the container logs
1. Create new version tags on github
1. `MAJOR.MINOR.PATCH`
1. `MAJOR.MINOR.PATCH-developer`
1. Build and push new images to docker hub with [CircleCI](https://app.circleci.com/pipelines/github/ICTU/sonar)
1. Update helm `Chart.yaml` with the new chart versions, corresponding with the new `appVersion`
1. Update the helm `values.yaml` with the new `ictu/sonar` image tag
1. Push the new chart as OCI artifact to docker hub `ictu/ictu-sonarqube`, with the GitHub action

1. Create new version tag on github, following semantic versioning as: `MAJOR.MINOR.PATCH`
1. Build and push new container images to Docker Hub `ictu/sonar`, with the [docker release GitHub action](https://github.com/ICTU/sonar/actions/workflows/docker-release.yml)
1. Push the updated helm chart as OCI artifact to Docker Hub `ictu/ictu-sonarqube`, with the [helm release GitHub action](https://github.com/ICTU/sonar/actions/workflows/helm-release.yml)
1. Update the Docker Hub overview pages if README content has changed

## Adding plugins

Expand Down

0 comments on commit f01914d

Please sign in to comment.