Skip to content

Commit

Permalink
feat: #661 Update bitbucket pipelines config
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed Sep 11, 2024
1 parent a703f2f commit 688359d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
36 changes: 25 additions & 11 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,25 @@ definitions:
--filter=webapp...

steps:
- step: &codecommitPush
name: Push code to CodeCommit
- step: &deploy-current-branch
name: Deploy environment
trigger: manual
clone:
depth: full
script:
- git remote add codecommit "$CODE_COMMIT_REPO"
- git push --force -u codecommit "$BITBUCKET_BRANCH"
- git push codecommit --tags --force
- |
response=$(curl -s -w "%{http_code}" -o response_body.txt -X POST "${SB_DEPLOY_TRIGGER_URL}?secret=$(echo -n '${SB_DEPLOY_TRIGGER_SECRET}' | jq -sRr @uri)" \
-H "Content-Type: application/json" \
-d '{
"referenceName": "'"${BITBUCKET_COMMIT}"'",
"deployTarget": "'"${BITBUCKET_DEPLOYMENT_ENVIRONMENT}"'"
}')
status_code=$(tail -n1 <<< "$response")
if [ "$status_code" -ne 200 ]; then
echo "Deployment trigger failed with status code $status_code"
cat response_body.txt
exit 1
fi
- step: &webappTest
name: 'webapp: Lint & test'
Expand Down Expand Up @@ -544,7 +555,14 @@ pipelines:
branches:
master:
- parallel:
- step: *codecommitPush
- step:
<<: *deploy-current-branch
name: Deploy to Production env
deployment: production
- step:
<<: *deploy-current-branch
name: Deploy to QA env
deployment: qa

- step: *webappTest
- step: *webappBuild
Expand All @@ -570,8 +588,4 @@ pipelines:

- step: *internalDocsBuild
- step: *internalStatusDashboardBuild
- step: *internalToolsBuild
- step:
name: Delete unused branches from CodeCommit
script:
- /bin/bash packages/internal/tools/scripts/clean-codebuild-branches.sh
- step: *internalToolsBuild
17 changes: 0 additions & 17 deletions packages/internal/tools/scripts/clean-codebuild-branches.sh

This file was deleted.

0 comments on commit 688359d

Please sign in to comment.