-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathJenkinsfile
More file actions
68 lines (61 loc) · 1.93 KB
/
Jenkinsfile
File metadata and controls
68 lines (61 loc) · 1.93 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
pipeline {
agent {
label 'master'
}
environment {
TARGET_BRANCH = 'master'
}
stages {
stage('Build') {
steps {
sh "docker pull golang"
sh "docker run -t --rm -v ${WORKSPACE}:/go/src/cli -w /go/src/cli golang make"
}
}
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 "aws-profile connectors-staging aws s3 cp ${WORKSPACE}/bin s3://smartling-connectors-releases/cli/ --recursive --acl public-read"
}
}
stage('Generate Packages') {
when {
branch env.TARGET_BRANCH
}
steps {
sh "docker run -t --rm -v ${WORKSPACE}:/go/src/cli -w /go/src/cli gvangool/rpmbuilder:centos7 bash -c 'make rpm'"
// TODO : Replace with special docker image
sh "docker run -t --rm -v ${WORKSPACE}:/go/src/cli -w /go/src/cli debian bash -c 'apt-get update && apt-get install -y make git && make deb'"
}
}
}
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!"
)
}
}
}