From 623eda9ed7f08476c3c68c0133d4f479f1d935c0 Mon Sep 17 00:00:00 2001 From: Craig Gill Date: Tue, 19 Mar 2024 13:13:51 -0700 Subject: [PATCH 1/5] Buildx doesn't like upper cases in docker image name --- .github/workflows/build-dev-image.yml | 2 +- .github/workflows/build-release-image.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index f028052..7b510c7 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -10,7 +10,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: slickdeals/jira-software COMMIT_SHA: ${{ github.sha }} jobs: diff --git a/.github/workflows/build-release-image.yml b/.github/workflows/build-release-image.yml index c3a9202..f0284a7 100644 --- a/.github/workflows/build-release-image.yml +++ b/.github/workflows/build-release-image.yml @@ -10,7 +10,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: slickdeals/jira-software COMMIT_SHA: ${{ github.sha }} jobs: @@ -23,6 +23,8 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: debug - name: Login to GHCR uses: docker/login-action@v3 with: From 54c7a22b59b5b1780495b521df83fa1d9a0be1cf Mon Sep 17 00:00:00 2001 From: Craig Gill Date: Tue, 19 Mar 2024 13:26:41 -0700 Subject: [PATCH 2/5] adds tags from meta step --- .github/workflows/build-dev-image.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index 7b510c7..7bf0cc4 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -28,10 +28,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ env.GITHUB_TOKEN }} - env: - GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata for the Docker image id: meta uses: docker/metadata-action@v5 @@ -45,7 +42,7 @@ jobs: with: context: ./app push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.COMMIT_SHA }} + tags: ${{ steps.meta.outputs.tags}} labels: ${{ steps.meta.outputs.labels }} build-args: | BUILD_TAG=${{ vars.DEVELOP_TAG }} \ No newline at end of file From c01d7f7c55308bdaaa0ba3d303010034a60f01a7 Mon Sep 17 00:00:00 2001 From: Craig Gill Date: Tue, 19 Mar 2024 14:03:02 -0700 Subject: [PATCH 3/5] more tweaks --- .github/workflows/build-dev-image.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index 7bf0cc4..604c0f5 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -1,6 +1,7 @@ name: Build & Push Jira Development Docker Image to GHCR on: + workflow_dispatch: pull_request: branches: - develop @@ -10,7 +11,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: slickdeals/jira-software + IMAGE_NAME: slickdeals/jira-software-dev COMMIT_SHA: ${{ github.sha }} jobs: @@ -34,15 +35,15 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - ${{ env.COMMIT_SHA }} - ${{ vars.DEVELOP_TAG}} - name: Build, Tag, and push Docker image uses: docker/build-push-action@v5 with: context: ./app push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags}} + tags: | + - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags}} + - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} + - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} build-args: | - BUILD_TAG=${{ vars.DEVELOP_TAG }} \ No newline at end of file + BUILD_TAG=${{ vars.DEVELOP_TAG }} From efe30bef18f1e4b8457107b5bbf2652a0e739690 Mon Sep 17 00:00:00 2001 From: Craig Gill Date: Tue, 19 Mar 2024 14:05:24 -0700 Subject: [PATCH 4/5] more tweaks --- .github/workflows/build-dev-image.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index 604c0f5..4da67ba 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -41,9 +41,8 @@ jobs: context: ./app push: ${{ github.event_name != 'pull_request' }} tags: | - - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags}} - - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} - - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} build-args: | BUILD_TAG=${{ vars.DEVELOP_TAG }} From 36f87b4a4cb8c746756a82f86dee31fd8905ccd4 Mon Sep 17 00:00:00 2001 From: Craig Gill Date: Tue, 19 Mar 2024 14:31:46 -0700 Subject: [PATCH 5/5] fix GH Actions --- .github/workflows/build-dev-image.yml | 8 +++++++- .github/workflows/build-release-image.yml | 22 +++++++++++----------- README.md | 10 +++++----- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index 4da67ba..9d1b80c 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -15,32 +15,38 @@ env: COMMIT_SHA: ${{ github.sha }} jobs: - build_image: + build_jira_dev_image: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata for the Docker image id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build, Tag, and push Docker image uses: docker/build-push-action@v5 with: context: ./app push: ${{ github.event_name != 'pull_request' }} tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ vars.DEVELOP_TAG }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build-release-image.yml b/.github/workflows/build-release-image.yml index f0284a7..51c255b 100644 --- a/.github/workflows/build-release-image.yml +++ b/.github/workflows/build-release-image.yml @@ -14,40 +14,40 @@ env: COMMIT_SHA: ${{ github.sha }} jobs: - build_image: + build_jira_prod_image: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - with: - buildkitd-flags: debug + - name: Login to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ env.GITHUB_TOKEN }} - env: - GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata for the Docker image id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - ${{ env.COMMIT_SHA }} - ${{ vars.RELEASE_TAG}} + - name: Build, Tag, and push Docker image uses: docker/build-push-action@v5 with: context: ./app push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.COMMIT_SHA }} + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ vars.RELEASE_TAG }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} build-args: | BUILD_TAG=${{ vars.RELEASE_TAG }} diff --git a/README.md b/README.md index 6b5d1dd..194c973 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Jira Software -This repo is responsible for creating the Atlassian Jira Docker image for our internal use. +This repo is responsible for creating the Atlassian Jira Docker images for our internal use that has been customized with a MySQL ODBC Connector. There's not a lot going on in repo itself other than defining a Dockerfile and a few GitHub Actions. ## Usage -To build an image for Jira Software, simply trigger a new run of the default pipeline for this repo via the [GitLab UI](https://it-gitlab.slickdeals.dev/itops/jira-software/-/pipelines) +To trigger a build of the Dev Jira Docker Image, make your changes in a branch and open a PR against the develop branch. Check the status of [GH Action](https://github.com/Slickdeals/jira-software/actions/workflows/build-dev-image.yml) and view the output of the job run for your changes. -The image will be built from the Dockerfile in the `app` folder of this repo. There are two images that will be built from these pipelines, an image for use with our Dev environment, and an image for our Production Jira instance. +Once you are happy with your changes, merge your PR into the develop branch. This will trigger a build of the Dev Jira Docker Image and push it to the Slickdeals GHCR. -Once built, the Docker Image will be tagged with the Git Commit SHA and the version of Jira Software that was used to build the image. +Merging your changes against the develop branch will trigger a Push of the Dev Jira Docker Image to the Slickdeals GHCR. -The resulting image will be pushed to the Slickdeals GHCR for use on our systems. +Once changes have been tested against the develop branch, they can be merged into the main branch. This will trigger a build of the Production Jira Docker Image and push it to the Slickdeals GHCR.