-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
128 lines (116 loc) · 3.19 KB
/
Jenkinsfile
File metadata and controls
128 lines (116 loc) · 3.19 KB
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
127
128
pipeline {
agent { dockerfile true }
environment {
TARGET = 'x86_64-powernex'
PREFIX = '/opt/cc'
}
stages {
stage('fetch') {
steps {
script {
if (env.JOB_NAME.endsWith("_pull-requests"))
setGitHubPullRequestStatus state: 'PENDING', context: "${env.JOB_NAME}", message: "Fetching dependencies"
}
ansiColor('xterm') {
sh '''#!/bin/bash
set -xeuo pipefail
BINUTILS_VERSION=$(cat BINUTILS_VERSION)
GDB_VERSION=$(cat GDB_VERSION)
rm -rf binutils-${BINUTILS_VERSION} gdb-${GDB_VERSION} binutils-build gdb-build || true
curl -s http://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.gz | tar x --no-same-owner -z
curl -s http://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.gz | tar x --no-same-owner -zv
patch -p0 -i - <binutils-${BINUTILS_VERSION}.patch
patch -p0 -i - <gdb-${GDB_VERSION}.patch
'''
}
}
}
stage('build-binutils') {
steps {
script {
if (env.JOB_NAME.endsWith("_pull-requests"))
setGitHubPullRequestStatus state: 'PENDING', context: "${env.JOB_NAME}", message: "Building binutils"
}
ansiColor('xterm') {
sh '''#!/bin/bash
set -xeuo pipefail
BINUTILS_VERSION=$(cat BINUTILS_VERSION)
mkdir binutils-build
pushd binutils-build
../binutils-${BINUTILS_VERSION}/configure \
--enable-gold \
--enable-plugins \
--target=${TARGET} \
--prefix="${PREFIX}" \
--with-sysroot \
--disable-nls \
--disable-werror
make -j
make install -j
popd
rm -rf binutils-${BINUTILS_VERSION} binutils-build
'''
}
}
}
stage('build-gdb') {
steps {
script {
if (env.JOB_NAME.endsWith("_pull-requests"))
setGitHubPullRequestStatus state: 'PENDING', context: "${env.JOB_NAME}", message: "Building gdb"
}
ansiColor('xterm') {
sh '''#!/bin/bash
set -xeuo pipefail
GDB_VERSION=$(cat GDB_VERSION)
mkdir gdb-build
pushd gdb-build
../gdb-${GDB_VERSION}/configure \
--prefix="${PREFIX}" \
--disable-nls \
--with-system-readline \
--with-python=/usr/bin/python3 \
--with-guile=guile-2.0 \
--disable-werror
make -j
make install -j
popd
rm -rf gdb-${GDB_VERSION} gdb-build
'''
}
}
}
stage('archive') {
steps {
script {
if (env.JOB_NAME.endsWith("_pull-requests"))
setGitHubPullRequestStatus state: 'PENDING', context: "${env.JOB_NAME}", message: "Archiving binutils and gdb"
}
ansiColor('xterm') {
sh '''#!/bin/bash
set -xeuo pipefail
pushd ${PREFIX}
tar cvfJ powernex-binutils.tar.xz *
popd
mv ${PREFIX}/powernex-binutils.tar.xz .
'''
archiveArtifacts artifacts: 'powernex-binutils.tar.xz', fingerprint: true
}
}
}
}
post {
success {
script {
if (env.JOB_NAME.endsWith("_pull-requests"))
setGitHubPullRequestStatus state: 'SUCCESS', context: "${env.JOB_NAME}", message: "binutils & gdb building successed"
}
}
failure {
script {
if (env.JOB_NAME.endsWith("_pull-requests"))
setGitHubPullRequestStatus state: 'FAILURE', context: "${env.JOB_NAME}", message: "binutils & gdb building failed"
}
}
}
}