@@ -4,14 +4,15 @@ variables:
4
4
stages :
5
5
- download
6
6
- build
7
+ - ZipUp
7
8
8
9
#
9
10
# Download CBACnet Stack libaries
10
11
# -----------------------------------------------------------------------------
11
12
# How to download artifacts from jobs in Gitlab CI https://docs.gitlab.com/ee/api/jobs.html#download-the-artifacts-archive
12
13
# Note: the SETTING_PRIVATE_TOKEN parameter is a enviment variable, generated by Steven's user.
13
14
#
14
- Download BACnet Stack Libaries Windows :
15
+ Download BACnet Stack Libaries :
15
16
stage : download
16
17
tags :
17
18
- docker
@@ -25,11 +26,15 @@ Download BACnet Stack Libaries Windows:
25
26
- " apk --no-cache add unzip curl"
26
27
- ' curl --location --output CASBACnetStackLibs.zip --header "PRIVATE-TOKEN: $SETTING_PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/7281208/jobs/artifacts/master/download?job=Windows%20Release%20Win32%20CASBACnetStack%20LIB&job_token=$CI_JOB_TOKEN"'
27
28
- unzip CASBACnetStackLibs.zip && rm -f CASBACnetStackLibs.zip
29
+ - ' curl --location --output CASBACnetStackLibs.zip --header "PRIVATE-TOKEN: $SETTING_PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/7281208/jobs/artifacts/master/download?job=Linux-Ubuntu%20Release%20x64%20CASBACnetStack&job_token=$CI_JOB_TOKEN"'
30
+ - unzip CASBACnetStackLibs.zip && rm -f CASBACnetStackLibs.zip
28
31
- ls -ls bin/
29
32
artifacts :
33
+ expire_in : 1 days
30
34
paths :
31
35
- bin/*.lib
32
-
36
+ - bin/*.a
37
+
33
38
# Build the windows version
34
39
Windows Win32 Release :
35
40
stage : build
@@ -40,10 +45,8 @@ Windows Win32 Release:
40
45
# Add MSBuild.exe to path
41
46
- set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
42
47
# Update the CIBuildVersion.cs
43
- - cd BACnetServerExample
44
- - " echo const int CIBUILDNUMBER = %CI_PIPELINE_IID%; > CIBuildVersion.h"
45
- - type CIBuildVersion.h
46
- - cd ..
48
+ - " echo const int CI_PIPELINE_IID = %CI_PIPELINE_IID% >BACnetServerExample/CIBuildSettings.h"
49
+ - type BACnetServerExample\CIBuildVersion.h
47
50
script :
48
51
# Create the bin directory if it does not exist
49
52
- cd BACnetServerExample
@@ -52,7 +55,54 @@ Windows Win32 Release:
52
55
- cd ..\bin
53
56
- dir
54
57
artifacts :
58
+ expire_in : 1 days
59
+ paths :
60
+ - bin/BACnetServerExample_Win32_Release.exe
61
+ dependencies :
62
+ - Download BACnet Stack Libaries
63
+
64
+ # Build the linux 64bit version
65
+ Linux 64Bit Release :
66
+ stage : build
67
+ tags :
68
+ - docker
69
+ image : ssmethurst/ubuntudev-18_04:latest
70
+ before_script :
71
+ # Update the CIBuildVersion.cs
72
+ - echo -e "const int CI_PIPELINE_IID = $CI_PIPELINE_IID\n" >BACnetServerExample/CIBuildSettings.h
73
+ # debug info
74
+ - " gcc -v"
75
+ script :
76
+ - " make"
77
+ - " make install"
78
+ artifacts :
79
+ expire_in : 1 days
55
80
paths :
56
- - bin\BACnetServerExample_Win32_Release.exe
81
+ - bin/BACnetServerExampleCPP_linux_x64_Release
57
82
dependencies :
58
- - Download BACnet Stack Libaries Windows
83
+ - Download BACnet Stack Libaries
84
+
85
+
86
+ # CreateZip
87
+ Create Zip :
88
+ stage : ZipUp
89
+ tags :
90
+ - docker
91
+ image : alpine:latest
92
+ variables :
93
+ GIT_SUBMODULE_STRATEGY : none
94
+ only :
95
+ - master
96
+ dependencies :
97
+ - Linux 64Bit Release
98
+ - Windows Win32 Release
99
+ script :
100
+ # Install Zip
101
+ - " apk --no-cache add zip"
102
+ # Remove the old zip if it exists for some reason
103
+ - " rm -f BACnetServerExampleCPP_build$CIPIPELINE_IID.zip"
104
+ # Add all the compiled libaries from other jobs.
105
+ - " zip BACnetServerExampleCPP_build$CI_PIPELINE_IID.zip -r9 bin/BACnetServerExampleCPP_linux_x64_Release bin/BACnetServerExample_Win32_Release.exe"
106
+ artifacts :
107
+ paths :
108
+ - BACnetServerExampleCPP_build$CI_PIPELINE_IID.zip
0 commit comments