Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,116
Community Members
 
Community Events
184
Community Groups

multiple microservice deployments from a monorepo

i am trying to build and deploy two separate microservices (api and client) from a monorepo.

 

i added four environments: api-qa, client-qa, api-prod, and client-prod.

 

definitions:
steps:
- step: &build-api
name: build-api
condition:
changesets:
includePaths:
- "shared/**"
- "api/**"
script:
- echo build api
- step: &build-client
name: build-client
condition:
changesets:
includePaths:
- "shared/**"
- "api/src/entities/**"
- "client/**"
script:
- echo build client

-
step: &deploy-api-qa
name
: deploy-api-qa
deployment: api-qa
condition:
changesets:
includePaths:
- "shared/**"
- "api/**"
script:
- echo deploy api to qa
- step: &deploy-client-qa
name: deploy-client-qa
deployment: client-qa
condition:
changesets:
includePaths:
- "shared/**"
- "api/src/entities/**"
- "api/**"
script:
- echo deploy client to qa

- step: &deploy-api-prod
name: deploy-api-prod
deployment: api-prod
trigger: manual
condition:
changesets:
includePaths:
- "shared/**"
- "api/**"
script:
- echo deploy api to prod
- step: &deploy-client-prod
name: deploy-client-prod
deployment: client-prod
trigger: manual
condition:
changesets:
includePaths:
- "shared/**"
- "api/src/entities/**"
- "api/**"
script:
- echo deploy client to prod

pipelines:
default:
- step: *build-api
- step: *build-client
- step: *deploy-api-qa
- step: *deploy-client-qa
- parallel:
- step: *deploy-api-prod
- step: *deploy-client-prod

this *almost* works.  i do end up with four different environments, however, the "promote" button acts weirdly.  there's no promote button on api-qa and the promote button on client-qa wants to promote to api-prod.

what am i doing wrong here?  thanks in advance.

3 answers

1 accepted

0 votes
Answer accepted
Florian PEREZ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 08, 2021

Hello,

Since this question is very technical I suggest you to post this on the developper part of the forum:

https://community.developer.atlassian.com/

I think you'll get more answers and from a better quality!

Hope this help

The problem is that the steps are executed in order. Since `api-prod` comes after `deploy-client-qa`, when it comes time to promote from "qa" to "prod", it executes the first step in "prod".

I sort of fixed this by making putting all "qa" steps under one parallel step and all "prod" steps under another parallel step.

The problem is that I have to finish deploying all the "qa" steps before I can start promoting to "production". But at least I can choose which "qa" step to run, without having to run them in the exact sequence they appear in bitbucket-pipelines.yml.

Unfortunately there does not seem to be a way to be choose to deploy to one "qa" deployment and then promote it to any one of the "prod" deployments.

So in my case, I gave up and declared all my environments as "qa" and just have to be smart about which order to deploy things. All I wanted was an easy way to push my artifact to different servers, that's why I even bothered with Bitbucket Pipelines.

Hi, Iantz moore

I have one query related to this. What I have to do if I want to re-use the deployment environments like TEST, STAGING & PROD, to deploy 20+lambdas. Should I have to define all these lambdas in definitions section of the pipeline?. Please suggest the best way to deploy into multiple environments in multiple times.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events