forked from espressif/ESP8266_NONOS_SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
executable file
·77 lines (70 loc) · 2.31 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
stages:
- build
- deploy
.install_compiler: &install_compiler
- wget https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
- tar -zxvf xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
- export PATH=./xtensa-lx106-elf/bin/:$PATH
- xtensa-lx106-elf-gcc -v
.build_template: &build_template
stage: build
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
tags:
- build
variables:
GIT_STRATEGY: clone
SSC_DEFAULT_BRANCH: release/esp8266_nonos_sdk
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY >> ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- *install_compiler
build_ssc:
<<: *build_template
artifacts:
paths:
- ./SSC/ssc_bin
expire_in: 6 mos
script:
- git clone $GITLAB_SSH_SERVER/yinling/SSC.git
- cd SSC
# ssc master branch does not support nonos any more, now checkout to the reserved branch
- git checkout ${SSC_DEFAULT_BRANCH}
- chmod +x gen_misc_non_os.sh
- ./gen_misc_non_os.sh
build_at:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at at
- cd at
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
push_master_to_github:
stage: deploy
only:
- master
- /^release\/v.*$/
tags:
- deploy
when: on_success
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
variables:
GIT_STRATEGY: clone
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote add github [email protected]:espressif/ESP8266_NONOS_SDK.git
# - git push --follow-tags github HEAD:master
- eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)