/
Jenkinsfile
66 lines (61 loc) · 2.1 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@Library('xmos_jenkins_shared_library@v0.14.2') _
getApproval()
pipeline {
agent {
dockerfile {
args ""
}
}
parameters { // Available to modify on the job page within Jenkins if starting a build
string( // use to try different tools versions
name: 'TOOLS_VERSION',
defaultValue: '15.0.4',
description: 'The tools version to build with (check /projects/tools/ReleasesTools/)'
)
}
options { // plenty of things could go here
//buildDiscarder(logRotator(numToKeepStr: '10'))
timestamps()
}
stages {
stage("Setup") {
// Clone and install build dependencies
steps {
// clean auto default checkout
sh "rm -rf *"
// clone
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: false,
userRemoteConfigs: [[credentialsId: 'xmos-bot',
url: 'git@github.com:xmos/lib_dispatch']]
])
// create venv
sh "conda env create -q -p lib_dispatch_venv -f environment.yml"
// Install xmos tools version
sh "/XMOS/get_tools.py " + params.TOOLS_VERSION
}
}
stage("Update all packages") {
// Roll all conda packages forward beyond their pinned versions
when { expression { return params.UPDATE_ALL } }
steps {
sh "conda update --all -y -q -p lib_dispatch_venv"
}
}
stage("Build & Test") {
steps {
// below is how we can activate the tools
sh """pushd /XMOS/tools/${params.TOOLS_VERSION}/XMOS/xTIMEcomposer/${params.TOOLS_VERSION} && . SetEnv && popd &&
. activate ./lib_dispatch_venv &&
cd test && bash ci_tests.sh"""
}
}
}
post {
cleanup {
cleanWs()
}
}
}