Commit 2d50a481 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[ci] pass variable in api trigger

parent 98eb0c97
......@@ -40,6 +40,7 @@ check-pipeline-status:
echo "No successful pipeline found. Triggering new pipeline..."
curl --request POST --form "token=$CI_JOB_TOKEN" \
--form ref=$CI_COMMIT_BRANCH \
--form "variables[CI_TEST_AGAINST_LAST_SUCCESSFUL]=true" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/trigger/pipeline"
else
echo "Found successful pipeline for the current state of the branch. Not testing again."
......@@ -63,6 +64,7 @@ check-pipeline-status:
TRIGGER_SOURCE: $CI_PIPELINE_SOURCE
COMMIT_BRANCH: $CI_COMMIT_BRANCH
MR_TARGET_BRANCH_NAME: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
TEST_AGAINST_LAST_SUCCESSFUL: $CI_TEST_AGAINST_LAST_SUCCESSFUL
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
......
......@@ -34,9 +34,8 @@ select tests:
echo "Skipping test selection, build/test stages will consider all tests!"
touch affectedtests.json
elif [[ "$TRIGGER_SOURCE" == "pipeline" ]]; then
echo "Starting pipeline triggered from another pipeline"
echo "Determining sha with the last successful pipeline to test against"
elif [ -n $TEST_AGAINST_LAST_SUCCESSFUL ]; then
echo "Determining sha of the last successful pipeline to test against"
curl --header --form "token=$CI_JOB_TOKEN" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
> pipeline_status.json
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment