Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
534d19b2
Commit
534d19b2
authored
3 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[ci] simplify commit sha detection
parent
2d50a481
No related branches found
No related tags found
1 merge request
!2644
Feature/continuous master pipeline status
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
.gitlab-ci/default.yml
+10
-7
10 additions, 7 deletions
.gitlab-ci/default.yml
with
11 additions
and
8 deletions
.gitlab-ci.yml
+
1
−
1
View file @
534d19b2
...
@@ -30,7 +30,7 @@ check-pipeline-status:
...
@@ -30,7 +30,7 @@ check-pipeline-status:
when
:
always
when
:
always
script
:
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" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
> pipeline_status.json
> pipeline_status.json
-
|
-
|
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci/default.yml
+
10
−
7
View file @
534d19b2
...
@@ -21,6 +21,13 @@ select tests:
...
@@ -21,6 +21,13 @@ select tests:
script
:
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
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
if [[ "$TRIGGER_SOURCE" == "merge_request_event" ]]; then
echo "Detecting changes w.r.t to target branch '$MR_TARGET_BRANCH_NAME'"
echo "Detecting changes w.r.t to target branch '$MR_TARGET_BRANCH_NAME'"
python3 bin/testing/getchangedfiles.py --outfile changedfiles.txt \
python3 bin/testing/getchangedfiles.py --outfile changedfiles.txt \
...
@@ -36,19 +43,15 @@ select tests:
...
@@ -36,19 +43,15 @@ select tests:
elif [ -n $TEST_AGAINST_LAST_SUCCESSFUL ]; then
elif [ -n $TEST_AGAINST_LAST_SUCCESSFUL ]; then
echo "Determining sha of the last successful pipeline to test against"
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" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
> pipeline_status.json
> pipeline_status.json
if ! python3 .gitlab-ci/getpipelineinfo.py --status-file pipeline_status.json \
if ! getLastSuccesful pipeline_status.json; then
--look-for latest \
--print-format commit-sha; then
echo "Could not find a successful pipeline, will build/run all tests"
echo "Could not find a successful pipeline, will build/run all tests"
touch affectedtests.json
touch affectedtests.json
else
else
export COMMIT_SHA=$(python3 .gitlab-ci/getpipelineinfo.py --status-file pipeline_status.json \
COMMIT_SHA=$(getLastSuccesful pipeline_status.json)
--look-for latest \
--print-format commit-sha)
echo "Comparing against sha $COMMIT_SHA"
echo "Comparing against sha $COMMIT_SHA"
python3 bin/testing/getchangedfiles.py --outfile changedfiles.txt \
python3 bin/testing/getchangedfiles.py --outfile changedfiles.txt \
--source-tree HEAD \
--source-tree HEAD \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment