From 387c05b56040d34bfcb5d39a5025c51e00a22fd5 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 22 Aug 2016 15:02:22 +0800 Subject: [PATCH 1/2] gitlab-ci: initial version This change adds gitlab CI support. It tests if latest master of esp-idf-template can be built with the commit of ESP-IDF in question. Currently it's a bit lax because both SDK_PATH and IDF_PATH are defined. This change also changes components/esp32/lib submodule to point to Github over HTTPS instead of SSH, because CI server might not have its SSH keys uploaded to Github. --- .gitlab-ci.yml | 11 +++++++++++ .gitmodules | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..fc98c8e40 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,11 @@ +build_template_app: + image: espressif/esp32-ci-env + + variables: + SDK_PATH: "$CI_PROJECT_DIR" + IDF_PATH: "$CI_PROJECT_DIR" + + script: + - git clone https://github.com/espressif/esp-idf-template.git + - cd esp-idf-template + - make all diff --git a/.gitmodules b/.gitmodules index 174c4c70b..bd27e209b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "components/esp32/lib"] path = components/esp32/lib - url = ssh://git@github.com:espressif/esp32-wifi-lib.git + url = https://github.com/espressif/esp32-wifi-lib.git From a8ec1a0824437f2b80960576b415de5d493f0898 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 22 Aug 2016 18:19:08 +0800 Subject: [PATCH 2/2] gitlab-ci: push master to GitHub master on success --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc98c8e40..c7ef559ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,37 @@ +stages: + - build +# - test + - deploy + + build_template_app: + stage: build image: espressif/esp32-ci-env variables: SDK_PATH: "$CI_PROJECT_DIR" IDF_PATH: "$CI_PROJECT_DIR" + GIT_STRATEGY: clone script: - git clone https://github.com/espressif/esp-idf-template.git - cd esp-idf-template - make all + +push_master_to_github: + stage: deploy + only: + - master + when: on_success + image: espressif/esp32-ci-env + variables: + GIT_STRATEGY: clone + script: + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo -n $GH_PUSH_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 add github git@github.com:espressif/esp-idf.git + - git push github HEAD:master