-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (61 loc) · 2.03 KB
/
move_custome_ingresses.yml
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
name: Move Custom ingresses
on:
push:
branches:
- 'master'
paths:
- 'clusters/development/postBuild.yaml'
workflow_dispatch:
inputs:
radixZone:
description: 'Radix Zone'
required: true
type: choice
default: 'development'
options:
- 'development'
- 'monitoring'
- 'playground'
- 'production'
- 'c2-production'
permissions:
id-token: write
contents: read
jobs:
getActiveCluster:
name: Get active cluster
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
env:
radixZone: ${{ inputs.radixZone || 'development' }}
outputs:
DEST_CLUSTER: ${{ steps.getActiveCluster.outputs.DEST_CLUSTER }}
RADIX_ENVIRONMENT: ${{ steps.getActiveCluster.outputs.RADIX_ENVIRONMENT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: getActiveCluster
id: getActiveCluster
run: |
### Download yq
BINARY="yq_linux_amd64"
VERSION="v4.32.2"
postBuild="clusters/${{ env.radixZone }}/postBuild.yaml"
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\
tar xz && sudo mv ${BINARY} /usr/bin/yq
### Start
echo "DEST_CLUSTER=$(yq '.spec.postBuild.substitute.ACTIVE_CLUSTER' < ${postBuild})" >> $GITHUB_OUTPUT
echo "RADIX_ENVIRONMENT=$(yq '.spec.postBuild.substitute.RADIX_ENVIRONMENT' < ${postBuild})" >> $GITHUB_OUTPUT
moveCustomIngress:
name: Move Custom Ingress
needs: getActiveCluster
uses: equinor/radix-platform/.github/workflows/move_custom_ingresses.yml@master
with:
DEST_CLUSTER: ${{ needs.getActiveCluster.outputs.DEST_CLUSTER }}
GH_ENVIRONMENT: maintenance-${{ needs.getActiveCluster.outputs.RADIX_ENVIRONMENT }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}