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

Pipelines #17

Merged
merged 18 commits into from
May 6, 2021
Merged

Pipelines #17

merged 18 commits into from
May 6, 2021

Conversation

chand1012
Copy link
Member

This is a major update that will encompass more than just merging this PR. Closes #5 .

After this PR is merged, all new branches will be based on develop, rather than master. The branch develop will become protected and will be merged to by PRs like master was. Both master and develop will have emergency push allowance. Here is the new workflow:

  1. Create a new branch based off of develop.
    a) git checkout develop
    b) git checkout -b new-feature-1
  2. When that features has been tested and is ready to merge, make a PR merging into develop.
  3. When we want to update the production stack with a new release a new PR is made from develop to master. After it is approved and merged, it will automatically get deployed to production.

Currently there are two pipelines - RenderLambdaPipeline and ProdRenderLambdaPipeline. RenderLambdaPipeline polls develop for changes. ProdRenderLambdaPipeline polls from master.

Both pipelines update when new code is pushed to the branches. Their DNS endpoints are separate, and a custom DNS for ProdRenderLambdaPipeline will be implemented soon, more research is needed to complete the task.

For the downloader lambda, the source of the image had to be changed. This is because authenticating with Docker is quite complicated on AWS, and there is a per-IP limit of 100 pulls per six hours. The IP of each AWS CodeBuild instance can be shared across accounts or across customers, so the simplest solution was to just pull from AWS ECR, which is already automatically authenticated at the start of the build process.

If you would want to test your current changes on AWS, assuming another developer wasn't also working on the project, you would run cdk deploy RenderLambdaStack. This will deploy to what is now the "test stack", or one that will change frequently during development.

ProdRenderLambdaPipeline failed on initial push, but that will change when this PR is merged.

Similar changes will be made to the timestamps project as well.

Also, a lot of commits were made to get this working and to test AWS deployment. I recommend doing a "Squash and Merge".

@chand1012 chand1012 requested a review from RusseII May 3, 2021 17:10
Copy link
Member

@RusseII RusseII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo! Really happy to have this. Nice work.

source_action=codepipeline_actions.GitHubSourceAction(
action_name='GitHubRenderLambda',
output=source_artifact,
oauth_token=cdk.SecretValue.secrets_manager('github-token', json_field='chand1012'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this your personal token? You could probably make a company token on GH

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly we can't make personal access tokens at a company level, so this will have to do for now.


from stack.pipeline_stages import PreprodStage, ProdStage
# used this as reference
# https://aws.amazon.com/blogs/developer/cdk-pipelines-continuous-delivery-for-aws-cdk-applications/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - here is another source I saw that was good - https://docs.aws.amazon.com/cdk/latest/guide/codepipeline_example.html

@chand1012 chand1012 merged commit 7eca6b7 into master May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add automatic deploy
2 participants