-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
45 lines (38 loc) · 1.87 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import groovy.json.JsonSlurperClassic
node {
/* Path to the CLI flasher packages */
def ARTIFACTS_PATH1 = 'flasher-environment/build/artifacts'
/* Path to the flasher binaries */
def ARTIFACTS_PATH2 = 'targets/jonchki/repository/org/muhkuh/tools/flasher/*'
def strBuilds = env.JENKINS_SELECT_BUILDS
def atBuilds = new JsonSlurperClassic().parseText(strBuilds)
atBuilds.each { atEntry ->
stage("${atEntry[0]} ${atEntry[1]} ${atEntry[2]}"){
docker.image("${atEntry[3]}").inside('-u root') {
/* Clean before the build. */
sh 'rm -rf .[^.] .??* *'
checkout([$class: 'GitSCM',
branches: [[name: env.GIT_BRANCH_SPECIFIER]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'SubmoduleOption',
disableSubmodules: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false
]
],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/muhkuh-sys/org.muhkuh.tools-flasher.git']]
])
/* Build the project (includes flasher binary and other
components like romloader etc. */
sh "./build_artifact.py ${atEntry[0]} ${atEntry[1]} ${atEntry[2]}"
/* Archive all artifacts. */
archiveArtifacts artifacts: "${ARTIFACTS_PATH1}/*.tar.gz,${ARTIFACTS_PATH1}/*.zip,${ARTIFACTS_PATH2}/*.hash,${ARTIFACTS_PATH2}/*.pom,${ARTIFACTS_PATH2}/*.xml,${ARTIFACTS_PATH2}/*.zip"
/* Clean up after the build. */
sh 'rm -rf .[^.] .??* *'
}
}
}
}