File tree 1 file changed +29
-2
lines changed
1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,33 @@ sudo chown -R gitpod:gitpod /workspace
15
15
git config --global user.name roboquat
16
16
git config --global user.email
[email protected]
17
17
18
- git checkout -b " platform-artificial-job-$( echo $RANDOM | md5sum | head -c 20; echo ; ) "
18
+ BRANCH=" platform-artificial-job-$( echo $RANDOM | md5sum | head -c 20; echo ; ) "
19
+ git checkout -b " $BRANCH " | werft log slice " Creating new branch"
19
20
20
- werft run github -a with-preview=true
21
+ BUILD_ID=$( werft run github -a with-preview=true)
22
+ job_url=" https://werft.gitpod-dev.com/job/${BUILD_ID} "
23
+ echo " Triggered job $job_url " | werft log slice " Triggering new job"
24
+ werft log result -d " build job" url " $job_url "
25
+
26
+ while true ; do
27
+ job_phase=$( werft job get " ${BUILD_ID} " -o json | jq --raw-output ' .phase' )
28
+ if [[ ${job_phase} != " PHASE_DONE" ]]; then
29
+ echo " Waiting for ${BUILD_ID} to finish running. Current phase: ${job_phase} . Sleeping 10 seconds." | werft log slice " Waiting for job completion" ;
30
+ sleep 10
31
+ else
32
+ echo " Phase reached ${job_phase} . continuing." | werft log slice " Waiting for job completion" ;
33
+ break
34
+ fi
35
+ done
36
+
37
+ # ##########
38
+ # Deleting artificial preview
39
+ # ##########
40
+
41
+ werft log phase " Deleting artificial preview" " Deleting artificial preview"
42
+
43
+ preview=$( previewctl get-name)
44
+ DELETE_JOB_ID=$( werft run github -j .werft/platform-delete-preview-environment.yaml -a preview=" $preview " )
45
+ delete_job_url=" https://werft.gitpod-dev.com/job/${DELETE_JOB_ID} "
46
+ echo " Triggered job $delete_job_url " | werft log slice " Triggering new job"
47
+ werft log result -d " delete preview job" url " $delete_job_url "
You can’t perform that action at this time.
0 commit comments