Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!groovy
- pipeline {
- node('docker-cd') {
- wrap([$class: 'AnsiColorBuildWrapper']) {
- stage("Checkout Code CD-Tools") { checkout scm }
- stage("Raise the Integration Test") {
- parallel {
- stage("Raise the Integration Test Provider A") {
- steps {
- // - Check if we have currently an Integration Test.
- // - Raise the new DB Backend for Fixtures.
- // - Populate Fixtures.
- }
- }
- stage("Raise the Integration Test Provider B") {
- steps {
- // - Check if we have currently an Integration Test.
- // - Raise the new DB Backend for Fixtures.
- // - Populate Fixtures.
- }
- }
- }
- }
- stage('Blue Deployment') {
- parallel {
- parallel {
- stage('Blue Deployment Provider A') {
- stage('Run Integration Tests') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Deploy the new version in Blue Provider A') {
- agent { label "node-provider-a" }
- steps {
- // - Get the secrets vars.
- // - Update the Task Definition.
- // - Register the new Task Definition in the orchestrator.
- // - Rolling Update with the new task version
- }
- }
- stage('Run Contract Tests') {
- agent { label "node-provider-a" }
- steps { }
- }
- post {
- success {
- // - Notification Integration Tests Passed,
- // Blue Deployment Success Provider A.
- }
- failure {
- // - Rollback update with the previous version of the
- // Blue enviroment Provider A.
- }
- }
- }
- stage('Blue Deployment Provider B') {
- stage('Run Integration Tests') {
- agent { label "node-provider-b" }
- steps { }
- }
- stage('Deploy the new version in Blue Provider B') {
- agent { label "node-provider-b" }
- steps {
- // - Get the secrets vars.
- // - Update the Task Definition.
- // - Register the new Task Definition in the orchestrator.
- // - Rolling Update with the new task version
- }
- }
- stage('Run Contract Tests') {
- agent { label "node-provider-b" }
- steps { }
- }
- post {
- success {
- // - Notification Integration Tests Passed,
- // Blue Deployment Success Provider B.
- }
- failure {
- // - Rollback update with the previous version of the
- // Blue enviroment Provider B.
- }
- }
- }
- }
- }
- }
- stage('New Green Deployment') {
- stage('Scale-UP Blue Enviroment') {
- parallel {
- stage('Scale-UP Blue Deployment on Provider A, Region X') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Scale-UP Blue Deployment on Provider B, Region Y') {
- agent { label "node-provider-b" }
- steps { }
- }
- }
- }
- stage('Registring Blue deployment on the services mesh') {
- parallel {
- stage('Register Blue Deployment into Service Mesh on Provider A, Region X') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Register Blue Deployment into Service Mesh on Provider B, Region Y') {
- agent { label "node-provider-b" }
- steps { }
- }
- }
- }
- post {
- failure {
- // - Deregistring Blue deployment to the service mesh for each provider.
- }
- }
- }
- stage('Traffic shifting in a Canary Release') {
- stage('Traffic shifting') {
- parallel {
- stage('Traffic shifting Blue on Provider A, Region X') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Traffic shifting Blue on Provider B, Region X') {
- agent { label "node-provider-b" }
- steps { }
- }
- }
- }
- post {
- failure {
- // - Traffic shifting 100% to the Green service
- }
- }
- stage('Registring new Green') {
- parallel {
- stage('Registring Blue as new Green on Provider A, Region X') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Registring Blue as new Green on Provider B, Region X') {
- agent { label "node-provider-b" }
- steps { }
- }
- }
- }
- post {
- success {
- // - Notification New Green is currently Deployed.
- }
- failure {
- // - Emergency Scale-UP Old Green.
- // - Registring Old Green as Green and NewGreen as Blue in service mesh
- // without traffic shipping.
- // - Scale down the Blue service.
- }
- }
- stage('Scale-Down new Blue') {
- parallel {
- stage('Scale-Down Blue on Provider A, Region X') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Scale-Down Blue on Provider B, Region X') {
- agent { label "node-provider-b" }
- steps { }
- }
- }
- }
- stage('Post Deployment Tests on New Green') {
- parallel {
- stage('Run Post Deployment Tests on Provider A, Region X') {
- agent { label "node-provider-a" }
- steps { }
- }
- stage('Run Post Deployment Tests on Provider B, Region X') {
- agent { label "node-provider-b" }
- steps { }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement