-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from GSA-TTS/gitlab-ci-image
Build a `-glr` variant for use with gitlab-runner-cloudgov.
- Loading branch information
Showing
6 changed files
with
157 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Docker | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: gsa-tts/trestle | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
flavor: latest=false | ||
tags: type=sha | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | ||
with: | ||
context: . | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Extract Docker metadata - glr variant | ||
id: meta-glr | ||
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
flavor: latest=false | ||
tags: type=raw,value=${{ github.sha }}-glr | ||
|
||
- name: Build and push Docker image - glr variant | ||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | ||
with: | ||
context: . | ||
file: Dockerfile.glr | ||
build-args: BASE_IMAGE=${{ fromJson(steps.meta.outputs.json).tags[0] }} | ||
push: false | ||
tags: ${{ steps.meta-glr.outputs.tags }} | ||
labels: ${{ steps.meta-glr.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file builds docker-trestle for use within a GitLab Runner | ||
ARG BASE_IMAGE=ghcr.io/gsa-tts/trestle:latest | ||
FROM ${BASE_IMAGE} AS base | ||
|
||
# Use the root user so we can run our install_dependencies scripts from runner manager | ||
USER root | ||
|
||
# install known glr dependencies to speed up test runs | ||
RUN apt-get update && apt-get install -y git git-lfs curl && apt-get clean | ||
|
||
# entrypoint and command that allow starting the image without a volume in place and keep it running | ||
COPY --chmod=755 entrypoint-glr.sh /app/entrypoint.sh | ||
CMD [ "bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /usr/bin/env bash | ||
|
||
# get PATH set properly in gitlab-ci | ||
echo 'export PATH="/app/bin:${PATH}"' > /etc/profile.d/trestle-scripts-path.sh | ||
|
||
exec "$@" |