-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update CI yaml file to deploy gitlab master branch to github See merge request app-frameworks/esp_hosted!120
- Loading branch information
Showing
1 changed file
with
2 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,16 +13,14 @@ 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: | ||
- deploy | ||
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 [email protected]: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 [email protected]: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}" |