diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e036cfc4f..e150587dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -383,9 +383,7 @@ push_to_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-idf.git - # Need separate push commands for tag builds and for branch builds - - "[ -n \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_TAG}" - - "[ -z \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}" + - tools/ci/push_to_github.sh deploy_docs: stage: host_test diff --git a/tools/ci/executable-list.txt b/tools/ci/executable-list.txt index 0cf23a8f7..f34917c4a 100644 --- a/tools/ci/executable-list.txt +++ b/tools/ci/executable-list.txt @@ -19,6 +19,7 @@ tools/ci/checkout_project_ref.py tools/ci/get-full-sources.sh tools/ci/mirror-submodule-update.sh tools/ci/mirror-synchronize.sh +tools/ci/push_to_github.sh tools/ci/test_build_system.sh tools/ci/test_configure_ci_environment.sh tools/esp_app_trace/apptrace_proc.py diff --git a/tools/ci/push_to_github.sh b/tools/ci/push_to_github.sh new file mode 100755 index 000000000..6ea479ad6 --- /dev/null +++ b/tools/ci/push_to_github.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# gitlab-ci script to push current tested revision (tag or branch) to github + +set -ex + +if [ -n "${CI_COMMIT_TAG}" ]; then + # for tags + git push github "${CI_COMMIT_TAG}" +else + # for branches + git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}" +fi +