forked from muhkuh-sys/org.muhkuh.tools-flasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
46 lines (39 loc) · 1.62 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
46
import groovy.json.JsonSlurperClassic
node {
def ARTIFACTS_PATH1 = 'targets/jonchki/flasher_cli'
def ARTIFACTS_PATH2 = 'targets/jonchki/repository/org/muhkuh/tools/flasher/*'
def strBuilds = env.JENKINS_SELECT_BUILDS
def atBuilds = new JsonSlurperClassic().parseText(strBuilds)
docker.image("mbs_ubuntu_1804_x86_64").inside('-u root') {
/* Clean before the build. */
sh 'rm -rf .[^.] .??* *'
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
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 flasher. */
stage("flasher"){
sh "python2.7 mbs/mbs"
}
atBuilds.each { atEntry ->
stage("${atEntry[0]} ${atEntry[1]} ${atEntry[2]}"){
/* Build the project. */
sh "python2.7 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 .[^.] .??* *'
}
}