How to separate the stages in the pipeline?

0

Hello all,

I'm trying to separate the stages in the pipeline, but failing.

My project follows the Python webservice template in which the below section, seems to create both "Prod" and "Stage" automatically:

Parameters:
  ProjectId:
    Type: String
    Description: CodeStar projectId used to associate new resources to team members
  CodeDeployRole:
    Type: String
    Description: IAM role to allow AWS CodeDeploy to manage deployment of AWS Lambda functions
  Stage:
    Type: String
    Description: The name for a project pipeline stage, such as Staging or Prod, for which resources are provisioned and deployed.
    Default: ''

I tried:

https://docs.aws.amazon.com/codestar/latest/userguide/customize-ec2-multi-endpoints-newstage.html

And ended up with the new "*-prod" stack failing to create. I also tried:

https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-edit.html

But the downloaded template does not have a deployment stage section.

What I am trying is to be able to have "Stage" as default from a "develop" branch and "Prod" only from "master".

Can someone please provide instructions on how to do that?

Thank you

已提问 5 年前319 查看次数
2 回答
0

Looks like what I faced yesterday is related to this bug:

https://github.com/awslabs/serverless-application-model/issues/191

Not sure how to proceed in order to achieve dev, staging and then prod.

Maybe multiple projects...

已回答 5 年前
0

As part of knowledge acquisition I followed the steps found in "Add a Prod Stage and Endpoint to a Project" from the user guide https://docs.aws.amazon.com/codestar/latest/userguide/codestar-ug.pdf.

I then created a new pipeline adding only "Source" and "Build", reusing the roles and other resources already created by CodeStar. On the "Source" I changed the branch to be the "Prod" one, leaving the pipeline created by CodeStar to be the "Dev".

For the "Deploy" stages I made sure the stack name was different and on the "Advanced" field on each pipeline I passed the corresponding Stage, e.g.:

{"ProjectId":"uni-api", "CodeDeployRole":"arn:aws:iam::xxxxxxx:role/CodeStarWorker-xxxxxx-CodeDeploy", "Stage":"Prod"}

After all that it finally worked! One pipeline per source branch (for each Stage) working.

已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则