forked from akannan1087/docker-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (43 loc) · 1.38 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
38
39
40
41
42
43
44
45
46
47
48
49
50
pipeline {
agent any
environment {
registry = "211223789150.dkr.ecr.us-east-1.amazonaws.com/my-docker-repo"
}
stages {
stage('Checkout') {
steps {
checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/akannan1087/docker-spring-boot']])
}
}
stage ("Build JAR") {
steps {
sh "mvn clean install"
}
}
stage ("Build Image") {
steps {
script {
docker.build registry
}
}
}
stage ("Push to ECR") {
steps {
script {
sh "aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 211223789150.dkr.ecr.us-east-1.amazonaws.com"
sh "docker push 211223789150.dkr.ecr.us-east-1.amazonaws.com/my-docker-repo:latest"
}
}
}
stage ("Helm package") {
steps {
sh "helm package springboot"
}
}
stage ("Helm install") {
steps {
sh "helm upgrade myrelease-21 springboot-0.1.0.tgz"
}
}
}
}