forked from opstree/spinnaker-study
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
31 lines (31 loc) · 1.07 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
node {
stage('Checkout') {
checkout scm
}
stage('Build Project') {
sh './mvnw clean package'
}
stage('Build Container') {
docker.build('${JOB_NAME}', '-f src/main/docker/Dockerfile.jvm .')
}
stage('Create tar.gz') {
sh 'tar -czvf quarkus-microservice-chart.tar.gz -C helm quarkus-microservice'
archiveArtifacts artifacts: 'quarkus-microservice-chart.tar.gz', fingerprint: true
}
stage('Push chart to S3') {
withAWS(region:'us-west-2') {
s3Upload(file:'quarkus-microservice-chart.tar.gz', bucket:'opstree-helm-charts', path:"${JOB_NAME}/${BUILD_ID}/quarkus-microservice-chart.tar.gz")
}
}
stage('Write properties') {
sh "> spinnaker.properties"
sh "echo 'JOB_NAME=${JOB_NAME}' >> spinnaker.properties"
sh "echo 'BUILD_ID=${BUILD_ID}' >> spinnaker.properties"
archiveArtifacts artifacts: 'spinnaker.properties', fingerprint: true
}
stage('Push to ECR') {
docker.withRegistry('https://702037529261.dkr.ecr.us-west-2.amazonaws.com', 'spinnaker-registry') {
docker.image('${JOB_NAME}').push('${BUILD_ID}')
}
}
}