Skip to content

Commit

Permalink
Fix the way we parse the deployment URL
Browse files Browse the repository at this point in the history
  • Loading branch information
vazexqi committed Feb 7, 2025
1 parent 82bd743 commit 01cc9e1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
- name: Zup Deploy
shell: bash
run: |
npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" | tee ./DEPLOYMENT_STDOUT
npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" 2>&1 | tee ./DEPLOYMENT_STDOUT
- name: Zup Test
shell: bash
run: |
npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -E 's/Deployed to (.*)/\1/')
npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | grep "Deployed to" | sed -n -E 's/.*Deployed to (https:\/\/[^ ]+).*/\1/p')
- name: Zup Delete
if: ${{ github.event_name == 'pull_request' }}
Expand Down
15 changes: 8 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ npm_install:
zup_deploy:
stage: deploy
script:
- npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" | tee ./DEPLOYMENT_STDOUT
- npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" 2>&1| tee
./DEPLOYMENT_STDOUT
artifacts:
expire_in: 30 minutes
paths:
Expand All @@ -23,20 +24,20 @@ zup_deploy:
zup_test:
stage: deploy
needs: [zup_deploy]
script:
- npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -E 's/Deployed to (.*)/\1/')
script: |
npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -n -E 's/.*Deployed to (https:\/\/[^ ]+).*/\1/p')
zup_delete:
stage: deploy
needs: [zup_deploy, zup_test]
only:
- merge_requests
script:
- npx @zuplo/cli delete --url $(cat ./DEPLOYMENT_STDOUT | sed -E 's/Deployed to (.*)/\1/') --apiKey "$ZUPLO_API_KEY" --wait
script: |
npx @zuplo/cli delete --url $(cat ./DEPLOYMENT_STDOUT | sed -n -E 's/.*Deployed to (https:\/\/[^ ]+).*/\1/p') --apiKey "$ZUPLO_API_KEY" --wait
# This is not necessary but it showcases how you can list your zups
zup_list:
stage: deploy
needs: [zup_test]
script:
- npx @zuplo/cli list --apiKey "$ZUPLO_API_KEY"
script: |
npx @zuplo/cli list --apiKey "$ZUPLO_API_KEY"
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ steps:
# 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
FORCE_COLOR=0 npx @zuplo/cli deploy --api-key $(ZUPLO_API_KEY) | tee ./DEPLOYMENT_STDOUT
FORCE_COLOR=0 npx @zuplo/cli deploy --api-key $(ZUPLO_API_KEY) 2>&1 | tee ./DEPLOYMENT_STDOUT
displayName: "Zup Deploy"
- script: |
npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -E 's/Deployed to (.*)/\1/')
npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -n -E 's/.*Deployed to (https:\/\/[^ ]+).*/\1/p')
displayName: "Zup Test"
- script: |
npx @zuplo/cli delete --url $(cat ./DEPLOYMENT_STDOUT | sed -E 's/Deployed to (.*)/\1/') --api-key $(ZUPLO_API_KEY) --wait
npx @zuplo/cli delete --url $(cat ./DEPLOYMENT_STDOUT | sed -n -E 's/.*Deployed to (https:\/\/[^ ]+).*/\1/p') --api-key $(ZUPLO_API_KEY) --wait
displayName: "Zup Delete"
# Only run this step if the build is a pull request
condition: eq(variables['Build.Reason'], 'PullRequest')
Expand Down
13 changes: 7 additions & 6 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pipelines:
# 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
- npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" 2>&1 | tee
./DEPLOYMENT_STDOUT
artifacts:
- DEPLOYMENT_STDOUT
Expand All @@ -37,22 +37,23 @@ pipelines:
# 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
- npx @zuplo/cli deploy --apiKey "$ZUPLO_API_KEY" 2>&1 | 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/')
- npx @zuplo/cli test --endpoint $(cat ./DEPLOYMENT_STDOUT | sed -n
-E 's/.*Deployed to (https:\/\/[^ ]+).*/\1/p')
- 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
$(cat ./DEPLOYMENT_STDOUT | sed -n -E 's/.*Deployed to
(https:\/\/[^ ]+).*/\1/p') --apiKey "$ZUPLO_API_KEY" --wait; exit;
fi
# This is not necessary but it showcases how you can list your zups
- step:
name: Zup List
Expand Down

0 comments on commit 01cc9e1

Please sign in to comment.