Skip to content

Commit

Permalink
Merge pull request #5 from Slickdeals/OPS-10298-update-jira
Browse files Browse the repository at this point in the history
Ops 10298 update jira
  • Loading branch information
Wicaeed authored Mar 19, 2024
2 parents 3295b1c + 623eda9 commit 924b4d1
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@
name: Build & Push Docker Image to GitHub
name: Build & Push Jira Development Docker Image to GHCR

on:
pull_request:
branches:
- develop
push:
tags:
- "*.*.*"
branches:
- develop

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: slickdeals/jira-software
COMMIT_SHA: ${{ github.sha }}

jobs:
build_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- 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
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

password: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5.0.0
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
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.COMMIT_SHA }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
RELEASE_TAG=${{ vars.RELEASE_TAG }}
BUILD_TAG=${{ vars.DEVELOP_TAG }}
53 changes: 53 additions & 0 deletions .github/workflows/build-release-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build & Push Jira Release Docker Image to GHCR

on:
pull_request:
branches:
- main
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: slickdeals/jira-software
COMMIT_SHA: ${{ github.sha }}

jobs:
build_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 }}
- 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 }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_TAG=${{ vars.RELEASE_TAG }}
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Jira Software

This repo is responsible for creating the Jira Software image used for our on-prem Jira servers.
This repo is responsible for creating the Atlassian Jira Docker image for our internal use.

There's not a lot going on in repo itself other than defining a Dockerfile and gitlab-ci.yml file for the CI/CD pipeline.
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)

Set a variable `DEFAULT_RELEASE_TAG` to configure the image version to build.
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.

Ensure you only use semVer format for the `DEFAULT_RELEASE_TAG` variable, or simply leave it unset to run a build against whatever image is currently present at the `latest` tag from the [upstream Docker Hub repo](https://hub.docker.com/r/atlassian/jira-software/tags?page=1&name=latest)
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.


The resulting new image will be automatically saved into this Project's [Container Registry](https://it-gitlab.slickdeals.dev/itops/jira-software/container_registry) and should be pullable with Docker CLI from there.
The resulting image will be pushed to the Slickdeals GHCR for use on our systems.
4 changes: 2 additions & 2 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG RELEASE_TAG=latest
ARG BUILD_TAG=latest

FROM atlassian/jira-software:${RELEASE_TAG}-jdk11
FROM atlassian/jira-software:${BUILD_TAG}-jdk11

RUN apt-get update && apt-get install wget

Expand Down

0 comments on commit 924b4d1

Please sign in to comment.