From 02f1790ce40c688b58816e2b8f7aa73354917636 Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 11:23:10 +0100 Subject: [PATCH 01/11] update actions and gitlab CI --- .github/workflows/ci_action.yml | 16 ---------------- .github/workflows/ci_trigger.yml | 30 ++++++++++++++++++++++++++++++ .gitlab-ci.yml | 19 +++++++++++++++++-- 3 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci_trigger.yml diff --git a/.github/workflows/ci_action.yml b/.github/workflows/ci_action.yml index 2512232b..584f0737 100644 --- a/.github/workflows/ci_action.yml +++ b/.github/workflows/ci_action.yml @@ -114,19 +114,3 @@ jobs: files: coverage.xml fail_ci_if_error: true verbose: false - - mirror-and-integration-test-on-gitlab: - if: github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Mirror + trigger CI - uses: SvanBoxel/gitlab-mirror-and-ci-action@master - with: - args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" - env: - GITLAB_HOSTNAME: "git.sinergise.com" - GITLAB_USERNAME: "github-action" - GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} - GITLAB_PROJECT_ID: "354" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml new file mode 100644 index 00000000..ea0e9104 --- /dev/null +++ b/.github/workflows/ci_trigger.yml @@ -0,0 +1,30 @@ +name: mirror_and_trigger + +on: + pull_request: + push: + branches: + - "master" + - "develop" + workflow_call: + release: + types: + - published + +jobs: + mirror-and-integration-test-on-gitlab: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Mirror + trigger CI + uses: SvanBoxel/gitlab-mirror-and-ci-action@master + with: + args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" + env: + FOLLOW_TAGS: "true" + GITLAB_HOSTNAME: "git.sinergise.com" + GITLAB_USERNAME: "github-action" + GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + GITLAB_PROJECT_ID: "354" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2107b30a..6e917801 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - update - test + - build update_base_image: stage: update @@ -15,11 +16,25 @@ update_base_image: run_sh_integration_tests: stage: test image: "$BASE_IMAGE" - dependencies: [ ] - needs: [ ] + dependencies: [] + needs: [] rules: - when: always if: '$UPDATE_BASE_IMAGE != "true"' script: - pip install -e .[AWS,DEV] - pytest -m "sh_integration" + +build_docker_image: + stage: build + needs: [] + rules: + - if: $CI_COMMIT_TAG # run only on releases + when: always + variables: + CUSTOM_RUN_TAG: auto # this will create images with the latest tag and the version tag + LAYER_NAME: dotai-eo + - when: manual + trigger: + project: teams/eor/dotai/infra + allow_failure: true From a261b2ed514d53e86dcdcccbd785c654fbb484fa Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 13:01:17 +0100 Subject: [PATCH 02/11] update project path --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e917801..14ce71b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,5 +36,5 @@ build_docker_image: LAYER_NAME: dotai-eo - when: manual trigger: - project: teams/eor/dotai/infra + project: eo/infra/docker allow_failure: true From 4ca8c83c4bd355dcc318f49853101d9960a2204b Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:03:20 +0100 Subject: [PATCH 03/11] use trigger API to build internal docker instead --- .github/workflows/ci_action.yml | 17 ++++++++++++++++ .github/workflows/ci_trigger.yml | 35 +++++++++++--------------------- .gitlab-ci.yml | 15 -------------- 3 files changed, 29 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci_action.yml b/.github/workflows/ci_action.yml index 584f0737..2617d7b8 100644 --- a/.github/workflows/ci_action.yml +++ b/.github/workflows/ci_action.yml @@ -114,3 +114,20 @@ jobs: files: coverage.xml fail_ci_if_error: true verbose: false + + mirror-and-integration-test-on-gitlab: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Mirror + trigger CI + uses: SvanBoxel/gitlab-mirror-and-ci-action@master + with: + args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" + env: + FOLLOW_TAGS: "true" + GITLAB_HOSTNAME: "git.sinergise.com" + GITLAB_USERNAME: "github-action" + GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + GITLAB_PROJECT_ID: "354" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index ea0e9104..5f1afc31 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -1,30 +1,19 @@ -name: mirror_and_trigger +name: trigger on: - pull_request: - push: - branches: - - "master" - - "develop" - workflow_call: release: types: - published jobs: - mirror-and-integration-test-on-gitlab: - if: github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Mirror + trigger CI - uses: SvanBoxel/gitlab-mirror-and-ci-action@master - with: - args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" - env: - FOLLOW_TAGS: "true" - GITLAB_HOSTNAME: "git.sinergise.com" - GITLAB_USERNAME: "github-action" - GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} - GITLAB_PROJECT_ID: "354" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + trigger: + image: alpine + script: + - apk add --no-cache curl + - > + curl -X POST --fail \ + -F token=${{ secrets.GITLAB_PIPELINE_TRIGGER_TOKEN }} \ + -F ref=main \ + -F variables[CUSTOM_RUN_TAG]=auto \ + -F variables[LAYER_NAME]=dotai-eo \ + https://git.sinergise.com/api/v4/projects/1031/trigger/pipeline diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14ce71b2..87226e29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ stages: - update - test - - build update_base_image: stage: update @@ -24,17 +23,3 @@ run_sh_integration_tests: script: - pip install -e .[AWS,DEV] - pytest -m "sh_integration" - -build_docker_image: - stage: build - needs: [] - rules: - - if: $CI_COMMIT_TAG # run only on releases - when: always - variables: - CUSTOM_RUN_TAG: auto # this will create images with the latest tag and the version tag - LAYER_NAME: dotai-eo - - when: manual - trigger: - project: eo/infra/docker - allow_failure: true From c798c04dd29701768c4e938100170588988be497 Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:26:17 +0100 Subject: [PATCH 04/11] test trigger on branch push --- .github/workflows/ci_trigger.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index 5f1afc31..104c81d2 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -1,6 +1,9 @@ name: trigger on: + push: + branches: + - "add-gitlab-trigger-api-job" release: types: - published From 5b4d86ab364d55238d2d00189b6b12df059d604b Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:32:02 +0100 Subject: [PATCH 05/11] fix github action --- .github/workflows/ci_trigger.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index 104c81d2..a7bbb328 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -10,13 +10,15 @@ on: jobs: trigger: - image: alpine - script: - - apk add --no-cache curl - - > - curl -X POST --fail \ - -F token=${{ secrets.GITLAB_PIPELINE_TRIGGER_TOKEN }} \ - -F ref=main \ - -F variables[CUSTOM_RUN_TAG]=auto \ - -F variables[LAYER_NAME]=dotai-eo \ - https://git.sinergise.com/api/v4/projects/1031/trigger/pipeline + runs-on: ubuntu-latest + steps: + - name: Install requirements + run: apt install -y curl + - name: Trigger API + run: > + curl -X POST --fail \ + -F token=${{ secrets.GITLAB_PIPELINE_TRIGGER_TOKEN }} \ + -F ref=main \ + -F variables[CUSTOM_RUN_TAG]=auto \ + -F variables[LAYER_NAME]=dotai-eo \ + https://git.sinergise.com/api/v4/projects/1031/trigger/pipeline From 407a0dd764b66d71d266f80e333c3457606549a6 Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:42:07 +0100 Subject: [PATCH 06/11] test why trigger workflow not starting --- .github/workflows/ci_trigger.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index a7bbb328..577adadd 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -14,6 +14,7 @@ jobs: steps: - name: Install requirements run: apt install -y curl + - name: Trigger API run: > curl -X POST --fail \ From cd598be6342c6b2d207bf930b98ea6ae8726975e Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:43:16 +0100 Subject: [PATCH 07/11] fix branch name --- .github/workflows/ci_trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index 577adadd..9363c4de 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -3,7 +3,7 @@ name: trigger on: push: branches: - - "add-gitlab-trigger-api-job" + - "add-docker-image-build-trigger-job" release: types: - published From 6a30e804230de850fa77a580412a3f91b9b2605e Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:44:09 +0100 Subject: [PATCH 08/11] remove step in trigger job --- .github/workflows/ci_trigger.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index 9363c4de..a7366a88 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -12,9 +12,6 @@ jobs: trigger: runs-on: ubuntu-latest steps: - - name: Install requirements - run: apt install -y curl - - name: Trigger API run: > curl -X POST --fail \ From e1e87d26bec1cf48e2f7853e93f14f87981404bb Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:51:27 +0100 Subject: [PATCH 09/11] remove test branch --- .github/workflows/ci_trigger.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci_trigger.yml b/.github/workflows/ci_trigger.yml index a7366a88..5bdd9419 100644 --- a/.github/workflows/ci_trigger.yml +++ b/.github/workflows/ci_trigger.yml @@ -1,9 +1,6 @@ name: trigger on: - push: - branches: - - "add-docker-image-build-trigger-job" release: types: - published From 92b4b04649e9ab820490da32d67d32e740035130 Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:52:11 +0100 Subject: [PATCH 10/11] move mirror to a separate workflow, update pipeline running rules --- .github/workflows/ci_action.yml | 17 ----------------- .github/workflows/ci_mirror.yml | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/ci_mirror.yml diff --git a/.github/workflows/ci_action.yml b/.github/workflows/ci_action.yml index 2617d7b8..584f0737 100644 --- a/.github/workflows/ci_action.yml +++ b/.github/workflows/ci_action.yml @@ -114,20 +114,3 @@ jobs: files: coverage.xml fail_ci_if_error: true verbose: false - - mirror-and-integration-test-on-gitlab: - if: github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Mirror + trigger CI - uses: SvanBoxel/gitlab-mirror-and-ci-action@master - with: - args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" - env: - FOLLOW_TAGS: "true" - GITLAB_HOSTNAME: "git.sinergise.com" - GITLAB_USERNAME: "github-action" - GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} - GITLAB_PROJECT_ID: "354" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_mirror.yml b/.github/workflows/ci_mirror.yml new file mode 100644 index 00000000..1612eda9 --- /dev/null +++ b/.github/workflows/ci_mirror.yml @@ -0,0 +1,25 @@ +name: build + +on: + pull_request: + types: closed + branches: + - "master" + - "develop" + +jobs: + mirror-and-integration-test-on-gitlab: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Mirror + trigger CI + uses: SvanBoxel/gitlab-mirror-and-ci-action@master + with: + args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" + env: + FOLLOW_TAGS: "true" + GITLAB_HOSTNAME: "git.sinergise.com" + GITLAB_USERNAME: "github-action" + GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + GITLAB_PROJECT_ID: "354" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a6a2d0ee6534d4957f58ab341a9002c54ee1b214 Mon Sep 17 00:00:00 2001 From: Matic Lubej Date: Tue, 7 Nov 2023 15:58:40 +0100 Subject: [PATCH 11/11] Revert "move mirror to a separate workflow, update pipeline running rules" This reverts commit 92b4b04649e9ab820490da32d67d32e740035130. --- .github/workflows/ci_action.yml | 17 +++++++++++++++++ .github/workflows/ci_mirror.yml | 25 ------------------------- 2 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/ci_mirror.yml diff --git a/.github/workflows/ci_action.yml b/.github/workflows/ci_action.yml index 584f0737..2617d7b8 100644 --- a/.github/workflows/ci_action.yml +++ b/.github/workflows/ci_action.yml @@ -114,3 +114,20 @@ jobs: files: coverage.xml fail_ci_if_error: true verbose: false + + mirror-and-integration-test-on-gitlab: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Mirror + trigger CI + uses: SvanBoxel/gitlab-mirror-and-ci-action@master + with: + args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" + env: + FOLLOW_TAGS: "true" + GITLAB_HOSTNAME: "git.sinergise.com" + GITLAB_USERNAME: "github-action" + GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + GITLAB_PROJECT_ID: "354" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_mirror.yml b/.github/workflows/ci_mirror.yml deleted file mode 100644 index 1612eda9..00000000 --- a/.github/workflows/ci_mirror.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: build - -on: - pull_request: - types: closed - branches: - - "master" - - "develop" - -jobs: - mirror-and-integration-test-on-gitlab: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Mirror + trigger CI - uses: SvanBoxel/gitlab-mirror-and-ci-action@master - with: - args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/" - env: - FOLLOW_TAGS: "true" - GITLAB_HOSTNAME: "git.sinergise.com" - GITLAB_USERNAME: "github-action" - GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} - GITLAB_PROJECT_ID: "354" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}