1+ name : ' Test Deployment'
2+ description : ' Test deployment using customer workflow'
3+ inputs :
4+ app-dir :
5+ description : ' Application directory containing charts'
6+ default : ' applications/wg-easy'
7+ customer-name :
8+ description : ' Customer name for testing'
9+ required : true
10+ cluster-name :
11+ description : ' Cluster name for testing'
12+ required : true
13+ channel-name :
14+ description : ' Channel name for testing'
15+ required : true
16+ helm-version :
17+ description : ' Helm version to use'
18+ default : ' 3.17.3'
19+ cleanup :
20+ description : ' Whether to cleanup resources after testing'
21+ default : ' false'
22+
23+ outputs :
24+ customer-license :
25+ description : ' Customer license ID used for testing'
26+ value : ${{ steps.license.outputs.license-id }}
27+
28+ runs :
29+ using : ' composite'
30+ steps :
31+ - name : Setup tools
32+ uses : ./.github/actions/setup-tools
33+ with :
34+ helm-version : ${{ inputs.helm-version }}
35+ install-helmfile : ' true'
36+
37+ - name : Create customer
38+ shell : bash
39+ working-directory : ${{ inputs.app-dir }}
40+ run : |
41+ task customer-create \
42+ CUSTOMER_NAME="${{ inputs.customer-name }}" \
43+ RELEASE_CHANNEL="${{ inputs.channel-name }}"
44+
45+ - name : Get customer license
46+ id : license
47+ shell : bash
48+ working-directory : ${{ inputs.app-dir }}
49+ run : |
50+ LICENSE_ID=$(task utils:get-customer-license CUSTOMER_NAME="${{ inputs.customer-name }}" --silent | tail -1)
51+ echo "license-id=$LICENSE_ID" >> $GITHUB_OUTPUT
52+ echo "::add-mask::$LICENSE_ID"
53+
54+ - name : Create cluster with retry
55+ uses :
nick-fields/[email protected] 56+ with :
57+ timeout_minutes : 20
58+ retry_wait_seconds : 30
59+ max_attempts : 3
60+ command : |
61+ cd ${{ inputs.app-dir }}
62+ task cluster-create CLUSTER_NAME="${{ inputs.cluster-name }}"
63+
64+ - name : Setup cluster
65+ shell : bash
66+ working-directory : ${{ inputs.app-dir }}
67+ run : |
68+ task setup-kubeconfig CLUSTER_NAME="${{ inputs.cluster-name }}"
69+ task cluster-ports-expose CLUSTER_NAME="${{ inputs.cluster-name }}"
70+
71+ - name : Update dependencies
72+ shell : bash
73+ working-directory : ${{ inputs.app-dir }}
74+ run : task dependencies-update
75+
76+ - name : Deploy application
77+ shell : bash
78+ working-directory : ${{ inputs.app-dir }}
79+ run : |
80+ task customer-helm-install \
81+ CUSTOMER_NAME="${{ inputs.customer-name }}" \
82+ CLUSTER_NAME="${{ inputs.cluster-name }}" \
83+ CHANNEL_SLUG="${{ inputs.channel-name }}" \
84+ REPLICATED_LICENSE_ID="${{ steps.license.outputs.license-id }}"
85+
86+ - name : Run tests
87+ shell : bash
88+ working-directory : ${{ inputs.app-dir }}
89+ run : task test
90+
91+ - name : Cleanup resources
92+ if : inputs.cleanup == 'true'
93+ shell : bash
94+ working-directory : ${{ inputs.app-dir }}
95+ run : |
96+ task cleanup-pr-resources BRANCH_NAME="${{ inputs.customer-name }}"
0 commit comments