File tree Expand file tree Collapse file tree 3 files changed +41
-9
lines changed Expand file tree Collapse file tree 3 files changed +41
-9
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,4 @@ packages:
3131scripts :
3232 - name : preview
3333 description : Build Gitpod, create a preview environment, and deploy to it
34- script : |
35- export TF_INPUT=0
36- export TF_IN_AUTOMATION=true
37- source "preview/workflow/lib/ensure-gcloud-auth.sh"
38- ensure_gcloud_auth
39- leeway run dev/preview:create-preview
40- leeway run dev/preview:build
41- previewctl install-context
42- leeway run dev/preview:deploy-gitpod
34+ script : ./preview/workflow/preview/preview.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # this script is meant to be sourced
4+
5+ function git:branch-name {
6+ git rev-parse --abbrev-ref HEAD
7+ }
8+
9+ function git:is-on-main {
10+ if [[ " $( git:branch-name) " == " main" ]]
11+ then return 0
12+ else return 1
13+ fi
14+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # shellcheck disable=1091
3+
4+ set -euo pipefail
5+
6+ ROOT=" $( realpath " $( dirname " $0 " ) " ) /../../../../"
7+
8+ source " ${ROOT} /dev/preview/workflow/lib/ensure-gcloud-auth.sh"
9+ source " ${ROOT} /dev/preview/workflow/lib/common.sh"
10+ source " ${ROOT} /dev/preview/workflow/lib/git.sh"
11+
12+ # Don't prompt user before terraform apply
13+ export TF_INPUT=0
14+ export TF_IN_AUTOMATION=true
15+
16+ if git:is-on-main; then
17+ log_error " We don't support running dev:preview from the main branch. Please switch to another branch."
18+ exit 1
19+ fi
20+
21+ ensure_gcloud_auth
22+
23+ leeway run dev/preview:create-preview
24+ leeway run dev/preview:build
25+ previewctl install-context
26+ leeway run dev/preview:deploy-gitpod
You can’t perform that action at this time.
0 commit comments