Build vSphere templates for Konvoy E2E tests #114
Workflow file for this run
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
# Builds vSphere image template when a release tag is created | |
name: Build vSphere templates for Konvoy E2E tests | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build-e2e: | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
include: | |
- os: "redhat 8.4" | |
buildConfig: "offline" | |
- os: "redhat 8.4" | |
buildConfig: "offline-fips" | |
- os: "ubuntu 20.04" | |
buildConfig: "offline" | |
- os: "rocky 9.1" | |
buildConfig: "offline" | |
runs-on: | |
- self-hosted | |
- small | |
continue-on-error: false | |
steps: | |
- name: Checkout konvoy-image-builder repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Login to dockerhub Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.NEXUS_USERNAME }} | |
password: ${{ secrets.NEXUS_PASSWORD }} | |
- name: Login to D2iQ's Mirror Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.D2IQ_DOCKER_MIRROR_REGISTRY}} | |
username: ${{ secrets.NEXUS_USERNAME }} | |
password: ${{ secrets.NEXUS_PASSWORD }} | |
- name: Setup buildkit | |
uses: docker/setup-buildx-action@v2 | |
- name: Setup SSH agent with private key to connect with pre-configured bastion host | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_BASTION_KEY_CONTENTS }} | |
# configure git to access private repo hosting vsphere module mesosphere/vcenter-tools | |
- name: Configure git to clone private registry from mesosphere org | |
run: | | |
git config --global url."https://git:${{ secrets.MESOSPHERECI_USER_TOKEN }}@github.com/mesosphere".insteadOf "https://github.com/mesosphere" | |
git config --global url."https://${{ secrets.MESOSPHERECI_USER_TOKEN }}:[email protected]/mesosphere".insteadOf ssh://[email protected]/mesosphere | |
- name: Build vSphere template for ${{ matrix.os }} with ${{ matrix.buildConfig }} configuration | |
uses: magefile/mage-action@v2 | |
with: | |
version: latest | |
args: runE2e "${{ matrix.os }}" "${{ matrix.buildConfig }}" ova false | |
env: | |
SSH_BASTION_KEY_CONTENTS: ${{ secrets.SSH_BASTION_KEY_CONTENTS }} | |
SSH_BASTION_PUBLIC_KEY_CONTENTS: ${{ secrets.SSH_BASTION_PUBLIC_KEY_CONTENTS }} | |
VSPHERE_USERNAME: ${{ secrets.VSPHERE_USERNAME }} | |
VSPHERE_USER: ${{ secrets.VSPHERE_USERNAME }} # required for terraform | |
VSPHERE_PASSWORD: ${{ secrets.VSPHERE_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }} | |
VSPHERE_SERVER: ${{ secrets.VSPHERE_SERVER }} | |
VSPHERE_DATASTORE: ${{ secrets.VSPHERE_DATASTORE }} | |
RHSM_ACTIVATION_KEY: ${{ secrets.RHSM_ACTIVATION_KEY }} | |
RHSM_ORG_ID: ${{ secrets.RHSM_ORG_ID }} | |
- name: Run make destroy to clean up failed tests | |
if: ${{ always() }} | |
run: make infra.vsphere.destroy || true | |
env: | |
SSH_BASTION_PUBLIC_KEY_CONTENTS: ${{ secrets.SSH_BASTION_PUBLIC_KEY_CONTENTS }} | |
VSPHERE_USERNAME: ${{ secrets.VSPHERE_USERNAME }} | |
VSPHERE_USER: ${{ secrets.VSPHERE_USERNAME }} # required for terraform | |
VSPHERE_PASSWORD: ${{ secrets.VSPHERE_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }} | |
VSPHERE_SERVER: ${{ secrets.VSPHERE_SERVER }} | |
VSPHERE_DATASTORE: ${{ secrets.VSPHERE_DATASTORE }} | |
VSPHERE_DATACENTER: ${{ secrets.VSPHERE_DATACENTER }} |