CI/CD Pipelines
GitLab CI/CD: Deploy and Test
Run your test suite against the deployed environment to validate changes.
image: node:20
stages:
- deploy
- test
deploy:
stage: deploy
script:
- npm install
- npx zuplo deploy --api-key "$ZUPLO_API_KEY" 2>&1 | tee ./DEPLOYMENT_STDOUT
- echo "DEPLOYMENT_URL=$(grep -oP 'Deployed to \K(https://[^ ]+)'
./DEPLOYMENT_STDOUT)" >> deploy.env
artifacts:
reports:
dotenv: deploy.env
test:
stage: test
needs:
- deploy
script:
- npm install
- npx zuplo test --endpoint "$DEPLOYMENT_URL"
This pipeline:
- Deploys to Zuplo and captures the output
- Extracts the deployment URL and passes it to the test stage
- Runs tests against the deployed environment
Next Steps
Last modified on