@nf-tools/dootstrapper
v0.7.0-alpha-2
Published
Multi environment deployment bootstrapper
Downloads
4
Readme
Dootstrapper
Dootstrapper is a library for bootstrapping deployment resources. It creates a continuous delivery | continuous deployment pipeline to deploy modern web and serverless (AWS) apps. It uses highly declarative buildspec syntax to configure deployment steps, generating highly customizable multiple environment pipeline. Additionally, it also configures notification channels to publish deployment notifications to.
Dootstrapper uses modern JavaScript, is built with Typescript (Provides optional types for JavaScript). At it's core, there is a AWS Cloud Development Kit which makes all magic possible.
Here is a small list of features it offers:
✔️ Ease of use
✔️ Minimum Effort to go from development to production
✔️ Automated deployment notifications
✔️ Support for deploying SPA apps
✔️ Support for deploying serverless apps without pain
✔️ Out of the box support for continuous delivery and continuous deployment on both platforms
✔️ Rich typing and documentation
✔️ Built with modern tools like bazel🍃️
Getting Started
Prerequisite
aws-cli
: installed and configured Install it from here
aws-cdk
: installed globally Install is from here
Scaffolding project
We will need CDK environment setup to be able to run cdk deploy commands Initialize environment with
cdk init --language typescript
Install it with
npm i @nf-tools/dootstrapper
Installing dependencies
Since, Dootstrapper doesn't ship with existing aws-cdk modules, these all needs to be manually installed
Install cdk packages with
npm i @aws-cdk/aws-sns-subscriptions @aws-cdk/aws-sns @aws-cdk/aws-s3 @aws-cdk/aws-iam @aws-cdk/aws-events-targets @aws-cdk/aws-events @aws-cdk/aws-codepipeline-actions @aws-cdk/aws-codepipeline @aws-cdk/aws-codebuild @aws-cdk/aws-cloudtrail @aws-cdk/aws-ssm @aws-cdk/aws-route53 @aws-cdk/aws-cloudfront @aws-cdk/aws-certificatemanager
Creating your first pipeline project
Now inside {project-dir}/bin
locate line with const app = new cdk.App()
. Just below, add
const app = new App();
const deploymentStack = new Stack(app, 'DeploymentToolsStack', {
stackName: 'Frontend and Backend Deployment Tools',
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
},
});
new FrontendDeployment(deploymentStack, 'FrontendDeployment', {
pipelineConfig: // pipeline config option,
baseDomainName: // base domain name,
notificationConfig: // notification config option
});
(Optional) Remove any other auto generated stack configs from {project-dir}/lib
Deploying
Run cdk deploy
and all the required resources will be created in region specified in ~/.aws/config
Note: This entire process of building and deploying is likely to get much simple when dootstrapper cli comes out
More examples
Checkout more detailed examples in dootstrapper repository here
Motivation
To be able to create awesome softwares, we need a solid version control system and development styles, that has been Git and GitFlow traditionally. GitFlow has very effective development model but it is not efficient especially when we need frequent releases. With git flow each changes needs to go through entire merge life cycle: feature -> develop -> master -> release
, also it takes a lot of good practice to get good at GitFlow, and mostly with small/medium projects it is really not required. Thus, use Trunk Based Development
.
Wait but now with TBD
(sort for Trunk Based Development
), there is going to be a lot of configuration required to release an application into multiple environment since it does not have that different branch for different environment niceness. To address this problem, Introducing Dootstrapper.
With Dootstrapper, it is easy to setup multiple environment based release cycle. It also takes care of sending notifications to teams, when human involvement is required. Under the hood it creates all key resources required (on aws cloud) for you.