forked from espressif/esp-skainet
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.gitlab-ci.yml
66 lines (59 loc) · 1.72 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
stages:
- build
- deploy
variables:
SKAINET_PATH: "$CI_PROJECT_DIR"
BATCH_BUILD: "1"
V: "0"
IDF_CI_BUILD: "1"
before_script:
# add gitlab ssh key
- 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 --version
- git submodule update --init --recursive --force
- pip install idf_build_apps
.build_all_examples_script: &build_all_examples_script
- python -m idf_build_apps build -p $EXAMPLES_PATH --recursive --manifest-file $EXAMPLES_PATH/$MANIFEST_FILE -t all
.build_template:
stage: build
tags:
- build
variables:
EXAMPLES_PATH: "examples"
MANIFEST_FILE: ".build-test-rules.yml"
script:
- *build_all_examples_script
build_idf_v4.4:
extends: .build_template
image: espressif/idf:release-v4.4
build_idf_v5.0:
extends: .build_template
image: espressif/idf:release-v5.0
push_to_github:
stage: deploy
image: $CI_DOCKER_REGISTRY/esp-env-v4.4:1
tags:
- deploy
when: on_success
only:
- master
- /^release\/v/
variables:
GIT_STRATEGY: clone
before_script:
- echo "skip default before_script"
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 remove github &>/dev/null || true
- git remote add github [email protected]:espressif/esp-skainet.git
- ${SKAINET_PATH}/tools/ci/push_to_github.sh