-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
189 lines (173 loc) · 5.24 KB
/
.gitlab-ci.yml
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
stages:
- version
- build
- deploy
- test
- ci_status
include:
- project: telios2/telios-devops
ref: master
file: ".gitlab-ci.DiscordWebhook.yml"
- template: Code-Quality.gitlab-ci.yml
code_quality:
needs: []
.code_quality_html:
extends: code_quality
variables:
REPORT_FORMAT: html
artifacts:
paths: [gl-code-quality-report.html]
needs: []
#TODO disable tests for now
.test-app:
stage: test
image: registry.gitlab.com/telios2/telios-devops/electronbuilder:wine
script:
- yarn install
- yarn build-main
- yarn build-renderer
- yarn lint
- yarn test
allow_failure: true
.set_version:
tags:
- docker
stage: version
image: alpine:latest
script:
- sed -i "s/\(.version.:..[0-9]*.[0-9]*.\)[0-9]*/\1${CI_PIPELINE_IID}${CHANNEL}/g" package.json
- sed -i "s/\(.version.:..[0-9]*.[0-9]*.\)[0-9]*/\1${CI_PIPELINE_IID}${CHANNEL}/g" app/package.json
- echo ${CI_PIPELINE_IID}
artifacts:
untracked: false
expire_in: 1 hour
paths:
- 'package.json'
- 'app/package.json'
version:
extends:
- .set_version
only:
- master
version-beta:
extends:
- .set_version
only:
- beta
variables:
CHANNEL: "-beta"
.electron-release-build:
stage: build
image: registry.gitlab.com/telios2/telios-devops/electronbuilder:wine
script:
- mkdir -p release_signing/tmp
- yarn install
- yarn package-${PLATFORM}
- git status
artifacts:
paths:
- release/*.exe*
- release/*.msi
- release/*.dmg*
- release/*.deb
- release/*.rpm
- release/*.AppImage
- release/*.yml
- release/*.zip
expire_in: 1 month
filesystemFix:win:
tags:
- electron-win
stage: version
variables:
PLATFORM: win
GIT_STRATEGY: none
before_script:
- $ENV:PATH="$ENV:PATH;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin"
script:
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} registry.gitlab.com
- docker run -v $PWD":/repo/" -w /repo/ registry.gitlab.com/telios2/telios-devops/bash/prd rm -rf ./release
- docker run -v $PWD":/repo/" -w /repo/ registry.gitlab.com/telios2/telios-devops/bash/prd rm -rf ./app/node_modules/@telios/
electron-build:win:
tags:
- electron-win
extends: .electron-release-build
only:
refs:
- master
- beta
variables:
PLATFORM: win
GIT_STRATEGY: fetch
VCINSTALLDIR: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\"
before_script:
#- choco install nodejs -y --version=12.13.0
#- choco install python -y --version=3.8.3
#- choco install yarn -y
#- $ENV:PATH="$ENV:PATH;C:\Users\gitlab_runner\AppData\Roaming\npm\;C:\Python38"
#- $env:path -split ";"
#- npm install yarn -g
#- npm install --global --production windows-build-tools
#- choco install visualstudio2019buildtools visualstudio2019-workload-vctools
- npm config set msvs_version 2019
- $ENV:PATH="$ENV:PATH;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\Gar\AppData\Local\Microsoft\WindowsApps;;C:\Users\Gar\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Gar\AppData\Roaming\npm"
after_script:
- dir release
electron-build:linux:
tags:
- docker
extends: .electron-release-build
only:
refs:
- master
- beta
variables:
PLATFORM: linux
after_script:
- ls -la release/
electron-build:mac:
tags:
- electron-osx
extends: .electron-release-build
variables:
PLATFORM: mac
GIT_STRATEGY: fetch
before_script:
- PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
- source $HOME/.bash_profile
after_script:
- ls -la release/
.spaces:
tags:
- docker
stage: deploy
only:
refs:
- master
- beta
image:
name: registry.gitlab.com/telios2/telios-devops/ansible/prd:latest
entrypoint: ['/bin/bash', '-c', '/bin/bash']
# before_script:
# - export TELIOS_VERSION="Telios-$(cat package.json | grep "version.:" | sed "s/.*version.:..\([0-9]*.[0-9]*.\)[0-9]*../\1.${CI_PIPELINE_IID}/g")"
spaces:win:
extends:
- .spaces
needs:
- electron-build:win
script:
- ansible-playbook playbooks/site.yml --tags update,upload,win
spaces:mac:
extends:
- .spaces
needs:
- electron-build:mac
script:
- ansible-playbook playbooks/site.yml --tags update,upload,mac
spaces:linux:
extends:
- .spaces
needs:
- electron-build:linux
script:
- ansible-playbook playbooks/site.yml --tags update,upload,linux