forked from sora-xor/sora2-common
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
66 lines (64 loc) · 2.03 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('jenkins-library')
String agentLabel = 'docker-build-agent'
String registry = 'docker.soramitsu.co.jp'
String dockerBuildToolsUserId = 'bot-build-tools-ro'
String cargoImage = registry + '/build-tools/cargo_audit'
String secretScannerExclusion = '.*Cargo.toml'
Boolean disableSecretScanner = false
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '20'))
timestamps()
disableConcurrentBuilds()
}
agent {
label agentLabel
}
stages {
stage('Secret scanner') {
steps {
script {
gitNotify('main-CI', 'PENDING', 'This commit is being built')
docker.withRegistry('https://' + registry, dockerBuildToolsUserId) {
secretScanner(disableSecretScanner, secretScannerExclusion)
}
}
}
}
stage('Init submodule') {
environment {
GIT_SSH_COMMAND = "ssh -o UserKnownHostsFile=/dev/null StrictHostKeyChecking=no"
}
steps {
script {
sshagent(['soramitsu-bot-ssh']) {
sh """
git submodule update --init --recursive
"""
}
}
}
}
stage('Tests') {
steps {
script {
docker.withRegistry( 'https://' + registry, dockerBuildToolsUserId) {
docker.image(cargoImage + ':latest').inside(){
sh """
cargo test --release --features runtime-benchmarks
"""
}
}
}
}
}
}
post {
always {
script{
gitNotify('main-CI', currentBuild.result, currentBuild.result)
}
}
cleanup { cleanWs() }
}
}