-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (62 loc) · 1.5 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
pipeline {
agent {
label 'LV2020'
}
environment{
PROJECT_TITLE = "Astemes Triarc Examples"
REPO_URL = "https://github.com/astemes/astemes-triarc-examples"
AUTHOR = "Anton Sundqvist"
INITIAL_RELEASE = 2021
THERMAL_CHAMBER = "source\\Thermal Chamber\\Thermal Chamber.lvproj"
COFFEE_SHOP_PROJECT = "source\\Coffee Shop\\Coffee Shop.lvproj"
LV_VIPB_PATH = "source\\Triarc Examples.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 "${THERMAL_CHAMBER}"
junit testResults: "reports\\*.xml", allowEmptyResults: true
runLUnit "${COFFEE_SHOP_PROJECT}"
junit testResults: "reports\\*.xml", allowEmptyResults: true
// Empty results set to true for the template to pass build
}
}
stage('Deploy') {
when{
expression{
!COMMIT_TAG.isEmpty()
}
}
environment{
GITHUB_TOKEN = credentials('github-token')
}
steps{
//Build VIPM package
massCompileLV()
script{VIP_FILE_PATH = buildVIPackage "${LV_VIPB_PATH}", "${LV_VERSION}", "${COMMIT_TAG}"}
deployGithubRelease "${REPO_URL}", "${COMMIT_TAG}", "${VIP_FILE_PATH}"
}
}
}
post{
regression{
sendMail "anton.sundqvist@astemes.com"
}
}
options {
buildDiscarder(logRotator(daysToKeepStr: '3', numToKeepStr: '5'))
}
}