Skip to content
Snippets Groups Projects
Commit 65723c7e authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Switching CI pipeline triggering to the "trigger" keyword.

parent 78b63e73
Branches
Tags
2 merge requests!42Release 0.2.0,!38Use "trigger" keyword for pipeline.
Pipeline #24370 canceled
This commit is part of merge request !38. Comments created here will be created in the context of that merge request.
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
variables: variables:
CPPLIB_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:$CI_COMMIT_REF_NAME CPPLIB_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:$CI_COMMIT_REF_NAME
CPPINTTEST_PIPELINE: https://gitlab.indiscale.com/api/v4/projects/111/trigger/pipeline
CPPINTTEST_BRANCHES: https://gitlab.indiscale.com/api/v4/projects/111/repository/branches CPPINTTEST_BRANCHES: https://gitlab.indiscale.com/api/v4/projects/111/repository/branches
GIT_SUBMODULE_STRATEGY: normal GIT_SUBMODULE_STRATEGY: normal
...@@ -32,6 +31,9 @@ variables: ...@@ -32,6 +31,9 @@ variables:
TRIGGERED_BY_REF: $CI_COMMIT_REF_NAME TRIGGERED_BY_REF: $CI_COMMIT_REF_NAME
TRIGGERED_BY_HASH: $CI_COMMIT_SHORT_SHA TRIGGERED_BY_HASH: $CI_COMMIT_SHORT_SHA
# For storing cross-job values
DOTENV: custom.env
image: $CPPLIB_REGISTRY_IMAGE image: $CPPLIB_REGISTRY_IMAGE
...@@ -91,12 +93,11 @@ test: ...@@ -91,12 +93,11 @@ test:
- cmake --build . -j --target cxxcaosdbcli - cmake --build . -j --target cxxcaosdbcli
# - cmake --build . -j --target ccaosdbcli # Disabled until it compiles again. # - cmake --build . -j --target ccaosdbcli # Disabled until it compiles again.
# trigger the integration tests trigger_prepare:
trigger_inttest: # Calculate the branch name
tags: [ docker ] tags: [ docker ]
stage: deploy stage: deploy
script: script:
## Determine the cppinttest branch... ## Determine the cppinttest branch...
# ... use an f-branch if posible... # ... use an f-branch if posible...
- F_BRANCH=dev - F_BRANCH=dev
...@@ -121,18 +122,35 @@ trigger_inttest: ...@@ -121,18 +122,35 @@ trigger_inttest:
# ... and fall-back to dev # ... and fall-back to dev
- CPPINT_REF=${CPPINT_REF:-dev} - CPPINT_REF=${CPPINT_REF:-dev}
- echo "Triggering caosdb-cppinttest@${CPPINT_REF} (F_BRANCH=$F_BRANCH)" # Write to dotenv
- curl -w "%{stderr}HTTPCODE=%{http_code}" -X POST - echo "CPPINT_REF=${CPPINT_REF}" >> "$DOTENV"
-F token=$CI_JOB_TOKEN - echo "F_BRANCH=${F_BRANCH}" >> "$DOTENV"
-F "variables[TRIGGERED_BY_REPO]=$TRIGGERED_BY_REPO" - cat "$DOTENV"
-F "variables[TRIGGERED_BY_REF]=$TRIGGERED_BY_REF" artifacts:
-F "variables[TRIGGERED_BY_HASH]=$TRIGGERED_BY_HASH" reports:
-F "variables[CPPLIB_REGISTRY_IMAGE]=$CPPLIB_REGISTRY_IMAGE" dotenv: "$DOTENV"
-F "variables[F_BRANCH]=${F_BRANCH}" expire_in: 1 day
-F ref=${CPPINT_REF} $CPPINTTEST_PIPELINE 2>HTTPCODE
# fail if the request failed # trigger the integration tests
- grep -c "HTTPCODE=2" HTTPCODE trigger_inttest:
stage: deploy
needs: [ trigger_prepare ]
inherit:
variables:
# List the variables that shall be inherited, which also means they will override any equally
# named varibles in child pipelines.
- TRIGGERED_BY_REPO
- TRIGGERED_BY_REF
- TRIGGERED_BY_HASH
- CPPLIB_REGISTRY_IMAGE
variables:
# dotenv variables must be set again here.
F_BRANCH: $F_BRANCH
trigger:
project: caosdb/src/caosdb-cppinttest
branch: $CPPINT_REF
strategy: depend
# Build the sphinx documentation and make it ready for deployment by Gitlab Pages # Build the sphinx documentation and make it ready for deployment by Gitlab Pages
# Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages # Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment