Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
72421e8e
Commit
72421e8e
authored
Jul 14, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new job running danger as local to test it
parent
d1d85326
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
.gitlab/ci/review.gitlab-ci.yml
.gitlab/ci/review.gitlab-ci.yml
+8
-4
.gitlab/ci/rules.gitlab-ci.yml
.gitlab/ci/rules.gitlab-ci.yml
+11
-0
scripts/utils.sh
scripts/utils.sh
+7
-0
No files found.
.gitlab/ci/review.gitlab-ci.yml
View file @
72421e8e
...
@@ -247,10 +247,14 @@ danger-review:
...
@@ -247,10 +247,14 @@ danger-review:
script
:
script
:
-
>
-
>
if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then
if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then
# Force danger to skip CI source GitLab and fallback to "local only git repo".
run_timed_command danger_as_local
unset GITLAB_CI
# We need to base SHA to help danger determine the base commit for this shallow clone.
run_timed_command "bundle exec danger dry_run --fail-on-errors=true --verbose --base='$CI_MERGE_REQUEST_DIFF_BASE_SHA'"
else
else
run_timed_command "bundle exec danger --fail-on-errors=true --verbose"
run_timed_command "bundle exec danger --fail-on-errors=true --verbose"
fi
fi
danger-review-local
:
extends
:
-
danger-review
-
.review:rules:danger-local
script
:
-
run_timed_command danger_as_local
.gitlab/ci/rules.gitlab-ci.yml
View file @
72421e8e
...
@@ -330,6 +330,12 @@
...
@@ -330,6 +330,12 @@
-
"
.dockerignore"
-
"
.dockerignore"
-
"
qa/**/*"
-
"
qa/**/*"
.code-backstage-danger-patterns
:
&code-backstage-danger-patterns
# Backstage changes
-
"
Dangerfile"
-
"
danger/**/*"
-
"
tooling/danger/**/*"
################
################
# Shared rules #
# Shared rules #
################
################
...
@@ -1284,6 +1290,11 @@
...
@@ -1284,6 +1290,11 @@
rules
:
rules
:
-
if
:
'
$CI_MERGE_REQUEST_IID'
-
if
:
'
$CI_MERGE_REQUEST_IID'
.review:rules:danger-local:
rules
:
-
if
:
'
$CI_MERGE_REQUEST_IID'
changes
:
*code-backstage-danger-patterns
###############
###############
# Setup rules #
# Setup rules #
###############
###############
...
...
scripts/utils.sh
View file @
72421e8e
...
@@ -134,3 +134,10 @@ function fail_pipeline_early() {
...
@@ -134,3 +134,10 @@ function fail_pipeline_early() {
scripts/api/cancel_pipeline.rb
scripts/api/cancel_pipeline.rb
fi
fi
}
}
function
danger_as_local
()
{
# Force danger to skip CI source GitLab and fallback to "local only git repo".
unset
GITLAB_CI
# We need to base SHA to help danger determine the base commit for this shallow clone.
bundle
exec
danger dry_run
--fail-on-errors
=
true
--verbose
--base
=
"
${
CI_MERGE_REQUEST_DIFF_BASE_SHA
}
"
}
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