-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
60 lines (59 loc) · 2.14 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
image: node:18
pipelines:
branches:
# If your default branch is not main, change this to match
main:
- step:
name: NPM Install
script:
- npm install
- step:
name: Zup Deploy
# set -o pipefail
# This way if the deploy fails, we fail before piping to tee.
# Note that you are not required to use tee. We are using it in this example so that the output is available to the terminal and written to the file.
script:
- set -o pipefail
- npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" | tee
./DEPLOYMENT_STDOUT
artifacts:
- DEPLOYMENT_STDOUT
- step:
name: Zup Test
script:
- npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -E
's/Deployed to (.*)/\1/')
pull-requests:
"**":
- step:
name: NPM Install
script:
- npm install
- step:
name: Zup Deploy
# set -o pipefail
# This way if the deploy fails, we fail before piping to tee.
# Note that you are not required to use tee. We are using it in this example so that the output is available to the terminal and written to the file.
script:
- set -o pipefail
- npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" | tee
./DEPLOYMENT_STDOUT
artifacts:
- DEPLOYMENT_STDOUT
- step:
name: Zup Test
script:
- npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -E
's/Deployed to (.*)/\1/')
- step:
name: Zup Delete (if necessary)
script:
- echo $BITBUCKET_PR_ID
- if [[ -n "$BITBUCKET_PR_ID" ]]; then npx @zuplo/cli delete --url
$(cat ./DEPLOYMENT_STDOUT | sed -E 's/Deployed to (.*)/\1/')
--apiKey "$ZUPLO_API_KEY" --wait; exit; fi
# This is not necessary but it showcases how you can list your zups
- step:
name: Zup List
script:
- npx @zuplo/cli list --apiKey "$ZUPLO_API_KEY"