-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile.build_container
81 lines (77 loc) · 3.04 KB
/
Jenkinsfile.build_container
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
74
75
76
77
78
79
80
81
pipeline {
agent { label 'docker' }
stages {
stage('Setup parameters') {
steps {
script {
properties([
parameters([
choice(
name: 'branch',
choices: ['main']
),
string(
name: 'hosts',
trim: true
),
choice(
name: 'env',
choices:
['api.qa','api.pro','mob_pro','mob_qa','beta_qa','stage.qa','x.pro','x.qa','dev']
),
booleanParam(
name: 'deploy',
defaultValue: false,
description: ''
),
choice(
name: 'erlang_version',
choices: ['24.3.4.2']
),
string(
name: 'flags',
defaultValue: '--tags upgrade',
trim: true
),
choice(
name: 'dog_env',
choices: ['qa','pro']
),
choice(
name: 'build_stream',
choices: ['release','nightly']
)
])
])
}
}
}
stage('Build') {
environment {
tag = VersionNumber(versionNumberString: '${BUILD_TIMESTAMP}');
// job environment variables
BUILD_ENV = "${build_stream}"
// this is a result of a backwards-incompatible change from JENKINS-24380
BUILD_ID = "${VersionNumber(projectStartDate: '1970-01-01', versionNumberString: '${BUILD_DATE_FORMATTED, \"yyyy-MM-dd_H-m-s\"}')}"
DOG_ENV = "$params.dog_env"
}
steps {
echo "params.dog_env: $params.dog_env"
sh 'echo "dog_env=$dog_env"'
sh 'DOG_ENV="$dog_env" BUILD_ID="${BUILD_ID}" BUILD_STREAM="${buildStream}" make build'
}
post {
success {
archiveArtifacts 'dist/*.tar.gz'
}
}
}
stage('Upload artifact to S3') {
steps {
withAWS(profile: 'default') {
s3Upload bucket:'product-builds', path: 'dog_agent_ex/', workingDir: 'dist', includePathPattern: '*.tar.gz'
}
}
}
}
}