Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
2d50a481
Commit
2d50a481
authored
May 28, 2021
by
Dennis Gläser
Browse files
[ci] pass variable in api trigger
parent
98eb0c97
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
2d50a481
...
...
@@ -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
...
...
.gitlab-ci/default.yml
View file @
2d50a481
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment