-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathJenkinsfile
76 lines (72 loc) · 2.73 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
67
68
69
70
71
72
73
74
75
76
@Library('vega-shared-library') _
def scmVars = null
def version = 'UNKNOWN'
def versionHash = 'UNKNOWN'
def commitHash = 'UNKNOWN'
pipeline {
agent none
options {
skipDefaultCheckout true
timestamps()
timeout(time: 50, unit: 'MINUTES')
disableConcurrentBuilds(abortPrevious: true)
}
parameters {
string( name: 'VEGA_VERSION', defaultValue: '0bea84651add988a725679b199b74f16f5cdc804',
description: 'Git branch, tag or hash of the vegaprotocol/vega repository')
string( name: 'VEGACAPSULE_VERSION', defaultValue: 'main',
description: 'Git branch, tag or hash of the vegaprotocol/vegacapsule repository')
string( name: 'JENKINS_SHARED_LIB_BRANCH', defaultValue: 'main',
description: 'Git branch, tag or hash of the vegaprotocol/jenkins-shared-library repository')
string( name: 'NODE_LABEL', defaultValue: 'vega-market-sim',
description: 'Node to run market sims' )
}
environment {
CGO_ENABLED = 0
GO111MODULE = 'on'
}
stages {
stage('Config') {
agent {
label params.NODE_LABEL
}
steps {
sh 'printenv'
echo "params=${params}"
echo "isPRBuild=${isPRBuild()}"
script {
params = pr.injectPRParams()
}
echo "params (after injection)=${params}"
retry (3) {
dir('vega-market-sim') {
script {
scmVars = checkout(scm)
versionHash = sh (returnStdout: true, script: "echo \"${scmVars.GIT_COMMIT}\"|cut -b1-8").trim()
version = sh (returnStdout: true, script: "git describe --tags 2>/dev/null || echo ${versionHash}").trim()
commitHash = getCommitHash()
}
echo "scmVars=${scmVars}"
echo "commitHash=${commitHash}"
}
}
}
}
stage('Vega Market Sim Tests') {
steps {
script {
vegaMarketSim (
ignoreFailure: false,
timeout: 90,
vegaMarketSim: commitHash,
vegaVersion: params.VEGA_VERSION,
vegacapsuleVersion: params.VEGACAPSULE_VERSION,
jenkinsSharedLib: params.JENKINS_SHARED_LIB_BRANCH,
nodeLabel: params.NODE_LABEL,
branchRun: isPRBuild()
)
}
}
}
}
}