Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Pipeline per branch #302

Closed
1 of 2 tasks
jstrunk opened this issue Mar 3, 2023 · 0 comments · Fixed by #403
Closed
1 of 2 tasks

[FEATURE] Pipeline per branch #302

jstrunk opened this issue Mar 3, 2023 · 0 comments · Fixed by #403
Labels

Comments

@jstrunk
Copy link
Contributor

jstrunk commented Mar 3, 2023

Describe the feature

Allow PDKPipelineProjects to create and destroy pipelines as git branches are created and destroyed. Alternatively, enable additional pipelines tied to a branch per developer.

Use Case

When developing as a team, we often work on different features in branches. We need to test deployments before merging to the main branch, so we currently deploy manually to our individual accounts. This will allow us to test by pushing a commit without impacting the main branch or our teammates' work.

Proposed Solution

Amplify's CI/CD monitors the creation and deletion of branches to create new environments with their own pipelines. PDKPipeline could create and eventbridge rule to trigger pipeline stack creation and destruction when codecommit branches are created and destroyed.

Other Information

Blocked by #239

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

PDK version used

0.14.8

What languages will this feature affect?

No response

Environment details (OS name and version, etc.)

MacOS

agdimech pushed a commit that referenced this issue May 15, 2023
If your team follows [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow),
the pipelines module can optionally help you create independent environments to test and validate
changes before merging. When you create a new branch, it will automatically create a new pipeline
stack and any stages you configure. Once you have finished testing and delete the branch, it will
automatically clean up the stacks created in the branch's environment.

EventBridge Rules trigger Lambda functions on CodeCommit repo branch creation and deletion. The
Lambda function for creation sets the `BRANCH` environment variable and runs a CodeBuild project
that creates the pipeline stack for the branch. It is up to the developer to give their pipeline
stack and stages unique names per branch. The examples show how to use the `BRANCH` variable to do
so. The multi-branch stacks are tagged with the branch name and repository name. The Lambda for
branch deletion lists all stacks matching those tags and deletes them.

I tested this change using a Typescript pipeline project.

This is a cleaned up version of PR #364 due to structural changes during development.

Resolves #302, replaces #364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants