Docker Build, Continuous Integration, and Deployment to Google Container Engine (GKE) for a Node JS application
A simple Node JS application with unit tests and coverage reports using mocha and istanbul.
This repo demonstrates the following features:
- Set up serverless CI, i.e. on Shippable-provided infrastructure
- Set up CD pipelines for a Google Container Engine (GKE) cluster
- Perform CI tests
- Perform docker build and push image to Google Container Registry (GCR)
- Automatically deploy image to TEST environment
- Manually deploy image to PROD environment
- Automatically provision GKE load balancers for each environment
- Fork this repo into your source code account (e.g. GitHub)
- Create an account (or login) on Shippable with your SCM account
- Create a GCR integration on Shippable for your Google account
- Update the CI configuration in
shippable.yml
file with your integration names (see comments in file) - Follow these setup instructions to enable your forked repo for CI and run a build
- Create an integration for GKE
- All pipeline config is in
shippable.resources.yml
andshippable.jobs.yml
. Check these files and update config wherever the comment asks you to replace with your specific values - Follow instructions to add your Continuous Deployment pipeline
- Right-click on the deploy job in the SPOG view named 'shipdemo-deploy-gke-test' and run the job
- This demo uses a declarative job type called 'deploy' in Shippable - learn how moe about 'deploy' jobs
- Your app should be deployed to your GKE cluster labeled as your TEST environment
- Follow instructions to connect your Continuous Integration project to your Continuous Delivery pipelines(for this demo, just uncomment the
trigger
integration in shippable.yml) - Right-click on the deploy job in the SPOG view named 'shipdemo-deploy-gke-prod' and run the job to deploy as your PROD environment
- Make a change to your forked repo and commit to GitHub - watch your pipeline automatically execute CI with push to GCR and automatic deployment to the TEST environment in GKE
- Then right-click to deploy the newest changes to the PROD environment
Your end-to-end pipeline is complete! Now, any change you make to the application will be deployed to your GKE TEST environment and be ready to manually deploy to your PROD environment, as well.