You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hello All,
I have below parallel step, I want to refactor the same to reduce the number of lines in bitbucket-pipelines.yml
- parallel:
- step:
name: Deploy Identity Service Main to Feature
script:
- echo "deploy identity service"
- export SERVICE_TO_DEPLOY=identityservice
- echo "Deploy service ${SERVICE_TO_DEPLOY}"
- pipe: atlassian/trigger-pipeline:5.1.0
variables:
BITBUCKET_USERNAME: $BB_INTEGRATION_USER
BITBUCKET_APP_PASSWORD: $BB_INTEGRATION_TOKEN
REPOSITORY: ${SERVICE_TO_DEPLOY}
REF_TYPE: "branch"
REF_NAME: "pipelines"
CUSTOM_PIPELINE_NAME: "main-to-feature-deploy"
PIPELINE_VARIABLES: >
[{
"key": "BRANCH_TO_DEPLOY",
"value": "${BITBUCKET_BRANCH}"
},
{
"key": "SOURCE_REPO_NAME",
"value": "$BITBUCKET_REPO_SLUG"
}]
WAIT: "true"
- step:
name: Deploy Admin Service Main to Feature
script:
- echo "deploy admin service"
- export SERVICE_TO_DEPLOY=adminservice
- echo "Deploy service ${SERVICE_TO_DEPLOY}"
- pipe: atlassian/trigger-pipeline:5.1.0
variables:
BITBUCKET_USERNAME: $BB_INTEGRATION_USER
BITBUCKET_APP_PASSWORD: $BB_INTEGRATION_TOKEN
REPOSITORY: ${SERVICE_TO_DEPLOY}
REF_TYPE: "branch"
REF_NAME: "pipelines"
CUSTOM_PIPELINE_NAME: "main-to-feature-deploy"
PIPELINE_VARIABLES: >
[{
"key": "BRANCH_TO_DEPLOY",
"value": "${BITBUCKET_BRANCH}"
},
{
"key": "SOURCE_REPO_NAME",
"value": "$BITBUCKET_REPO_SLUG"
}]
WAIT: "true"
Got the answer from this issue.
My code is as below
Definitions:
definitions:
services:
docker:
memory: 1536
pipes:
- pipe: &triggerpipeline
pipe: atlassian/trigger-pipeline:5.1.0
variables:
BITBUCKET_USERNAME: $BB_INTEGRATION_USER
BITBUCKET_APP_PASSWORD: $BB_INTEGRATION_TOKEN
REPOSITORY: ${SERVICE_TO_DEPLOY}
REF_TYPE: "branch"
REF_NAME: "pipelines"
CUSTOM_PIPELINE_NAME: "main-to-feature-deploy"
PIPELINE_VARIABLES: >
[{
"key": "BRANCH_TO_DEPLOY",
"value": "${BITBUCKET_BRANCH}"
},
{
"key": "SOURCE_REPO_NAME",
"value": "$BITBUCKET_REPO_SLUG"
}]
WAIT: "true"
And parallel steps:
- parallel:
- step:
name: Deploy Identity Service Main to Feature
script:
- echo "deploy identity service"
- export SERVICE_TO_DEPLOY=identityservice
- echo "Deploy service ${SERVICE_TO_DEPLOY}"
- *triggerpipeline
- step:
name: Deploy Admin Service Main to Feature
script:
- echo "deploy admin service"
- export SERVICE_TO_DEPLOY=adminservice
- echo "Deploy service ${SERVICE_TO_DEPLOY}"
- *triggerpipeline
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.