-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
37 lines (37 loc) · 1.04 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pipeline {
agent any
tools {nodejs "node"}
environment {
CI = 'true'
}
stages {
stage('install dependencies') {
steps {
sh "npm install"
}
}
stage('Lint project') {
steps {
sh "npm run lint"
}
}
stage('Build project') {
steps {
sh "npm run build"
}
}
stage('Build and push docker image to ECR') {
steps {
script {
docker.withRegistry('https://175453773225.dkr.ecr.eu-west-2.amazonaws.com', 'ecr:eu-west-2:jenkins') {
sh '''
docker build -t pomodoro .
docker tag pomodoro:latest 175453773225.dkr.ecr.eu-west-2.amazonaws.com/pomodoro:latest
docker push 175453773225.dkr.ecr.eu-west-2.amazonaws.com/pomodoro:latest
'''
}
}
}
}
}
}