CI: Add check for Gitlab/Github remotes in sync

To avoid merging on Gitlab with Github remote out of sync while we are
moving to Github development.
This commit is contained in:
Euripedes Rocha
2023-06-02 10:55:55 +02:00
parent 5b8a541939
commit 4c2ed1676f

View File

@ -1,5 +1,6 @@
stages: stages:
- build - build
- test
- deploy - deploy
@ -80,6 +81,15 @@ build_and_test_qemu:
- export MQTT_PUBLISH_MSG_len_3=20 MQTT_PUBLISH_MSG_repeat_3=20 - export MQTT_PUBLISH_MSG_len_3=20 MQTT_PUBLISH_MSG_repeat_3=20
- python Runner.py $TEST_PATH -c $MQTT_PATH/ci/publish_connect_mqtt_qemu.yml -e $TEST_PATH/env.yml - python Runner.py $TEST_PATH -c $MQTT_PATH/ci/publish_connect_mqtt_qemu.yml -e $TEST_PATH/env.yml
check_remotes_sync:
stage: test
when: on_success
script:
- *add_gh_key_remote
- git fetch --depth=1 origin master
- git fetch --depth=1 github master
- test "$(git rev-parse origin/master)" == "$(git rev-parse github/master)"
push_master_to_github: push_master_to_github:
stage: deploy stage: deploy
image: ${CI_DOCKER_REGISTRY}/esp32-ci-env image: ${CI_DOCKER_REGISTRY}/esp32-ci-env