From 4a075a4b8afcba473490575cddbbba6c32135553 Mon Sep 17 00:00:00 2001 From: oyesiji Date: Wed, 19 Oct 2022 09:44:07 -0400 Subject: [PATCH 1/3] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ac7d5747..5fdcfedd4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any environment { //be sure to replace "willbla" with your own Docker Hub username - DOCKER_IMAGE_NAME = "willbla/train-schedule" + DOCKER_IMAGE_NAME = "oyesiji/train-schedule" } stages { stage('Build') { @@ -76,4 +76,4 @@ pipeline { } } } -} \ No newline at end of file +} From 14833e314867824216f09a3aa52de1263e95997a Mon Sep 17 00:00:00 2001 From: oyesiji Date: Wed, 19 Oct 2022 10:20:23 -0400 Subject: [PATCH 2/3] Update Jenkinsfile --- Jenkinsfile | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5fdcfedd4..0d6be7b06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ pipeline { environment { //be sure to replace "willbla" with your own Docker Hub username DOCKER_IMAGE_NAME = "oyesiji/train-schedule" + CANARY_REPLICAS = 0 } stages { stage('Build') { @@ -53,21 +54,29 @@ pipeline { ) } } - stage('DeployToProduction') { + stage('SmokeTest') { when { branch 'master' } - environment { - CANARY_REPLICAS = 0 + steps { + script { + sleep (time: 5) + def response = httpRequest ( + url: "http://$KUBE_MASTER_IP:8081/", + timeout: 30 + ) + if (response.status != 200) { + error("Smoke test against canary deployment failed.") + } + } + } + } + stage('DeployToProduction') { + when { + branch 'master' } steps { - input 'Deploy to Production?' milestone(1) - kubernetesDeploy( - kubeconfigId: 'kubeconfig', - configs: 'train-schedule-kube-canary.yml', - enableConfigSubstitution: true - ) kubernetesDeploy( kubeconfigId: 'kubeconfig', configs: 'train-schedule-kube.yml', @@ -76,4 +85,13 @@ pipeline { } } } + post { + cleanup { + kubernetesDeploy ( + kubeconfigId: 'kubeconfig', + configs: 'train-schedule-kube-canary.yml', + enableConfigSubstitution: true + ) + } + } } From ded0ec68b33db6adb10b31326e4757ad658bf67c Mon Sep 17 00:00:00 2001 From: oyesiji Date: Wed, 19 Oct 2022 10:31:37 -0400 Subject: [PATCH 3/3] Update index.jade --- views/index.jade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/index.jade b/views/index.jade index 6e6be7155..10a5a68ac 100644 --- a/views/index.jade +++ b/views/index.jade @@ -2,7 +2,7 @@ extends layout block content h1 Find your train! - p Select your train below to see its current schedule. + p Select your train below to see its current schedule. Huntingtown #wrapper #trainList h2 Trains @@ -10,4 +10,4 @@ block content #trainInfo strong #trainSchedule - strong Select a train to view its current schedule. \ No newline at end of file + strong Select a train to view its current schedule.