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"] diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index cf6ea71f5a..cd9acf5081 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,18 +1,35 @@ pipeline { agent { - docker { + docker { image 'node:6-alpine' args '-p 3000:3000' } } 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('97afa093-3137-4335-8b08-705a272b23aa') + 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 'npm install' } + post { + success { + notifyOTC stageName: "Build", status: "SUCCESS" + sendDeployableMessage status: "SUCCESS" + } + failure { + notifyOTC stageName: "Build", status: "FAILURE" + } + } } stage('Test') { steps {