-
Notifications
You must be signed in to change notification settings - Fork 174
79 lines (73 loc) · 3.28 KB
/
create-clusters.yml
File metadata and controls
79 lines (73 loc) · 3.28 KB
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
name: "RELEASE: Create Clusters"
on:
workflow_dispatch:
inputs:
version:
description: Version of the images
required: true
default: "4.1.1"
type: string
create-k8s-cluster:
description: Create a GKE demo cluster
default: false
type: boolean
create-os4-cluster:
description: Create an Openshift 4 demo cluster
default: false
type: boolean
create-long-cluster:
description: Create a long-running cluster
default: false
type: boolean
dry-run:
description: Dry-run
default: false
type: boolean
env:
main_branch: ${{github.event.repository.default_branch}}
script_url: /repos/${{github.repository}}/contents/.github/workflows/scripts/common.sh?ref=${{ github.ref_name }}
ACCEPT_RAW: "Accept: application/vnd.github.v3.raw"
GH_TOKEN: ${{ github.token }}
GH_NO_UPDATE_NOTIFIER: 1
TIMEOUT_WAIT_FOR_IMAGES_SECONDS: 3600
run-name: >-
${{
format('Create clusters for {0}', inputs.version)
}}
# Ensure that only a single automation workflow can run at a time for each release.
concurrency: Release automation ${{ inputs.version }}
jobs:
trim-cluster-names:
runs-on: ubuntu-latest
outputs:
cluster-with-fake-load-name-cleaned: ${{ steps.cluster-names.outputs.cluster-with-fake-load-name-cleaned }}
cluster-with-real-load-name-cleaned: ${{ steps.cluster-names.outputs.cluster-with-real-load-name-cleaned }}
env:
CLUSTER_WITH_FAKE_LOAD_NAME: lfl-${{ github.event.inputs.version }}
CLUSTER_WITH_REAL_LOAD_NAME: lrl-${{ github.event.inputs.version }}
steps:
- name: Trim and clean cluster names
id: cluster-names
run: |
# Cluster names are cropped to infra's max length and dots replaced with dashes.
# Latter is to avoid informing release engineers of incorrect cluster names.
CLEANED_CLUSTER_WITH_FAKE_LOAD_NAME="$(echo "${CLUSTER_WITH_FAKE_LOAD_NAME:0:28}" | tr '.' '-')"
echo "cluster-with-fake-load-name-cleaned=${CLEANED_CLUSTER_WITH_FAKE_LOAD_NAME}" >> "${GITHUB_OUTPUT}"
CLEANED_CLUSTER_WITH_REAL_LOAD_NAME="$(echo "${CLUSTER_WITH_REAL_LOAD_NAME:0:28}" | tr '.' '-')"
echo "cluster-with-real-load-name-cleaned=${CLEANED_CLUSTER_WITH_REAL_LOAD_NAME}" >> "${GITHUB_OUTPUT}"
clusters:
name: Setup demo clusters
needs: trim-cluster-names
uses: stackrox/actions/.github/workflows/create-demo-clusters.yml@9238e423c3ae1ac4eb0f254cbb98da9daae24d86 # ratchet:stackrox/actions/.github/workflows/create-demo-clusters.yml@v1
secrets: inherit
with:
version: ${{github.event.inputs.version}}
create-k8s-cluster: ${{github.event.inputs.create-k8s-cluster == 'true'}}
create-os4-cluster: ${{github.event.inputs.create-os4-cluster == 'true'}}
create-long-cluster: ${{github.event.inputs.create-long-cluster == 'true'}}
dry-run: ${{github.event.inputs.dry-run == 'true'}}
workflow-ref: v1
kube-burner-config-ref: ${{ github.event.inputs.version }}
kube-burner-config-repo: stackrox
cluster-with-fake-load-name: ${{ needs.trim-cluster-names.outputs.cluster-with-fake-load-name-cleaned }}
cluster-with-real-load-name: ${{ needs.trim-cluster-names.outputs.cluster-with-real-load-name-cleaned }}