forked from microsoft/oe-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
48 lines (48 loc) · 2.27 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
#!/usr/bin/env groovy
node("nonSGX") {
try {
cleanWs()
withCredentials([usernamePassword(credentialsId: 'SERVICE_PRINCIPAL_OSTCLAB',
passwordVariable: 'SERVICE_PRINCIPAL_PASSWORD',
usernameVariable: 'SERVICE_PRINCIPAL_ID'),
string(credentialsId: 'OSCTLabSubID', variable: 'SUBSCRIPTION_ID'),
string(credentialsId: 'TenantID', variable: 'TENANT_ID')]) {
withEnv(["AZURE_CONFIG_DIR=${WORKSPACE}/gopath/src/github.com/Microsoft/oe-engine)",
"GOPATH=${WORKSPACE}/gopath",
"GOROOT=/usr/local/go",
"GOCACHE=${WORKSPACE}/gopath/.cache"]) {
docker.withRegistry("https://oejenkinscidockerregistry.azurecr.io", "oejenkinscidockerregistry") {
def image = docker.image("oe-engine:latest")
image.pull()
image.inside('-e PATH=$PATH:/usr/local/go/bin:$WORKSPACE/gopath/bin') {
dir('gopath/src/github.com/Microsoft/oe-engine') {
stage('Checkout') {
checkout scm
}
stage('Unit test') {
sh "echo \$PATH"
}
stage('Build') {
sh 'make build'
}
stage('Ubuntu 16.04') {
sh 'test/acc-pr-test.sh oe-ub1604.json'
}
stage('Ubuntu 18.04') {
sh 'test/acc-pr-test.sh oe-ub1804.json'
}
stage('Windows') {
sh 'test/acc-pr-test.sh oe-win.json'
}
}
}
}
}
}
} catch (err) {
echo err.getMessage
currentBuild.result = 'FAILURE'
} finally {
archiveArtifacts artifacts: 'gopath/src/github.com/Microsoft/oe-engine/test/agent_logs/**/*.log', fingerprint: true, allowEmptyArchive: true
}
}