-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
100 lines (96 loc) · 3.21 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@Library('vega-shared-library') _
def commitHash = 'UNKNOWN'
pipeline {
agent { label 'general' }
options {
skipDefaultCheckout true
parallelsAlwaysFailFast()
}
environment {
GO111MODULE = 'on'
SLACK_MESSAGE = "Specs-Internal CI » <${RUN_DISPLAY_URL}|Jenkins ${BRANCH_NAME} Job>${ env.CHANGE_URL ? " » <${CHANGE_URL}|GitHub PR #${CHANGE_ID}>" : '' }"
}
stages {
stage('setup') {
steps {
sh 'printenv'
echo "${params}"
}
}
stage('Git clone') {
parallel {
stage('specs-internal') {
steps {
retry(3) {
dir('specs-internal') {
checkout scm
script {
commitHash = getCommitHash()
}
}
}
}
}
stage('vega core') {
steps {
retry(3) {
dir('vega') {
git branch: 'develop', credentialsId: 'vega-ci-bot', url: 'git@github.com:vegaprotocol/vega.git'
}
}
}
}
}
}
stage('Run checks') {
parallel {
stage('lint: yaml') {
steps {
retry(3) {
dir('specs-internal') {
sh 'yamllint -s -d "{extends: default, rules: {line-length: {max: 160}}}" .'
}
}
}
}
stage('approbation') {
when {
anyOf {
branch 'develop'
branch 'main'
branch 'master'
}
}
parallel {
stage('Core') {
steps {
runApprobation ignoreFailure: !isPRBuild(),
specsInternal: commitHash,
type: 'core',
}
}
stage('Frontend') {
steps {
runApprobation ignoreFailure: !isPRBuild(),
specsInternal: commitHash,
type: 'frontend',
}
}
}
}
}
}
}
post {
// success {
// retry(3) {
// slackSend(channel: "#protocol-design-notify", color: "good", message: ":white_check_mark: ${SLACK_MESSAGE}")
// }
// }
unsuccessful {
retry(3) {
slackSend(channel: "#protocol-design-notify", color: "danger", message: ":red_circle: ${SLACK_MESSAGE}")
}
}
}
}