-
Notifications
You must be signed in to change notification settings - Fork 21
133 lines (122 loc) · 5.35 KB
/
release-vsphere-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# 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: 10
matrix:
include:
- os: "redhat 8.6"
buildConfig: "offline"
- os: "redhat 8.6"
buildConfig: "offline-fips"
- os: "redhat 8.8"
buildConfig: "offline"
- os: "redhat 8.8"
buildConfig: "offline-fips"
- os: "ubuntu 20.04"
buildConfig: "basic"
- os: "ubuntu 22.04"
buildConfig: "basic"
- os: "rocky 9.1"
buildConfig: "offline"
- os: "oracle 9.4"
buildConfig: "basic"
- os: "oracle 9.4"
buildConfig: "fips"
- os: "flatcar"
buildConfig: "basic"
runs-on:
- self-hosted
- medium
continue-on-error: false
steps:
- name: Checkout konvoy-image-builder repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Login to dockerhub Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.NEXUS_USERNAME }}
password: ${{ secrets.NEXUS_PASSWORD }}
- name: Login to D2iQ's Mirror Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.D2IQ_DOCKER_MIRROR_REGISTRY}}
username: ${{ secrets.NEXUS_USERNAME }}
password: ${{ secrets.NEXUS_PASSWORD }}
- name: Setup buildkit
uses: docker/setup-buildx-action@v3
- 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@v3
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 }}
- name: Extract vsphere template name
id: extract-template
shell: bash
run: |
export RELEASE_TEMPLATE=$(jq -r '.last_run_uuid as $runid | .builds[] | select(.packer_run_uuid==$runid).artifact_id' manifest.json)
echo "release_template=${RELEASE_TEMPLATE}" >> "$GITHUB_OUTPUT"
echo "Release template = $RELEASE_TEMPLATE"
echo "$GITHUB_OUTPUT"
- name: Upload template to VCD
uses: ./.github/composite/vcd-e2e/
env:
VCD_SERVER: ${{ secrets.VCD_SERVER }}
VCD_ORG_USERNAME: ${{ secrets.VCD_ORG_USERNAME }}
VCD_ORG_PASSWORD: ${{ secrets.VCD_ORG_PASSWORD }}
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 }}
TEMPLATE_NAME_TO_UPLOAD: ${{ steps.extract-template.outputs.release_template }}