Skip to content

Commit 65d40be

Browse files
committed
Initialized Project for Docker & Jenkins
1 parent 619fa4d commit 65d40be

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:latest as node
2+
RUN mkdir -p /app
3+
WORKDIR /app
4+
COPY package*.json /app/
5+
RUN npm install
6+
COPY . /app/
7+
EXPOSE 4200
8+
CMD ["npm", "run", "start"]
9+
10+
#jsut a test

Jenkinsfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
node {
2+
def app
3+
4+
stage('Clone repository') {
5+
6+
7+
checkout scm
8+
}
9+
10+
stage('Build image') {
11+
12+
app = docker.build("phillipmario/test")
13+
}
14+
15+
stage('Test image') {
16+
17+
18+
app.inside {
19+
sh 'echo "Tests passed"'
20+
}
21+
}
22+
23+
stage('Push image') {
24+
25+
docker.withRegistry('https://registry.hub.docker.com', 'Docker') {
26+
app.push("${env.BUILD_NUMBER}")
27+
app.push("latest")
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)