diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6a868b1e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:4-alpine + + +WORKDIR /opt/frontend + +COPY . . + +RUN npm install + +EXPOSE 8079 + +CMD npm start diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..ded5c5a36 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,60 @@ +pipeline { + agent none + stages { + stage('build') { + agent { + docker { + image 'cloudapsar/frontend:v3' + } + + } + steps { + sh 'npm install' + } + } + + stage('test') { + agent { + docker { + image 'cloudapsar/frontend:v3' + } + + } + steps { + sh 'npm install' + sh 'npm test' + } + } + + stage('package') { + agent { + docker { + image 'cloudapsar/frontend:v3' + } + + } + steps { + sh 'npm install' + sh 'npm run package' + archiveArtifacts '**/distribution/*.zip' + } + } + + stage('docker build') { + steps { + script { + docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { + def dockerImage = docker.build("cloudapsar/frontend:v${env.BUILD_ID}", "./") + dockerImage.push() + dockerImage.push("latest") + } + } + + } + } + + } + tools { + nodejs 'NodesJS 4.8.6' + } +} \ No newline at end of file diff --git a/README.md b/README.md index 2f4852e76..ce5040d56 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Front-end application written in [Node.js](https://nodejs.org/en/) that puts tog # Setting up Dev Env -Platform : Ubuntu 16.04 +Platform : Ubuntu 18.04 ### Common Setup diff --git a/Test.md b/Test.md new file mode 100644 index 000000000..70a06a086 --- /dev/null +++ b/Test.md @@ -0,0 +1,2 @@ +Test pipeline +test2 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..15c2bb855 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3.6" + +services: + frontend: + build: . + image: cloudapsar/frontend + ports: + - 8079