From 9f55e708818fc2d1193e2a5a4db811b603045eb3 Mon Sep 17 00:00:00 2001 From: sshamit Date: Wed, 1 Aug 2018 14:51:04 +0530 Subject: [PATCH 1/7] Create Dockerfile --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..f7f7242fd3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:8-onbuild +MAINTAINER kushwaha_a@hcl.com +ENV PORT 8080 +EXPOSE 8080 + +# Create app directory +WORKDIR /app +COPY package.json . + +# Install app dependencies +RUN npm install + +# Bundle app source +COPY . . + +CMD ["npm", "start"] From 9ae5d9781e63581c64313ecd7bd1e7eb3d05fd56 Mon Sep 17 00:00:00 2001 From: sshamit Date: Mon, 26 Nov 2018 15:19:24 +0530 Subject: [PATCH 2/7] Update Jenkinsfile --- jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index cf6ea71f5a..0b48905a15 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { agent { - docker { + sudo docker { image 'node:6-alpine' args '-p 3000:3000' } From 7ba98ae4e3a07f352633413e25298553b5b6ddd7 Mon Sep 17 00:00:00 2001 From: sshamit Date: Mon, 26 Nov 2018 16:43:51 +0530 Subject: [PATCH 3/7] Update Jenkinsfile --- jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 0b48905a15..3868fa914e 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { agent { - sudo docker { + docker { image 'node:6-alpine' args '-p 3000:3000' } From 3bcf2afa72006dc20a3d0fe28d31ebe1c62258a0 Mon Sep 17 00:00:00 2001 From: sshamit Date: Mon, 26 Nov 2018 16:57:15 +0530 Subject: [PATCH 4/7] Update Jenkinsfile --- jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 3868fa914e..46fa6c353b 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stages { stage('Build') { steps { - sh 'npm install' + sh 'sudo npm install' } } stage('Test') { From 39df7ed7cba65d94da8948d855bc07e3f3a9255a Mon Sep 17 00:00:00 2001 From: sshamit Date: Wed, 28 Nov 2018 13:25:34 +0530 Subject: [PATCH 5/7] Update Jenkinsfile --- jenkins/Jenkinsfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 46fa6c353b..cb5fe6c920 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -7,11 +7,27 @@ pipeline { } environment { CI = 'true' + // You need to specify 4 required environment variables first, they are going to be used for the following IBM Cloud DevOps steps + IBM_CLOUD_DEVOPS_CREDS = credentials('BM_CRED') + IBM_CLOUD_DEVOPS_ORG = 'CI/CD' + IBM_CLOUD_DEVOPS_SPACE= 'dev' + //IBM_CLOUD_DEVOPS_APP_NAME = 'Weather-V1' + IBM_CLOUD_DEVOPS_TOOLCHAIN_ID = 'dff42b3d-ecf3-4478-952a-f0ad43e7725d' + IBM_CLOUD_DEVOPS_WEBHOOK_URL = 'https://jenkins:d562c0b3-5ca6-4eb3-8f6e-9c02987a24b3%3A29e6b5bf-56f6-4dd4-b904-0ee82c559157@devops-api.ng.bluemix.net/v1/toolint/messaging/webhook/publish' } + stages { stage('Build') { steps { - sh 'sudo npm install' + sh 'npm install' + } + post { + success { + publishBuildRecord gitBranch: "${GIT_BRANCH}", gitCommit: "${GIT_COMMIT}", gitRepo: "${GIT_REPO}", result:"SUCCESS" + } + failure { + publishBuildRecord gitBranch: "${GIT_BRANCH}", gitCommit: "${GIT_COMMIT}", gitRepo: "${GIT_REPO}", result:"FAIL" + } } } stage('Test') { From 1c2d753b9a7223a7fa1a3ebed774cb3c786bf82b Mon Sep 17 00:00:00 2001 From: sshamit Date: Wed, 28 Nov 2018 13:50:50 +0530 Subject: [PATCH 6/7] Update Jenkinsfile --- jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index cb5fe6c920..28ef53d330 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { environment { CI = 'true' // You need to specify 4 required environment variables first, they are going to be used for the following IBM Cloud DevOps steps - IBM_CLOUD_DEVOPS_CREDS = credentials('BM_CRED') + IBM_CLOUD_DEVOPS_CREDS = credentials('97afa093-3137-4335-8b08-705a272b23aa') IBM_CLOUD_DEVOPS_ORG = 'CI/CD' IBM_CLOUD_DEVOPS_SPACE= 'dev' //IBM_CLOUD_DEVOPS_APP_NAME = 'Weather-V1' From 83f8ce67d47ee636d44528e35e49ff378f1e05bd Mon Sep 17 00:00:00 2001 From: sshamit Date: Wed, 28 Nov 2018 13:54:22 +0530 Subject: [PATCH 7/7] Update Jenkinsfile --- jenkins/Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 28ef53d330..cd9acf5081 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -23,10 +23,11 @@ pipeline { } post { success { - publishBuildRecord gitBranch: "${GIT_BRANCH}", gitCommit: "${GIT_COMMIT}", gitRepo: "${GIT_REPO}", result:"SUCCESS" + notifyOTC stageName: "Build", status: "SUCCESS" + sendDeployableMessage status: "SUCCESS" } failure { - publishBuildRecord gitBranch: "${GIT_BRANCH}", gitCommit: "${GIT_COMMIT}", gitRepo: "${GIT_REPO}", result:"FAIL" + notifyOTC stageName: "Build", status: "FAILURE" } } }