Skip to content

Commit

Permalink
Use ghcr for e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Vazquez <jose.vazquez@mongodb.com>
  • Loading branch information
josvazg committed Nov 8, 2023
1 parent 5869b0d commit e6bffca
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Prepare E2E configuration and image
runs-on: ubuntu-latest
env:
DOCKER_REPO: mongodb/mongodb-atlas-kubernetes-operator-prerelease
GHCR_REPO: ghcr.io/${{ github.repository_owner }}/mongodb-atlas-kubernetes-operator-prerelease
steps:
- if: ${{ inputs.forked == false }}
name: Check out code
Expand All @@ -33,23 +33,26 @@ jobs:
- name: Prepare tag
id: prepare
uses: ./.github/actions/set-tag
- name: Build and Push image
uses: ./.github/actions/build-push-image
- name: Log in to ghcr.io registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build and Push to ${{ steps.prepare.outputs.tag }}
uses: docker/build-push-action@v3
with:
repository: ${{ env.DOCKER_REPO }}
version: ${{ steps.prepare.outputs.tag }}
context: .
file: Dockerfile
build-args: VERSION=${{ steps.prepare.outputs.tag }}
platforms: linux/amd64
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
push_to_quay: false
forked: ${{ inputs.forked }}
cache-from: type=gha
cache-to: type=gha,mode=max
sbom: true
push: true
tags: ${{ steps.prepare.outputs.tag }}
prepare-e2e-bundle:
name: Prepare E2E Bundle configuration and image
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: docker.io
DOCKER_REPO: mongodb/mongodb-atlas-kubernetes-operator-prerelease
DOCKER_BUNDLES_REPO: mongodb/mongodb-atlas-kubernetes-bundles-prerelease
GHCR_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-operator-prerelease
GHCR_BUNDLES_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease
steps:
- if: ${{ inputs.forked == false }}
name: Check out code
Expand All @@ -71,7 +74,7 @@ jobs:
- name: Generate configuration for the tests
uses: ./.github/actions/gen-install-scripts
with:
IMAGE_URL: ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}
IMAGE_URL: ${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }}
VERSION: ${{ steps.prepare.outputs.tag }}
ENV: dev
- name: Change path for the test
Expand Down Expand Up @@ -99,31 +102,31 @@ jobs:
- name: Prepare docker tag
id: prepare-docker-bundle-tag
run: |
REPOSITORY=${{ env.DOCKER_BUNDLES_REPO }}
REPOSITORY=${{ env.GHCR_BUNDLES_REPO }}
TAG=${{ steps.prepare.outputs.tag }}
TAGS="${REPOSITORY}:${TAG}"
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Log in to ghcr.io registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build and Push image
uses: ./.github/actions/build-push-image
uses: docker/build-push-action@v3
with:
get-existing-cache: true
context: .
file: bundle.Dockerfile
repository: ${{ env.DOCKER_BUNDLES_REPO }}
version: ${{ steps.prepare.outputs.tag }}
build-args: VERSION=${{ steps.prepare.outputs.tag }}
platforms: linux/amd64
push_to_docker: false
push_to_quay: true
quay_username: mongodb+mongodb_atlas_kubernetes
quay_password: ${{ secrets.QUAY_PASSWORD }}
forked: ${{ inputs.forked }}
cache-from: type=gha
cache-to: type=gha,mode=max
sbom: true
push: true
tags: ${{ steps.prepare.outputs.tag }}
e2e:
name: E2E tests
needs: [prepare-e2e, prepare-e2e-bundle]
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: docker.io
DOCKER_REPO: mongodb/mongodb-atlas-kubernetes-operator-prerelease
DOCKER_BUNDLES_REPO: quay.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease
GHCR_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-operator-prerelease
GHCR_BUNDLES_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -198,7 +201,7 @@ jobs:
- name: Generate configuration for the tests
uses: ./.github/actions/gen-install-scripts
with:
IMAGE_URL: ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}
IMAGE_URL: ${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }}
VERSION: ${{ steps.prepare.outputs.tag }}
ENV: dev

Expand Down Expand Up @@ -236,13 +239,11 @@ jobs:
MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
MCLI_ORG_ID: ${{ secrets.ATLAS_ORG_ID}}
MCLI_OPS_MANAGER_URL: "https://cloud-qa.mongodb.com/"
IMAGE_URL: "${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}"
BUNDLE_IMAGE: "${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_BUNDLES_REPO}}:${{ steps.prepare.outputs.tag }}"
IMAGE_URL: "${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }}"
BUNDLE_IMAGE: "${{ env.GHCR_BUNDLES_REPO}}:${{ steps.prepare.outputs.tag }}"
K8S_PLATFORM: "${{ steps.properties.outputs.k8s_platform }}"
K8S_VERSION: "${{ steps.properties.outputs.k8s_version }}"
TEST_NAME: "${{ matrix.test }}"
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
OPENSHIFT_USER: ${{ secrets.OPENSHIFT_USER }}
OPENSHIFT_PASS: ${{ secrets.OPENSHIFT_PASS }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down

0 comments on commit e6bffca

Please sign in to comment.