-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile_UNGE
127 lines (117 loc) · 4.57 KB
/
Jenkinsfile_UNGE
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Copyright (c) 2004-2020 Microchip Technology Inc. and its subsidiaries.
// SPDX-License-Identifier: MIT
pipeline {
// Options directive is for configuration that applies to the whole job
options {
timestamps ()
// Only keep 5 builds at a time to avoid fill up the storage
buildDiscarder(logRotator(numToKeepStr:'5'))
// Make sure this build doesn't hang forever
timeout(time: 5, unit: 'HOURS')
skipDefaultCheckout()
}
// agent none;
agent { kubernetes { yamlFile '.cmake/pod-base.yaml' } }
environment {
USER_NAME = "jenkins"
WORK_DIR = "/home/$USER_NAME"
BLD_ID = "${env.BUILD_NUMBER}"
top = "${env.WORKSPACE}"
GIT_BRANCH = "${env.BRANCH_NAME}"
}
stages {
stage("git checkout") {
steps {
container('pod-mepa-base') {
checkout([
$class: 'GitSCM',
branches: scm.branches,
extensions: scm.extensions + [[$class: 'CloneOption', noTags: false, shallow: false]],
userRemoteConfigs: scm.userRemoteConfigs
])
sh """
git config --global --add safe.directory '*'
git clean -qffdx
.cmake/source-prepare.rb ws
mkdir images
"""
stash name: "src", includes: "ws.tar"
}
}
}
stage('Build in parallel') {
parallel {
stage("arm64") {
agent { kubernetes { yamlFile '.cmake/pod-build.yaml' } }
steps {
container('pod-mepa-build') {
unstash name: "src"
sh "tar -xf ws.tar && rm ws.tar"
sh "./.cmake/create_cmake_project_new.rb -vfnp arm64 arm64"
stash name: "bin-arm64", includes: "arm64.tar"
}
}
}
stage("misc") {
stages {
stage('Copyright') {
steps {
container('pod-mepa-base') {
warnError (message: "Copyright error") {
sh "./.cmake/copyright.rb"
}
}
}
}
stage('License') {
steps {
container('pod-mepa-base') {
warnError (message: "License error") {
sh "chmod +x -R ${env.top}"
sh "./.cmake/build-licenses.rb"
}
}
}
}
stage('Docs') {
steps {
container('pod-mepa-base') {
warnError (message: "Docs error") {
sh './.cmake/build-docs.rb'
}
}
}
}
}
}
}
}
stage("aggr-bin's") {
steps {
withCredentials([usernamePassword(credentialsId: 'Test', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASS')]) {
container('pod-mepa-base') {
unstash name: "bin-arm64"
sh ".cmake/aggr-artifacts.rb"
}
}
}
}
}
post {
success {
echo "Pipeline Success! Project: ${env.JOB_NAME}, Build Number: ${env.BUILD_NUMBER}"
}
unstable {
echo "Pipeline Unstable! Project: ${env.JOB_NAME}, Build Number: ${env.BUILD_NUMBER}"
}
aborted {
echo "Pipeline Aborted! Project: ${env.JOB_NAME}, Build Number: ${env.BUILD_NUMBER}"
}
failure {
echo "Pipeline Failure! Project: ${env.JOB_NAME}, Build Number: ${env.BUILD_NUMBER}"
}
always {
archiveArtifacts artifacts: 'images/*'
}
}
}