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
534d19b2
Commit
534d19b2
authored
May 28, 2021
by
Dennis Gläser
Browse files
[ci] simplify commit sha detection
parent
2d50a481
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
534d19b2
...
...
@@ -30,7 +30,7 @@ check-pipeline-status:
when
:
always
script
:
-
|
curl --header
--form
"token=$CI_JOB_TOKEN" \
curl --header "token=$CI_JOB_TOKEN" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
> pipeline_status.json
-
|
...
...
.gitlab-ci/default.yml
View file @
534d19b2
...
...
@@ -21,6 +21,13 @@ select tests:
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
|
getLastSuccesful() {
python3 .gitlab-ci/getpipelineinfo.py \
--status-file $1 \
--look-for latest \
--print-format commit-sha
}
if [[ "$TRIGGER_SOURCE" == "merge_request_event" ]]; then
echo "Detecting changes w.r.t to target branch '$MR_TARGET_BRANCH_NAME'"
python3 bin/testing/getchangedfiles.py --outfile changedfiles.txt \
...
...
@@ -36,19 +43,15 @@ select tests:
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" \
curl --header "token=$CI_JOB_TOKEN" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
> pipeline_status.json
if ! python3 .gitlab-ci/getpipelineinfo.py --status-file pipeline_status.json \
--look-for latest \
--print-format commit-sha; then
if ! getLastSuccesful pipeline_status.json; then
echo "Could not find a successful pipeline, will build/run all tests"
touch affectedtests.json
else
export COMMIT_SHA=$(python3 .gitlab-ci/getpipelineinfo.py --status-file pipeline_status.json \
--look-for latest \
--print-format commit-sha)
COMMIT_SHA=$(getLastSuccesful pipeline_status.json)
echo "Comparing against sha $COMMIT_SHA"
python3 bin/testing/getchangedfiles.py --outfile changedfiles.txt \
--source-tree HEAD \
...
...
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