-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.elements
109 lines (106 loc) · 4.21 KB
/
Jenkinsfile.elements
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
@Library('SPiFI-1.2.1') _
properties([
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false]
])
node("${params.P_NODE_LABEL}") {
//TODO: This needs to accept parameters and setup/load accordingly
//TODO: Use a package manager instead of modules?
withEnv(["INSTALL_DIR=$WORKSPACE/sst-elements-install",
"SST_CORE_MODULES=${params.SST_CORE_MODULES}",
"SST_CORE_INSTALL=${params.SST_CORE_INSTALL}",
"PATH=$PATH:${params.SST_CORE_INSTALL}/bin"]) {
stage('Cloning') {
sh 'echo "----"; env | grep "P_" || true; echo "----"'
if (params.P_CLEAN) {
sh 'rm -rf sst-elements; rm -rf sst-elements-install'
}
sh 'alias; echo PATH=$PATH; echo SST_CORE_INSTALL=$SST_CORE_INSTALL; ls $SST_CORE_INSTALL'
String[] sstsimulatorRepos = ['sst-elements']
String[] sstsimulatorBranches = ['devel']
def git_helper = new gov.sandia.sems.spifi.Git()
sstsimulatorRepos.eachWithIndex {repo, i ->
println "Cloning: $repo:" + sstsimulatorBranches[i]
git_helper.clone(env: this,
dir: repo,
url: "https://github.com/sstsimulator/" + repo + ".git",
branch: sstsimulatorBranches[i],
retries: 3,
retry_delay: 30,
timeout: 30,
timeout_units: "MINUTES",
verbose: true)
}
}
stage('Download artifacts') {
if (params.P_DOWNLOAD_ARTIFACTS) {
// //TODO
}
}
stage('Configure') {
if (params.P_CONFIGURE) {
//def shell = new gov.sandia.sems.spifi.Shell()
//def output = shell.execute(env: this,
// command: "eval $SST_CORE_MODULES; " +
// "cd sst-elements; ./autogen.sh; " +
// "mkdir -p $INSTALL_DIR; " +
// "./configure --prefix=$INSTALL_DIR",
// verbose: true)
//println "Shell Output:\n" +
//"- status: ${output.status}\n" +
//"- stdout: ${output.stdout}\n"
sh '''
eval $SST_CORE_MODULES
cd sst-elements
env PATH=$PATH ./autogen.sh
mkdir -p $INSTALL_DIR; ./configure --prefix=$INSTALL_DIR
'''
}
}
stage('Build') {
if (params.P_BUILD) {
sh '''
eval $SST_CORE_MODULES
cd sst-elements
make -j4
'''
}
}
stage('Install') {
if (params.P_INSTALL) {
//TODO: use SPiFI shell command
sh '''
eval $SST_CORE_MODULES
cd sst-elements
make -j4 install
echo "INSTALL_DIR=$INSTALL_DIR"
ls -lat $INSTALL_DIR
'''
}
}
stage('Upload artifacts') {
if (params.P_UPLOAD_ARTIFACTS) {
//TODO
//echo '[STATUS]: archiving artifacts...'
//archiveArtifacts artifacts: 'sst-elements/src/sst/core/*.o, sst-elements/src/sst/core/**/*.o, sst-elements/src/sst/core/libltdl/.libs/*.a', fingerprint: true
}
}
stage('Test') {
if (params.P_RUN_TESTS) {
echo 'Testing...'
//sh 'cd sst-elements; ./src/sst/core/sstunit -ojunit || true'
//junit 'sst-elements/*.xml'
}
}
stage('Analyse') {
if (params.P_RUN_ANALYSIS) {
echo 'Static Analysis...'
}
}
stage('Deploy') {
if (params.P_DEPLOY) {
echo 'Deploying....'
//TODO
}
}
}
}