Skip to content

Commit cd22e98

Browse files
author
Mangesh Malusare
committed
Merge branch 'ci' into 'master'
ci: Add base .yml file to setup CI See merge request app-frameworks/esp_hosted!118
2 parents 327c263 + 775f5ab commit cd22e98

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.gitlab-ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
stages:
2+
- deploy
3+
4+
variables:
5+
GIT_SUBMODULE_STRATEGY: recursive
6+
7+
before_script:
8+
# add gitlab ssh key
9+
- mkdir -p ~/.ssh
10+
- chmod 700 ~/.ssh
11+
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
12+
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
13+
- chmod 600 ~/.ssh/id_rsa
14+
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
15+
16+
deploy_test_github:
17+
stage: deploy
18+
image: $CI_DOCKER_REGISTRY/esp32-ci-env
19+
tags:
20+
- deploy
21+
when: manual
22+
only:
23+
- master
24+
variables:
25+
TEST_BRANCH: "test"
26+
script:
27+
- mkdir -p ~/.ssh
28+
- chmod 700 ~/.ssh
29+
- echo -n $GH_KEY > ~/.ssh/id_rsa_base64
30+
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
31+
- chmod 600 ~/.ssh/id_rsa
32+
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
33+
- git remote remove github &>/dev/null || true
34+
- git remote add github [email protected]:espressif/esp-hosted.git
35+
# Using test branch
36+
- git branch ${TEST_BRANCH}
37+
- git push github "${CI_COMMIT_SHA}:refs/heads/${TEST_BRANCH}"
38+
39+
.deploy_master_github:
40+
stage: deploy
41+
image: $CI_DOCKER_REGISTRY/esp32-ci-env
42+
tags:
43+
- deploy
44+
when: manual
45+
only:
46+
- master
47+
variables:
48+
MASTER_BRANCH: $CI_COMMIT_REF_NAME
49+
script:
50+
- mkdir -p ~/.ssh
51+
- chmod 700 ~/.ssh
52+
- echo -n $GH_KEY > ~/.ssh/id_rsa_base64
53+
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
54+
- chmod 600 ~/.ssh/id_rsa
55+
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
56+
- git remote remove github &>/dev/null || true
57+
- git remote add github [email protected]:espressif/esp-hosted.git
58+
# Using master branch
59+
#- git push github "${CI_COMMIT_SHA}:refs/heads/${MASTER_BRANCH}"

0 commit comments

Comments
 (0)