1- name : Toolkit Dry Run Dev
1+ name : Toolkit Deploy Sandbox
22
33on :
44 pull_request :
55 paths :
66 - " toolkit/**"
7- - " .github/workflows/toolkit-build .yaml"
7+ - " .github/workflows/toolkit-sandbox .yaml"
88 - " !**/*.md"
99
1010env :
11- COLUMNS : 99
12- TOOLKIT_ENV : staging
1311 TOOLKIT_VERSION : 0.5.94
1412 PYTHON_VERSION : " 3.11"
1513 CLIENT_CONFIG_FILE : " power_ops_config.yaml"
@@ -25,19 +23,22 @@ jobs:
2523 run : echo "image=cognite/toolkit:$TOOLKIT_VERSION" >> "$GITHUB_OUTPUT"
2624
2725 build-modules :
28- name : Toolkit Dry Run
26+ name : Build and deploy sandbox
2927 needs : get-toolkit-version
3028 runs-on : ubuntu-latest
31- environment : CI
29+ environment : power-ops-sandbox
3230 container :
3331 image : ${{ needs.get-toolkit-version.outputs.image }}
3432 env :
3533 LOGIN_FLOW : client_credentials
36- CDF_CLUSTER : ${{ vars.CLUSTER }}
37- CDF_PROJECT : ${{ vars.PROJECT }}
38- IDP_CLIENT_ID : ${{ vars .CLIENT_ID }}
34+ CDF_PROJECT : power-ops-sandbox
35+ CDF_CLUSTER : ${{ secrets.CLUSTER }}
36+ IDP_CLIENT_ID : ${{ secrets .CLIENT_ID }}
3937 IDP_CLIENT_SECRET : ${{ secrets.CLIENT_SECRET }}
40- IDP_TENANT_ID : ${{ vars.TENANT_ID }}
38+ IDP_TENANT_ID : ${{ secrets.TENANT_ID }}
39+ WF_TRIGGER_SECRET : ${{ secrets.WF_TRIGGER_SECRET }}
40+ TOOLKIT_ENV : ${{ secrets.TOOLKIT_ENV}}
41+
4142 defaults :
4243 run :
4344 shell : bash
@@ -61,13 +62,13 @@ jobs:
6162 set -o pipefail
6263 cdf build --verbose --env $TOOLKIT_ENV --build-dir cdf-tk-build | tee cdf-tk-logs/build.log
6364
64- - name : Dry run modules deployment
65+ - name : Deploy modules
6566 id : deploy
6667 continue-on-error : true
6768 if : ${{ steps.build.outcome == 'success' }}
6869 run : |
6970 set -o pipefail
70- cdf deploy --verbose --dry-run cdf-tk-build | tee cdf-tk-logs/deploy.log
71+ cdf deploy --verbose cdf-tk-build | tee cdf-tk-logs/deploy.log
7172
7273 - name : Store logs
7374 id : store-logs
7980 if-no-files-found : error
8081
8182 resync-purge :
82- name : Resync Purge Dry Run to CDF project ${{ vars.PROJECT }}
83+ name : Resync Purge to CDF project power-ops-sandbox
8384 environment :
84- name : CI
85+ name : power-ops-sandbox
8586 runs-on : ubuntu-latest
8687 outputs :
8788 purge-status : ${{ steps.purge.outcome }}
@@ -104,19 +105,19 @@ jobs:
104105 poetry config virtualenvs.create false
105106 poetry install
106107
107- - name : Run resync plan
108+ - name : Run resync purge
108109 id : purge
109110 env :
110111 CLIENT_SECRET : ${{ secrets.CLIENT_SECRET }}
111- CLIENT_ID : ${{ vars .CLIENT_ID }}
112- PROJECT : ${{ vars.PROJECT }}
113- CLUSTER : ${{ vars .CLUSTER }}
114- TENANT_ID : ${{ vars .TENANT_ID }}
112+ CLIENT_ID : ${{ secrets .CLIENT_ID }}
113+ PROJECT : power-ops-sandbox
114+ CLUSTER : ${{ secrets .CLUSTER }}
115+ TENANT_ID : ${{ secrets .TENANT_ID }}
115116 continue-on-error : true
116117 run : |
117118 echo Running resync plan in CDF environment $PROJECT
118119 set -o pipefail
119- powerops purge $CLIENT_CONFIG_FILE $CONFIGURATION_FILE --dry-run -- logs resync-logs/purge.log
120+ powerops purge $CLIENT_CONFIG_FILE $CONFIGURATION_FILE --logs resync-logs/purge.log
120121
121122 - name : Store logs
122123 id : store-logs
@@ -155,7 +156,7 @@ jobs:
155156 run : |
156157 set -e
157158 B_STATUS="Build status: **${{ needs.build-modules.outputs.build-status }}**"
158- DR_STATUS="Dry run status: **${{ needs.build-modules.outputs.deploy-status }}**"
159+ D_STATUS="Deploy status: **${{ needs.build-modules.outputs.deploy-status }}**"
159160 RP_STATUS="Resync purge status: **${{ needs.resync-purge.outputs.purge-status }}**"
160161
161162 if [ -f cdf-tk-logs/deploy.log ]; then
@@ -177,8 +178,8 @@ jobs:
177178
178179 RUN_LINK="[$GITHUB_RUN_ID]($REPO_URL/actions/runs/$GITHUB_RUN_ID)"
179180
180- printf 'Toolkit dry run triggered: %s\n\n%s\n%s\n%s\n\n' \
181- "$RUN_LINK" "$B_STATUS" "$DR_STATUS " "$RP_STATUS" > pr-comment-body.txt
181+ printf 'Toolkit deploy triggered: %s\n\n%s\n%s\n%s\n\n' \
182+ "$RUN_LINK" "$B_STATUS" "$D_STATUS " "$RP_STATUS" > pr-comment-body.txt
182183
183184 printf '<details><summary>View Toolkit Logs</summary>\n\n```\n%s\n```\n</details>\n\n' \
184185 "$MSG" >> pr-comment-body.txt
0 commit comments