Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can CodePipeline Use a Specific Commit

Tags:

My team has been running into issues with our CodePipeline where features were pushed out into production when they shouldn't have been due to our Docker image patching. A little background on our architecture: Our pipeline has two sources, one for the source code and one for the Docker image builder. Docker builds via CodeBuild and is deployed to dev, test, and then prod environments with manual approval steps in between.

Our Docker image receives monthly patching which triggers the pipeline to execute and is what caused the features to be pushed out. We redesigned our git branching strategy so that our master branch will only contain stable releases, but I could still see this issue potentially occurring again if a specific release date is specified. Is there a way to push out the image patching without pushing out the latest commit?

like image 523
rhlin888 Avatar asked Apr 07 '20 00:04

rhlin888


People also ask

What would not be used creating and configuring a pipeline within CodePipeline?

You cannot use the CodePipeline console to create or edit a pipeline that uses resources associated with another AWS account. However, you can use the console to create the general structure of the pipeline, and then use the AWS CLI to edit the pipeline and add those resources.

What is the difference between CodeDeploy and CodePipeline?

CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define. AWS CodeDeploy belongs to "Deployment as a Service" category of the tech stack, while AWS CodePipeline can be primarily classified under "Continuous Deployment".

Is CodePipeline like Jenkins?

CodePipeline is an AWS managed service, meaning, it does not require management nor maintenance-overhead once it has been set up. Jenkins server on the other hand requires ongoing management of Jenkins itself, its plugins, integrations and the hosting OS (e.g. Linux or Windows).

Can a pipeline have multiple revisions flowing through at the same time?

A revision is a change made to the source location defined for your pipeline. It can include source code, build output, configuration, or data. A pipeline can have multiple revisions flowing through it at the same time.


1 Answers

Can CodePipeline Use a Specific Commit

This is an often requested feature but unfortunately CodePipeline will always bring the latest commit from the selected branch in the Source action.

CodePipeline tied to a single git branch is more of a feature of CodePipeline as the design is more inclined towards Trunk based development [0]. Also, as per the designers of this service, CodePipeline is designed for post-merge/release validation. That is, once your change is ready to be released to production and is merged into your master/main branch, CodePipeline takes over and automatically tests and releases the final merged set of changes. CodePipeline has a lot of features like stage locking, superseding versions, etc. which don't work well for the case where you want to test a change in isolation before it's merged (e.g. feature branch testing or pull request testing.) Therefore there currently isn't a recommended way to do this in CodePipeline.

[0] https://trunkbaseddevelopment.com/

Having said that, there is a way to hack this with S3 Source action in pipeline instead of GitHub/CodeCommit source action. Essentially your pipeline's S3 source action is tied to S3 bucket/key. You can then upload a zip of any specific commit to this S3 bucket/key and trigger the pipeline.

like image 69
shariqmaws Avatar answered Nov 15 '22 04:11

shariqmaws