forked from Astemes/astemes-lunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
75 lines (75 loc) · 1.81 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
pipeline {
agent {
label 'LV2020'
}
environment{
PROJECT_TITLE = "Astemes LUnit"
REPO_URL = "https://github.com/astemes/astemes-lunit"
AUTHOR = "Anton Sundqvist"
INITIAL_RELEASE = 2021
LV_PROJECT_PATH = "source\\LUnit Framework.lvproj"
LV_BUILD_SPEC = "LUnit"
LV_VIPB_PATH = "source\\LUnit.vipb"
LV_CLI_VIPB_PATH = "source\\LUnit CLI.vipb"
LV_VERSION = "20.0"
}
stages {
stage('Initialize') {
steps {
library 'astemes-build-support'
script{COMMIT_TAG = gitTag()}
killLv()
initWorkspace()
dir("build_support"){
pullBuildSupport()
initPythonVenv "requirements.txt"
}
}
}
stage('Test') {
steps {
runLUnit "${LV_PROJECT_PATH}"
junit "reports\\*.xml"
}
}
stage('Build') {
steps {
clearMutationHistory "${WORKSPACE}\\source"
//Execute LabVIEW build spec
buildLVBuildSpec "${LV_PROJECT_PATH}", "${LV_BUILD_SPEC}"
//Build mkdocs documentation
buildDocs "${PROJECT_TITLE}", "${REPO_URL}", "${AUTHOR}", "${INITIAL_RELEASE}"
}
}
stage('Deploy') {
when{
expression{
!COMMIT_TAG.isEmpty()
}
}
environment{
GITHUB_TOKEN = credentials('github-token')
}
steps{
//Build VIPM package
script{VIP_FILE_PATH = buildVIPackage "${LV_VIPB_PATH}", "${LV_VERSION}", "${COMMIT_TAG}"}
script{CLI_VIP_FILE_PATH = buildVIPackage "${LV_CLI_VIPB_PATH}", "${LV_VERSION}", "${COMMIT_TAG}"}
deployGithubPages()
deployGithubRelease "${REPO_URL}", "${COMMIT_TAG}", "${VIP_FILE_PATH}"
addFileToGithubRelease "${REPO_URL}", "${COMMIT_TAG}", "${CLI_VIP_FILE_PATH}"
}
}
}
post{
always {
killLv()
//cleanWs(notFailBuild: true)
}
regression{
sendMail "[email protected]"
}
}
options {
buildDiscarder(logRotator(daysToKeepStr: '3', numToKeepStr: '5'))
}
}