forked from espressif/esp-at
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
63 lines (57 loc) · 1.93 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
stages:
- build
- deploy
build_at:
stage: build
image: espressif/esp32-ci-env
tags:
- build
variables:
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
GIT_STRATEGY: clone
artifacts:
paths:
- build/*.bin
- build/*.elf
- build/*.map
- build/bootloader/*.bin
- build/customized_partitions/*.bin
- build/download.config
expire_in: 6 mos
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
- git submodule update --init --recursive
script:
- sed -i "/CONFIG_AT_OTA_TOKEN_KEY/c\\CONFIG_AT_OTA_TOKEN_KEY=\"$AT_OTA_KEY\"" sdkconfig.defaults
- sed -i "/CONFIG_AT_OTA_SSL_TOKEN_KEY/c\\CONFIG_AT_OTA_SSL_TOKEN_KEY=\"$AT_OTA_KEY\"" sdkconfig.defaults
- make defconfig
- make -j4
- make print_flash_cmd | tail -n 1 > build/download.config
- make factory_bin
push_master_to_github:
stage: deploy
only:
- master
- /^release\/v.*$/
tags:
- deploy
when: on_success
image: espressif/esp32-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/esp32-at.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)