Skip to content

Commit

Permalink
ci(SP-1682): publish images to quay.io as tmp fix (#5)
Browse files Browse the repository at this point in the history
* ci(SP-1682): publish images to quay.io as tmp fix

* ci: pushing new releases of image too

* test publish to quay.io

* testing again

* typos and using target-specific vars

* syntax error

* syntax error

* add missing quay.io repo

* removing test steps

* remove redundant target
  • Loading branch information
davidsalvador-tf authored Apr 6, 2022
1 parent bbbf827 commit d3b6828
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ jobs:
- name: Build image
run: make build
env:
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
CONTAINER_REGISTRY: ${{ secrets.ECR_REGISTRY }}

- name: Run unit tests for config generator
run: make test-config-generator
env:
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
CONTAINER_REGISTRY: ${{ secrets.ECR_REGISTRY }}

- name: Run integration tests (code samples) for global gitleaks config
run: make test-gitleaks-config
env:
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
CONTAINER_REGISTRY: ${{ secrets.ECR_REGISTRY }}

- name: Semantic Release
id: semantic
Expand All @@ -61,10 +61,27 @@ jobs:
run: make push
env:
RELEASE_TAG: ${{ steps.semantic.outputs.release-version }}
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
CONTAINER_REGISTRY: ${{ secrets.ECR_REGISTRY }}

- name: Push latest-tagged image
if: contains(github.ref, 'refs/heads/main')
run: make push-latest
env:
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
CONTAINER_REGISTRY: ${{ secrets.ECR_REGISTRY }}

# This is a temporary fix until SP-1665 is done
- name: Push versioned tagged image to quay.io
if: steps.semantic.outputs.new-release-published == 'true'
run: make push-quay
env:
RELEASE_TAG: ${{ steps.semantic.outputs.release-version }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Push latest-tagged image to quay.io
if: contains(github.ref, 'refs/heads/main')
run: make push-latest-quay
env:
RELEASE_TAG: ${{ steps.semantic.outputs.release-version }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMAGE_NAME := ${ECR_REGISTRY}/gitleaks-config
IMAGE_NAME := ${CONTAINER_REGISTRY}/gitleaks-config
RELEASE_TAG ?= dev

all: build run
Expand Down Expand Up @@ -29,3 +29,14 @@ push: build

push-latest: build
docker push $(IMAGE_NAME):latest

# Temporary until SP-1665 is done
push-quay: IMAGE_NAME=quay.io/typeform/gitleaks-config
push-quay: build
docker login -u=${DOCKER_USERNAME} -p=${DOCKER_PASSWORD} ${CONTAINER_REGISTRY} quay.io
docker push $(IMAGE_NAME):${RELEASE_TAG}

push-latest-quay: IMAGE_NAME=quay.io/typeform/gitleaks-config
push-latest-quay: build
docker login -u=${DOCKER_USERNAME} -p=${DOCKER_PASSWORD} ${CONTAINER_REGISTRY} quay.io
docker push $(IMAGE_NAME):latest

0 comments on commit d3b6828

Please sign in to comment.