From 903269bcd9fca411d2f29b6bd93932cb58584044 Mon Sep 17 00:00:00 2001 From: "Mark Tyers (aa7401)" Date: Wed, 20 Nov 2019 14:23:19 +0000 Subject: [PATCH] Added CD Config Notes --- 04 DevOps.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/04 DevOps.md b/04 DevOps.md index 6f8b711..21841f8 100644 --- a/04 DevOps.md +++ b/04 DevOps.md @@ -117,3 +117,25 @@ heroku logs --tail Continuous integration is the process of regularly merging code changes into the central repository. For this to work all code must be regularly checked for issues using a range of automated tools. As of the time of writing GitHub have an integrated CI tool called **Github Actions** however this is still in beta. For this lab you will be using the CI tools that are built into GitLab which is why you have already mirrored the test code to a repository on the GitLab server. Committing and pushing to trigger the workflow. + +## 3 Continuous Delivery + +Once you have mastered the deployment process and configuring your CI pipeline you will want to implement a full CD workflow. This will require you to automate the deployment to one (or more) cloud servers. To achieve this you will need to add additional stages to your CI build to: + +1. Deploy to a test server. +2. Run a suite of acceptance tests. +3. Deploy to the live server. + +Whilst you will need to spend time configuring the build and ensuring that the correct stages of the pipeline run on the correct branches you will find the following snippet helpful: + +```yaml +deploy-staging-server: + stage: staging-server + script: + - apt-get update -qy + - apt-get install -y ruby ruby-dev rubygems-integration + - gem install dpl + - dpl --provider=heroku --app= --api-key= + only: + - master +```