-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
26 lines (23 loc) · 905 Bytes
/
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
node {
def realpath = sh(script: """
docker inspect jenkins --format='{{range .Mounts}}{{if eq .Destination "/var/jenkins_home"}}{{.Source}}{{end}}{{end}}'
""", returnStdout: true).trim()
echo "realPath:" + realpath
def realWorkspace = env.WORKSPACE
echo "realworkspace:" + realWorkspace
def workspaceRealDir= realWorkspace.replace("/var/jenkins_home",realpath)
echo "workspaceRealDir:" + workspaceRealDir
stage('Clone sources') {
checkout scm
}
stage('Build') {
withEnv(["PROJECT_DIR=${workspaceRealDir}"]){
sh('docker run --rm -v "${PROJECT_DIR}":/work axemsolutions/make_gnu_arm /bin/sh -c "make"')
}
}
stage('Test') {
withEnv(["PROJECT_DIR=${workspaceRealDir}"]){
sh('docker run --rm -v "${PROJECT_DIR}":/work axemsolutions/cpputest /bin/sh -c "cd app/test; make"')
}
}
}