-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (101 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
image: registry.gitlab.com/mcspr/espurna-travis-test:latest
stages:
- prepare
- build
- package
variables:
DOCKER_DRIVER: "overlay2"
PLATFORMIO_HOME_DIR: "$CI_PROJECT_DIR/platformio"
BUILDER_TOTAL_THREADS: 4
prepare:test:
stage: prepare
artifacts:
expire_in: 10m
paths:
- espurna/firmware/
script:
- python -V
- cat /proc/cpuinfo
- virtualenv venv && source venv/bin/activate
- pip install platformio
- git clone --depth=1 https://github.com/xoseperez/espurna
- pio run -d espurna/code -e itead-sonoff-basic
- pio run -d espurna/code -e itead-sonoff-pow
only:
- web
prepare:platformio:
stage: prepare
artifacts:
expire_in: 1h
paths:
- platformio/
- venv/
- espurna/
- environment
script:
- python -V
- virtualenv ./venv
- . venv/bin/activate
- mkdir -p espurna
- pushd espurna && git init && git remote add origin https://github.com/xoseperez/espurna && popd
- pip install -U requests
- python2 prepare_env.py && cat environment && source environment
- "[[ ${ESPURNA_DO_RELEASE} = \"True\" ]] || exit 10"
- pushd espurna && git fetch --depth=1 origin refs/heads/dev && git checkout FETCH_HEAD && popd
- pip install -U platformio
- python2 prepare.py espurna/code
only:
- schedules
.build:template: &build_template
stage: build
dependencies:
- prepare:platformio
artifacts:
expire_in: 15m
paths:
- environment
- espurna/firmware/
script:
- . venv/bin/activate
- cd espurna/code && TRAVIS_BUILD_STAGE_NAME=Release ./build.sh -p
only:
- schedules
build:builder_0:
before_script:
- export BUILDER_TOTAL_THREADS=$BUILDER_TOTAL_THREADS
- export BUILDER_THREAD=0
<<: *build_template
build:builder_1:
before_script:
- export BUILDER_TOTAL_THREADS=$BUILDER_TOTAL_THREADS
- export BUILDER_THREAD=1
<<: *build_template
build:builder_2:
before_script:
- export BUILDER_TOTAL_THREADS=$BUILDER_TOTAL_THREADS
- export BUILDER_THREAD=2
<<: *build_template
build:builder_3:
before_script:
- export BUILDER_TOTAL_THREADS=$BUILDER_TOTAL_THREADS
- export BUILDER_THREAD=3
<<: *build_template
package:release:
stage: package
dependencies:
- build:builder_0
- build:builder_1
- build:builder_2
- build:builder_3
artifacts:
expire_in: 1h
paths:
- release.tar.xz
script:
- tar cJf release.tar.xz espurna/firmware/
- source environment
- bash rename_app_revision.sh
- cd espurna/firmware/*
- ghr -u mcspr -r espurna-travis-test -b ${ESPURNA_RELEASE_BODY} ${ESPURNA_RELEASE_TAG} ./
only:
- schedules