-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
27 lines (26 loc) · 957 Bytes
/
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
#!/usr/bin/env groovy
node {
identifier = "Docker Tika:$BRANCH_NAME - Build ID: $BUILD_NUMBER"
checkout scm
stage ('Docker build') {
slackSend color: "warning", message: "Starting image build for: ${identifier}"
try {
image = docker.build('docker-tika:$BRANCH_NAME')
slackSend color: "good", message: "Image build succeeded for: ${identifier}"
}
catch (exc) {
slackSend color: "danger", message: "Image build failed for: ${identifier}"
}
}
stage ('Docker push') {
slackSend color: "warning", message: "Pushing image to AWS repository: ${identifier}"
try {
docker.withRegistry('https://024673053271.dkr.ecr.us-west-2.amazonaws.com', 'ecr:us-west-2:aws-test') {
image.push('${BRANCH_NAME}_latest')
}
slackSend color: "good", message: "Push complete for: ${identifier}"
} catch (exc) {
slackSend color: "danger", message: "Push failed for: ${identifier}"
}
}
}