-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathJenkinsfile
More file actions
73 lines (67 loc) · 2.13 KB
/
Copy pathJenkinsfile
File metadata and controls
73 lines (67 loc) · 2.13 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
pipeline {
agent {
label 'master'
}
environment {
TARGET_BRANCH = 'master'
}
stages {
stage('Build') {
steps {
sh "docker pull goreleaser/goreleaser:v2.15.4"
sh """
docker run -t --rm \\
-v "${WORKSPACE}:/go/src/cli" -w /go/src/cli \\
--entrypoint sh \\
goreleaser/goreleaser:v2.15.4 \\
-c 'apk add --no-cache make && make build'
"""
}
}
stage('Release?') {
agent none
when {
branch env.TARGET_BRANCH
}
steps {
timeout(time: 1, unit: 'HOURS') {
input 'Release to PROD?'
}
}
}
stage('Upload to public S3') {
when {
branch env.TARGET_BRANCH
}
steps {
sh '''
cd "${WORKSPACE}/bin"
for path in smartling-cli* smartling_*.deb smartling_*.rpm checksums.txt; do
[ -e "$path" ] || continue
if [ -d "$path" ]; then
aws-profile connectors-staging aws s3 cp "$path" "s3://smartling-connectors-releases/cli/$path" --recursive --acl public-read
else
aws-profile connectors-staging aws s3 cp "$path" "s3://smartling-connectors-releases/cli/$path" --acl public-read
fi
done
'''
}
}
}
post {
unstable {
slackSend (
channel: "#emergency-connectors",
color: 'bad',
message: "Tests failed: <${env.RUN_DISPLAY_URL}|${env.JOB_NAME} #${env.BUILD_NUMBER}>"
)
}
failure {
slackSend (
channel: "#emergency-connectors",
color: 'bad',
message: "Build of <${env.RUN_DISPLAY_URL}|${env.JOB_NAME} #${env.BUILD_NUMBER}> is failed!"
)
}
}
}