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

Introduce continuous delivery #8

Merged
merged 16 commits into from
Jun 19, 2022
Merged

Introduce continuous delivery #8

merged 16 commits into from
Jun 19, 2022

Conversation

kikuomax
Copy link
Member

@kikuomax kikuomax commented Jun 19, 2022

A new folder cdk-ops defines a new CDK stack that provisions AWS CodePipeline pipeline for continuous delivery. The pipeline automates the workflow to release the contents of the codemonger website.

A new folder cdk-common will define common types and functions shared among cdk and cdk-ops stacks. DeploymentStage is moved from cdk to cdk-common. This folder is linked from cdk and cdk-ops by npm link --save ../cdk-common.

The following files in the root directory are deleted because they are no longer necessary,

  • package.json
  • package-lock.json
  • service.js

close #4

- `aws-cdk` and `aws-cdk-lib` are bumped to the version 2.28.1.
- `constructs` is bumped to the version 10.1.42.
- A new local package `cdk-common` that collects types and functions
  shared among CDK stacks in this repository is introduced. It provides
  the type `DeploymentStage` so far.
- A new CDK stack for continuous delivery is going to be introduced, and
  it will share some stuff like `DeploymentStage` with the CDK stack in
  the `cdk` folder.
- `cdk-common` is supposed to be locally linked from other projects with
  `npm link --save ../cdk-common`. There was an issue with the `prepare`
  life cycle script that no dependencies of `cdk-common` were installed
  before running the `prepare` script and the `prepare` script ended up
  with a build error. The `scripts/prepare.js` script circumvents this
  situation by invoking `npm install` if there is no `node_modules`
  folder in this project. See comments in `script/prepare.js` for more
  details.

issue codemonger-io#4
- The `cdk-common` package is locally linked with
  `npm link --save ../cdk-common`.

issue codemonger-io#4
- `DeploymentStage` and related functions are replaced with the ones
  defined in `cdk-common`.

issue codemonger-io#4
- `README.md` briefly explains this library.

issue codemonger-io#4
- `cdk-common` is linked.
- `aws-cdk` and `aws-cdk-lib` are bumped to 2.28.1.
- `constructs` is bumped to 10.1.42.

issue codemonger-io#4
- The CDK stack is renamed to `codemonger-operation`.

issue codemonger-io#4
- `@aws-sdk/client-cloudformation` is installed so that the CDK script
  can obtain outputs from the main stacks.

issue codemonger-io#4
- A new CDK construct `ContentsPipeline` that provisions a CodePipeline
  pipeline that automates the workflow to update the contents of the
  codemonger website is introduced.
- A new CDK construct `CodemongerResources` that resolves resources in
  the main codemonger stacks is defined in a new file
  `lib/codemonger-resources.ts`. The file `lib/codemonger-resources.ts`
  also provides a function `resolveCodemongerResourceNames` that
  resolves the resource names in the main codemonger stacks by obtaining
  outputs from the stacks. `bin/cdk-ops.ts` invokes
  `resolveCodemongerResourceNames` and passes results to the constructor
  of `CdkOpsStack`.
- You have to prepare an untracked file (in `.gitignore`)
  `lib/github-connection-config.ts` that provides information to connect
  the pipeline and this GitHub repository.

issue codemonger-io#4
- `README.md` and `README.ja.md` explain how to deploy this CDK stack.
  They also provide the following information,
    - About the workflow to be automated
    - Why exports of CloudFormation are not used

issue codemonger-io#4
- `node_modules` folders are generally ignored by git.
- `README.md` and `README.ja.md` explain what we have to do when we
  update the library.

issue codemonger-io#4
- `package.json`, `package-lock.json`, and `service.js` are delete
  because they are no longer necessary.
- `README.md` and `README.ja.md` add a link to the subfolder `cdk-ops`.

issue codemonger-io#4
- Links in `README.md` and `README.ja.md` are fixed.
@kikuomax kikuomax self-assigned this Jun 19, 2022
- Meaningless `test/cdk-ops.test.ts` is deleted.
Copy link
Member Author

@kikuomax kikuomax left a comment

Choose a reason for hiding this comment

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

I have self-reviewed the changes.

@kikuomax kikuomax merged commit 859a0ce into codemonger-io:main Jun 19, 2022
@kikuomax kikuomax deleted the cicd branch June 19, 2022 05:18
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.

Automatically deploy contents to the development stage when changes are merged
1 participant