This repository was archived by the owner on Jul 8, 2019. It is now read-only.
forked from balena-os/balena-supervisor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircle.yml
More file actions
190 lines (188 loc) · 5.73 KB
/
circle.yml
File metadata and controls
190 lines (188 loc) · 5.73 KB
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
190
---
defaults: &defaults
docker:
- image: library/docker:17.06.0-ce
working_directory: /tmp/build
steps:
- setup_remote_docker:
version: 17.06.0-ce
reusable: true
- run:
name: Check docker is running and install git
command: |
docker info
apk update && apk upgrade && apk add --nocache \
make \
jq \
git \
bash \
grep \
nodejs \
nodejs-npm \
openssh-client
- checkout
- run:
name: Install npm dependencies
working_directory: /tmp/build/automation
command: |
JOBS=max npm install \
&& npm cache clean
- run:
name: Initialize the submodules (yocto layers)
command: |
git submodule update --init --recursive
git clean -fxd base-image
git submodule foreach --recursive git clean -fxd
- run:
name: Build $ARCH-supervisor
no_output_timeout: 10800
command: |
VERSION_TAG_NO_DEBUG=v$(jq --raw-output .version package.json)
GIT_TAG=$(git describe --tags | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' || echo "")
VERSION_TAG="${VERSION_TAG_NO_DEBUG}${DEBUG}"
if [ "${VERSION_TAG_NO_DEBUG}" = "${GIT_TAG}" ]; then
export EXTRA_TAG="${VERSION_TAG}"
fi
echo "Starting build.sh"
if [ "$DOCKER_PASSWORD" != "" ]; then
docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
export PUSH_IMAGES=${PUSH_IMAGES}
else
export PUSH_IMAGES=false
fi
# start the build for this architecture
export TAG=$(echo ${CIRCLE_BRANCH} | sed 's/[^a-z0-9A-Z_.-]/-/g')
export ARCH=${ARCH}
bash automation/build.sh
if [ "${CIRCLE_BRANCH}" = "master" ] && [ "${DEPLOY_TO_BALENA}" = "true" ]; then
echo "Deploying to balena API (staging)"
ARCH=${ARCH} TAG=$VERSION_TAG API_KEY=$STAGING_API_KEY API_ENDPOINT=$STAGING_API_ENDPOINT node automation/deploy-to-balena-cloud.js
echo "Deploying to balena API (production)"
ARCH=${ARCH} TAG=$VERSION_TAG API_KEY=$PRODUCTION_API_KEY API_ENDPOINT=$PRODUCTION_API_ENDPOINT node automation/deploy-to-balena-cloud.js
fi
version: 2
jobs:
amd64:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: amd64
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: ''
i386:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: i386
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: ''
i386-nlp:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: i386-nlp
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: ''
armv7hf:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: armv7hf
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: ''
aarch64:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: aarch64
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: ''
rpi:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: rpi
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: ''
amd64-debug:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: amd64
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: '-debug'
i386-debug:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: i386
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: '-debug'
i386-nlp-debug:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: i386-nlp
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: '-debug'
armv7hf-debug:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: armv7hf
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: '-debug'
aarch64-debug:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: aarch64
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: '-debug'
rpi-debug:
<<: *defaults
environment:
DOCKER_USERNAME: travisciresin
ARCH: rpi
PUSH_IMAGES: 'true'
STAGING_API_ENDPOINT: https://api.balena-staging.com
PRODUCTION_API_ENDPOINT: https://api.balena-cloud.com
DEBUG: '-debug'
workflows:
version: 2
build_and_maybe_deploy:
jobs:
- amd64
- i386
- rpi
- armv7hf
- aarch64
- i386-nlp
- amd64-debug
- i386-debug
- rpi-debug
- armv7hf-debug
- aarch64-debug
- i386-nlp-debug