Skip to content

Commit 7e2cc30

Browse files
committed
create dockerfile and jenkinsfile
1 parent f2d13b8 commit 7e2cc30

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node:20-alpine
2+
WORKDIR /app
3+
COPY . .
4+
RUN yarn install --production
5+
CMD ["node", "./src/index.js"]

Jenkinsfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pipeline {
2+
agent any
3+
4+
stages {
5+
stage('build') {
6+
steps {
7+
echo "build Pipeline"
8+
sh '''
9+
docker build -t getting-start-app .
10+
docker run -d --name node getting-start-app
11+
'''
12+
}
13+
}
14+
15+
stage('test') {
16+
steps {
17+
echo "test pipeline"
18+
sh '''
19+
docker exec -it node sh -c 'npm test jest'
20+
'''
21+
}
22+
}
23+
24+
}
25+
}

0 commit comments

Comments
 (0)