Skip to content

Commit

Permalink
ci(release): use Harbor to host test images
Browse files Browse the repository at this point in the history
  • Loading branch information
donch committed Oct 26, 2023
1 parent 42feb1c commit 2dca4ec
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ jobs:
runs-on: ubuntu-22.04
env:
VERSION: ${{ github.run_id }}
GHCR_REGISTRY: "ghcr.io"
HARBOR_URL: "harbor.enix.io"
HARBOR_REPO: "kube-image-keeper/kube-image-keeper"
GHCR_IMAGE: "ghcr.io/enix/kube-image-keeper"
QUAY_IMAGE: "quay.io/enix/kube-image-keeper"
steps:
- name: Checkout Repository
Expand All @@ -132,9 +134,9 @@ jobs:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ env.COMMIT_NAME }}
password: ${{ secrets.RELEASE_GITHUB_TOKEN }}
registry: ${{ env.HARBOR_URL }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}

- name: Generate image metadata
id: meta
Expand All @@ -156,7 +158,7 @@ jobs:
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ env.GHCR_REGISTRY }}/${{ github.repository }}:${{ env.VERSION }}
${{ env.HARBOR_URL }}/${{ env.HARBOR_REPO }}:${{ env.VERSION }}
- name: Build alpine container images
uses: docker/build-push-action@v5
Expand All @@ -170,16 +172,18 @@ jobs:
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ env.GHCR_REGISTRY }}/${{ github.repository }}:${{ env.VERSION }}-alpine
${{ env.HARBOR_URL }}/${{ env.HARBOR_REPO }}:${{ env.VERSION }}-alpine
e2e:
name: Tests End-to-End on K8s
needs:
- build
runs-on: ubuntu-22.04
env:
VERSION: ${{ github.run_id }}
GHCR_IMAGE_NAME: "ghcr.io/enix/kube-image-keeper"
GHCR_REGISTRY: "ghcr.io"
HARBOR_IMAGE: "harbor.enix.io/kube-image-keeper/kube-image-keeper"
HARBOR_REGISTRY: "harbor.enix.io"
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
strategy:
max-parallel: 6
matrix:
Expand Down Expand Up @@ -226,13 +230,12 @@ jobs:
run : |
set -euo pipefail
kubectl create namespace kuik-system
kubectl create secret docker-registry ghcr-secret -n kuik-system --docker-server=https://ghcr.io \
--docker-username=monkeynator --docker-password=${{ secrets.RELEASE_GITHUB_TOKEN }} \
--docker-email=${{ env.COMMIT_EMAIL }}
kubectl create secret docker-registry harbor-secret -n kuik-system --docker-server=${{ env.HARBOR_REGISTRY }} \
--docker-username="$HARBOR_USERNAME" --docker-password="$HARBOR_PASSWORD"
helm upgrade --install kube-image-keeper -n kuik-system --create-namespace ./helm/kube-image-keeper \
--set controllers.image.tag=${{ env.VERSION }} --set proxy.image.tag=${{ env.VERSION }} \
--set controllers.image.repository=${{ env.GHCR_IMAGE_NAME }} --set proxy.image.repository=${{ env.GHCR_IMAGE_NAME }} \
--set controllers.imagePullSecrets[0].name=ghcr-secret --set proxy.image.imagePullSecrets[0].name=ghcr-secret --debug
--set controllers.image.tag=$VERSION --set proxy.image.tag=$VERSION \
--set controllers.image.repository=$HARBOR_IMAGE --set proxy.image.repository=$HARBOR_IMAGE \
--set controllers.imagePullSecrets[0].name=harbor-secret --set proxy.image.imagePullSecrets[0].name=harbor-secret --debug
kubectl wait pods -n kuik-system -l app.kubernetes.io/instance=kube-image-keeper --for condition=Ready --timeout=30s
- name: Run end-to-end tests
Expand Down Expand Up @@ -416,7 +419,6 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}


- name: Generate image metadata
id: meta
uses: docker/metadata-action@v5
Expand Down

0 comments on commit 2dca4ec

Please sign in to comment.