Skip to content

Commit b672c67

Browse files
committed
fmt
1 parent c72a04c commit b672c67

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

scripts/deploy-pr.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# Usage: ./deploy-pr.sh --skip-build
3-
# deploys the current branch to a PR environment and posts login credentials to
3+
# deploys the current branch to a PR environment and posts login credentials to
44
# [#pr-deployments](https://codercom.slack.com/archives/C05DNE982E8) Slack channel
55
# if --skip-build is passed, the build step will be skipped and the last build image will be used
66

@@ -9,24 +9,24 @@ set -euox pipefail
99
branchName=$(gh pr view --json headRefName | jq -r .headRefName)
1010

1111
if [[ "$branchName" == "main" ]]; then
12-
prNumber=$(git rev-parse --short HEAD)
12+
prNumber=$(git rev-parse --short HEAD)
1313
else
14-
prNumber=$(gh pr view --json number | jq -r .number)
14+
prNumber=$(gh pr view --json number | jq -r .number)
1515
fi
1616

1717
# if --skip-build is passed, the build job will be skipped and the last built image will be used
1818
if [[ "$*" == *--skip-build* ]]; then
19-
skipBuild=true
20-
#check if the image exists
21-
foundTag=$(curl -fsSL https://github.com/coder/coder/pkgs/container/coder-preview | grep -o "$prNumber" | head -n 1)
22-
if [ -z "$foundTag" ]; then
23-
echo "Image not found"
24-
echo ""$prNumber" tag not found in ghcr.io/coder/coder-preview"
25-
echo "Please remove --skip-build and try again"
26-
exit 1
27-
fi
19+
skipBuild=true
20+
#check if the image exists
21+
foundTag=$(curl -fsSL https://github.com/coder/coder/pkgs/container/coder-preview | grep -o "$prNumber" | head -n 1)
22+
if [ -z "$foundTag" ]; then
23+
echo "Image not found"
24+
echo ""$prNumber" tag not found in ghcr.io/coder/coder-preview"
25+
echo "Please remove --skip-build and try again"
26+
exit 1
27+
fi
2828
else
29-
skipBuild=false
29+
skipBuild=false
3030
fi
3131

3232
gh workflow run pr-deploy.yaml --ref "$branchName" -f pr_number="$imageTag" -f skip_build="$skipBuild"

0 commit comments

Comments
 (0)