diff --git a/Dockerfile b/Dockerfile index f375d141c..de6e841bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,5 @@ COPY package*.json ./ RUN npm install COPY . . EXPOSE 8080 -CMD [ "npm", "start" ] \ No newline at end of file +CMD [ "npm", "start" ] + diff --git a/Jenkinsfile b/Jenkinsfile index 3ac7d5747..b27656901 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,12 @@ pipeline { agent any environment { - //be sure to replace "willbla" with your own Docker Hub username - DOCKER_IMAGE_NAME = "willbla/train-schedule" + //be sure to replace "bhavukm" with your own Docker Hub username + DOCKER_IMAGE_NAME = "sulavkumar/train-schedule" } + stages { + stage('Build') { steps { echo 'Running build automation' @@ -13,9 +15,7 @@ pipeline { } } stage('Build Docker Image') { - when { - branch 'master' - } + steps { script { app = docker.build(DOCKER_IMAGE_NAME) @@ -26,9 +26,7 @@ pipeline { } } stage('Push Docker Image') { - when { - branch 'master' - } + steps { script { docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') { @@ -39,9 +37,7 @@ pipeline { } } stage('CanaryDeploy') { - when { - branch 'master' - } + environment { CANARY_REPLICAS = 1 } @@ -54,9 +50,7 @@ pipeline { } } stage('DeployToProduction') { - when { - branch 'master' - } + environment { CANARY_REPLICAS = 0 } @@ -76,4 +70,4 @@ pipeline { } } } -} \ No newline at end of file +} diff --git a/testfilesulav b/testfilesulav new file mode 100644 index 000000000..b8c715983 --- /dev/null +++ b/testfilesulav @@ -0,0 +1 @@ +// This is a test file for TD