Skip to content

Commit

Permalink
Merge branch 'ci' into 'master'
Browse files Browse the repository at this point in the history
ci: Update CI yaml file to deploy gitlab master branch to github

See merge request app-frameworks/esp_hosted!120
  • Loading branch information
Mangesh Malusare committed Mar 15, 2021
2 parents 1792993 + 48aaa15 commit d30942e
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"

0 comments on commit d30942e

Please sign in to comment.