-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile
87 lines (82 loc) · 3.36 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
// Copyright (C) 2005 - 2021 Settlers Freaks <sf-team at siedler25.org>
//
// SPDX-License-Identifier: GPL-2.0-or-later
dockerRegistry = "registry.mytrap.de/"
dockerCredentials = "gitlab-Flow86"
dockerImage = "rttr/cross-compiler/linux/linux-amd64-docker:master"
pipeline {
agent {
label "docker"
}
options {
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '14', daysToKeepStr: '14', numToKeepStr: '180'))
disableConcurrentBuilds()
}
environment {
DEBIAN_FRONTEND = 'noninteractive'
}
stages {
stage('checkout') {
steps {
dir('libutil') {
checkout scm: [
$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false],
[$class: 'GitLFSPull'],
[$class: 'AuthorInChangelog'],
[$class: 'CleanCheckout']
],
submoduleCfg: [],
userRemoteConfigs: [[name: 'libutil', url: 'https://github.com/Return-To-The-Roots/libutil.git']]
]
}
dir('libendian') {
checkout scm: [
$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false],
[$class: 'GitLFSPull'],
[$class: 'AuthorInChangelog'],
[$class: 'CleanCheckout']
],
submoduleCfg: [],
userRemoteConfigs: [[name: 'libendian', url: 'https://github.com/Return-To-The-Roots/libendian.git']]
]
}
}
}
stage('build') {
steps {
withDockerRegistry( registry: [credentialsId: dockerCredentials, url: 'https://'+dockerRegistry ] ) {
withDockerContainer(
image: dockerRegistry+dockerImage,
args: " \
-v $HOME/.ccache:/.ccache \
") {
sh """set -ex
rm -rf build || true
export LIBUTIL_DIR="\$(pwd)/libutil"
export LIBENDIAN_DIR="\$(pwd)/libendian"
export TRAVIS_OS_NAME=Unix
tools/ci/build.sh Debug ""
"""
}
}
}
}
}
post {
failure {
mail to: '[email protected]',
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Pipeline failed: ${env.BUILD_URL}"
}
cleanup {
sh 'rm -rf build'
}
}}