Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ typings/

# dotenv environment variables file
.env

build/
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:8-alpine

# Create the directory that will contain the app, and make subsequent commands run from this directory
WORKDIR /app

# Copy only files required for npm install so that cached layer is used unless dependencies have changed
COPY package.json package-lock.json ./

RUN npm install

# Copy the rest of the app's files
COPY . .

EXPOSE 3000

CMD ["npm", "run", "start"]
27 changes: 27 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
pipeline {
agent {
docker {}
}
environment {
CI = 'true'
}
stages {
stage('Build') {
steps {
sh 'docker-compose up --exit-code-from test'
}
}
stage('Test') {
steps {
sh './jenkins/scripts/test.sh'
}
}
stage('Deploy') {
steps {
sh './jenkins/scripts/deliver.sh'
input message: 'Finished using the web site? (Click "Proceed" to continue)'
sh './jenkins/scripts/kill.sh'
}
}
}
}
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'

services:
test:
build: .
image: money/jenkins/test-app
command: [sh, -c, "npm run test-ci"]
Loading