-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy path.jenkinsfile
95 lines (95 loc) · 3.09 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
pipeline {
agent {
docker { image 'megawin' }
}
environment {
USE_LOCAL_CC65 = 1 // docker has cc65 installed
WIN_CROSS_BUILD = 1 // we want to build win on linux
FH_API_KEY = credentials('filehost-api-key')
FH_ID_DEV_M65LNX = '2b7bd912-1181-447c-a489-223f16b764c1'
FH_ID_DEV_M65WIN = '658322fd-e586-4b4f-a991-89470b269b4a'
FH_ID_REL_M65LNX = 'e97f3bf4-9d55-4ae2-a39a-d31dd15e8d34'
FH_ID_REL_M65WIN = '06c55815-7826-4ad6-be0e-b8dc5e721b6d'
}
stages {
/*
* make sure we start from a clean slate
*/
stage('Cleanup') {
steps {
sh 'make cleanall'
}
}
/*
* For a PR branch we build all possible linux and windows targets
*/
stage ('Full PR Testbuild') {
when {
branch pattern: "PR-*"
}
steps {
sh 'make allunix allwin'
}
}
/*
* For a non PR branch we only build the stuff that goes into a
* release archive.
*/
stage('Build Linux Tools') {
when {
not { branch pattern: "PR-*" }
}
steps {
sh 'make arcunix'
}
}
stage('Build Windows Tools') {
when {
not { branch pattern: "PR-*" }
}
steps {
sh 'make arcwin'
}
}
/*
* do unittests
*/
stage('Run build tests') {
steps {
sh 'make test'
}
}
}
post {
always {
script {
/*
* only archive artifact for non PR builds
*/
if (!env.BRANCH_NAME.startsWith('PR-')) {
archiveArtifacts artifacts: "m65tools-*.7z",
onlyIfSuccessful: true,
fingerprint: true
}
}
}
success {
script {
if (env.BRANCH_NAME == 'development') {
sh '''
filehost-upload -i ${FH_ID_DEV_M65LNX} -a addversion -V ${BUILD_NUMBER} -I "`git log -1 --pretty=tformat:'dev@%h: %s'`" m65tools-*-linux.7z
filehost-upload -i ${FH_ID_DEV_M65WIN} -a addversion -V ${BUILD_NUMBER} -I "`git log -1 --pretty=tformat:'dev@%h: %s'`" m65tools-*-windows.7z
'''
}
/* no auto upload for a release, this is handpicked and handuploaded!
else if (env.BRANCH_NAME == 'master') {
sh '''
filehost-upload -i ${FH_ID_REL_M65LNX} -a addversion -V ${BUILD_NUMBER} -I "`git log -1 --pretty=tformat:'master@%h: %s'`" m65tools-*-linux.7z
filehost-upload -i ${FH_ID_REL_M65WIN} -a addversion -V ${BUILD_NUMBER} -I "`git log -1 --pretty=tformat:'master@%h: %s'`" m65tools-*-windows.7z
'''
}
*/
}
}
}
}