This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
136 lines (124 loc) · 2.94 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
default:
image:
name: woodyslum/smarties-ci@sha256:319e62a06fb54a920e1d9d634a07d2115791ae85d129c1ed7aa72a5ba009b999
stages:
- build
- lint
- test
- doc
- deploy
cache:
paths:
- node_modules/
.build_template: &build_definition
script:
- export NODE_TLS_REJECT_UNAUTHORIZED=0
- npm config set strict-ssl false
- rm -Rf package-lock.json
- npm install --unsafe-perm
- echo "{\"commit\":\"$(echo $CI_COMMIT_SHA | head -c8)\"}" > version.json
- npm run --verbose build
- npm run --verbose build-deb
build:amd64:stretch:
image: woodyslum/smarties-ci@sha256:3e83e0cece6b6e5f98438a0a80c9cb85eb9d5610ec539427e3b8178359d769e2
stage: build
only:
- tags
tags:
- ci
- amd64
- stretch
<<: *build_definition
artifacts:
paths:
- build/*.deb
build:amd64:buster:
image: woodyslum/smarties-ci:$NODE_VERSION-buster-2
stage: build
only:
- tags
tags:
- ci
- amd64
- buster
<<: *build_definition
artifacts:
paths:
- build/*.deb
build:armhf:stretch:
image: woodyslum/smarties-ci@sha256:eb503151df4d8350f5a703d4ea8928dfa33773d2ca2ea2f6aa047d36c116cc47
stage: build
only:
- tags
tags:
- ci
- armhf
- stretch
<<: *build_definition
artifacts:
paths:
- build/*.deb
build:armhf:buster:
image: woodyslum/smarties-ci@sha256:319e62a06fb54a920e1d9d634a07d2115791ae85d129c1ed7aa72a5ba009b999
stage: build
tags:
- ci
- armv7
- buster
<<: *build_definition
artifacts:
paths:
- build/*
test:armhf:
stage: test
tags:
- ci
- armv7
- buster
only:
- master
except:
- tags
script:
- export NODE_TLS_REJECT_UNAUTHORIZED=0
- npm config set strict-ssl false
- npm run --verbose cov
coverage: '/Statements : \d+\.\d+/'
artifacts:
reports:
junit: tests-report.xml
lint:armhf:
stage: lint
tags:
- ci
- armv7
- buster
only:
- master
except:
- tags
script:
- export NODE_TLS_REJECT_UNAUTHORIZED=0
- npm config set strict-ssl false
- npm run --verbose lint
deploy:armhf:
stage: deploy
tags:
- ci
- armv7
- buster
only:
- master
except:
- tags
script:
- eval `ssh-agent -s`
- ssh-add <(echo "$STAGING_PRIVATE_KEY" | base64 --decode)
- ssh -oStrictHostKeyChecking=no -p$STAGING_SSH_PORT $STAGING_USER@$STAGING_IP "rm -Rf $STAGING_TMP_FOLDER/smarties-core-deploy"
- ssh -oStrictHostKeyChecking=no -p$STAGING_SSH_PORT $STAGING_USER@$STAGING_IP "mkdir $STAGING_TMP_FOLDER/smarties-core-deploy"
- scp -oStrictHostKeyChecking=no -P$STAGING_SSH_PORT -r build/* pi@$STAGING_IP:$STAGING_TMP_FOLDER/smarties-core-deploy/
- ssh -oStrictHostKeyChecking=no -p$STAGING_SSH_PORT $STAGING_USER@$STAGING_IP "cd $STAGING_TMP_FOLDER/smarties-core-deploy/scripts && sh install.sh $STAGING_USER $STAGING_GROUP $STAGING_INSTALLATION_FOLDER"
- ssh -oStrictHostKeyChecking=no -p$STAGING_SSH_PORT $STAGING_USER@$STAGING_IP "sudo shutdown -r +1 'Smarties update'"
environment:
name: staging
url: $STAGING_URL