-
Notifications
You must be signed in to change notification settings - Fork 88
/
.jenkinsfile
118 lines (118 loc) · 4.16 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
pipeline {
options {
disableConcurrentBuilds(abortPrevious: true)
}
agent {
docker {
image 'megabuild'
args '--init -v vivado_2023_2:/opt/Xilinx'
}
}
stages {
stage('Setup toolchain') {
steps {
sh 'echo -n "LOCAL CC65 VERSION: " && cc65 --version'
script {
currentBuild.description = "Commit: ${GIT_COMMIT_SHORT}\r\n${GIT_COMMITTER}"
}
sh 'release-build/prepare.sh prunepkg'
}
}
stage('Cleanup') {
steps {
sh 'make cleanall'
}
}
stage('Build Freezer & Flasher') {
steps {
sh 'make freezer_files'
sh 'make flasher_files'
}
}
stage('Build MEGA65R6') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', catchInterruptions: false) {
sh 'make bin/mega65r6.bit'
sh 'release-build/build-release.sh mega65r6 JENKINSGEN'
sh 'release-build/build-release.sh mega65r5_6 JENKINSGEN'
}
}
}
/*
// mega65r5 is essentially the same as mega65r6, and the r6 build will also package as r5
stage('Build MEGA65R5') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', catchInterruptions: false) {
sh 'make bin/mega65r5.bit'
sh 'release-build/build-release.sh mega65r5 JENKINSGEN'
}
}
}
*/
stage('Build MEGA65R4') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', catchInterruptions: false) {
sh 'make bin/mega65r4.bit'
sh 'release-build/build-release.sh mega65r4 JENKINSGEN'
}
}
}
stage('Build MEGA65R3') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', catchInterruptions: false) {
sh 'make bin/mega65r3.bit'
sh 'release-build/build-release.sh mega65r3 JENKINSGEN'
}
}
}
stage('Build MEGA65R2') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', catchInterruptions: false) {
sh 'make bin/mega65r2.bit'
sh 'release-build/build-release.sh -noreg mega65r2 JENKINSGEN'
}
}
}
stage('Build Nexys4DDR-Widget') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', catchInterruptions: false) {
sh 'make bin/nexys4ddr-widget.bit'
sh 'release-build/build-release.sh nexys4ddr-widget JENKINSGEN'
}
}
}
stage('Set build result') {
steps {
script {
def files = findFiles(glob: 'release-build/pkg/*.7z')
// number of total architectures needs to be changed in next line,
// if we add or subtract build targets!
if (files.length < 3) {
currentBuild.result = 'UNSTABLE'
} else if (files.length == 0) {
currentBuild.result = 'FAILURE'
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: "release-build/pkg/*.7z",
fingerprint: true
}
}
environment {
BRANCH_SHORT = sh (returnStdout: true, script: 'echo $BRANCH_NAME | sed -r \'s/^(.{5}).*$/\1/\'').trim()
USE_LOCAL_CC65 = "1"
VIVADO = "/opt/Xilinx/vivado_wrapper.sh"
GIT_COMMIT_SHORT = sh(
script: "printf \$(git rev-parse --short ${GIT_COMMIT})",
returnStdout: true
).trim()
GIT_COMMITTER = sh(
script: "git --no-pager show -s --format='%an <%ae>' ${GIT_COMMIT}",
returnStdout: true
).trim()
}
}