Skip to content

Commit d30942e

Browse files
author
Mangesh Malusare
committed
Merge branch 'ci' into 'master'
ci: Update CI yaml file to deploy gitlab master branch to github See merge request app-frameworks/esp_hosted!120
2 parents 1792993 + 48aaa15 commit d30942e

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ before_script:
1313
- chmod 600 ~/.ssh/id_rsa
1414
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
1515

16-
deploy_test_github:
16+
deploy_master_github:
1717
stage: deploy
1818
image: $CI_DOCKER_REGISTRY/esp32-ci-env
1919
tags:
2020
- deploy
2121
when: manual
2222
only:
2323
- master
24-
variables:
25-
TEST_BRANCH: "test"
2624
script:
2725
- mkdir -p ~/.ssh
2826
- chmod 700 ~/.ssh
@@ -32,29 +30,4 @@ deploy_test_github:
3230
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
3331
- git remote remove github &>/dev/null || true
3432
- git remote add github [email protected]:espressif/esp-hosted.git
35-
# Using test branch
36-
- git branch ${TEST_BRANCH} 2>&1 || echo "Branch exists" && git branch -D ${TEST_BRANCH} 2>&1 || echo "Branch deleted" && git branch ${TEST_BRANCH} 2>&1 && echo "Branch created"
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}"
60-
33+
- git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"

0 commit comments

Comments
 (0)