Skip to content
代码片段 群组 项目
提交 48aaa15c 编辑于 作者: Shivani Tipnis's avatar Shivani Tipnis
浏览文件

ci: Update CI yaml file to deploy gitlab master branch to github

上级 17929934
No related branches found
No related tags found
无相关合并请求
......@@ -13,7 +13,7 @@ before_script:
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
deploy_test_github:
deploy_master_github:
stage: deploy
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
......@@ -21,8 +21,6 @@ deploy_test_github:
when: manual
only:
- master
variables:
TEST_BRANCH: "test"
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
......@@ -32,29 +30,4 @@ deploy_test_github:
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote remove github &>/dev/null || true
- git remote add github git@github.com:espressif/esp-hosted.git
# Using test branch
- 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"
- git push github "${CI_COMMIT_SHA}:refs/heads/${TEST_BRANCH}"
.deploy_master_github:
stage: deploy
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- deploy
when: manual
only:
- master
variables:
MASTER_BRANCH: $CI_COMMIT_REF_NAME
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_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 git@github.com:espressif/esp-hosted.git
# Using master branch
#- git push github "${CI_COMMIT_SHA}:refs/heads/${MASTER_BRANCH}"
- git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册