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
6c9d848d
Commit
6c9d848d
authored
Sep 23, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CI detection of GitLab and GitLab FOSS projects
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
89788064
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
11 deletions
+16
-11
.gitlab/ci/global.gitlab-ci.yml
.gitlab/ci/global.gitlab-ci.yml
+1
-0
.gitlab/ci/setup.gitlab-ci.yml
.gitlab/ci/setup.gitlab-ci.yml
+3
-2
lib/gitlab/danger/helper.rb
lib/gitlab/danger/helper.rb
+2
-1
scripts/review_apps/automated_cleanup.rb
scripts/review_apps/automated_cleanup.rb
+2
-1
scripts/trigger-build
scripts/trigger-build
+2
-1
spec/lib/gitlab/danger/helper_spec.rb
spec/lib/gitlab/danger/helper_spec.rb
+6
-6
No files found.
.gitlab/ci/global.gitlab-ci.yml
View file @
6c9d848d
...
...
@@ -126,3 +126,4 @@
only
:
variables
:
-
$CI_PROJECT_NAME == "gitlab"
-
$CI_PROJECT_NAME == "gitlab-ee"
# Support former project name for forks/mirrors
.gitlab/ci/setup.gitlab-ci.yml
View file @
6c9d848d
...
...
@@ -43,5 +43,6 @@ no_ee_check:
-
scripts/no-ee-check
only
:
variables
:
-
$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAME == "gitlab-foss"
-
$CI_SERVER_HOST == "dev.gitlab.org" && $CI_PROJECT_NAME == "gitlabhq"
-
$CI_PROJECT_NAME == "gitlab-foss"
-
$CI_PROJECT_NAME == "gitlab-ce"
# Support former project name for forks/mirrors
-
$CI_PROJECT_NAME == "gitlabhq"
# Support former project name for dev
lib/gitlab/danger/helper.rb
View file @
6c9d848d
...
...
@@ -35,7 +35,8 @@ module Gitlab
end
def
ee?
ENV
[
'CI_PROJECT_NAME'
]
==
'gitlab'
||
File
.
exist?
(
'../../CHANGELOG-EE.md'
)
# Support former project name for `dev` and support local Danger run
%w[gitlab gitlab-ee]
.
include?
(
ENV
[
'CI_PROJECT_NAME'
])
||
Dir
.
exist?
(
'../../ee'
)
end
def
gitlab_helper
...
...
scripts/review_apps/automated_cleanup.rb
View file @
6c9d848d
...
...
@@ -18,7 +18,8 @@ class AutomatedCleanup
].
freeze
def
self
.
ee?
ENV
[
'CI_PROJECT_NAME'
]
==
'gitlab-ee'
||
File
.
exist?
(
'CHANGELOG-EE.md'
)
# Support former project name for `dev`
%w[gitlab gitlab-ee]
.
include?
(
ENV
[
'CI_PROJECT_NAME'
])
end
def
initialize
(
project_path:
ENV
[
'CI_PROJECT_PATH'
],
gitlab_token:
ENV
[
'GITLAB_BOT_REVIEW_APPS_CLEANUP_TOKEN'
])
...
...
scripts/trigger-build
View file @
6c9d848d
...
...
@@ -12,7 +12,8 @@ end
module
Trigger
def
self
.
ee?
ENV
[
'CI_PROJECT_NAME'
]
==
'gitlab-ee'
||
File
.
exist?
(
'CHANGELOG-EE.md'
)
# Support former project name for `dev`
%w[gitlab gitlab-ee]
.
include?
(
ENV
[
'CI_PROJECT_NAME'
])
end
class
Base
...
...
spec/lib/gitlab/danger/helper_spec.rb
View file @
6c9d848d
...
...
@@ -88,28 +88,28 @@ describe Gitlab::Danger::Helper do
it
'returns true if CI_PROJECT_NAME if set to gitlab'
do
stub_env
(
'CI_PROJECT_NAME'
,
'gitlab'
)
expect
(
File
).
not_to
receive
(
:exist?
)
expect
(
Dir
).
not_to
receive
(
:exist?
)
is_expected
.
to
be_truthy
end
it
'delegates to CHANGELOG-EE.md existence if CI_PROJECT_NAME is set to something else'
do
stub_env
(
'CI_PROJECT_NAME'
,
'something else'
)
expect
(
File
).
to
receive
(
:exist?
).
with
(
'../../CHANGELOG-EE.md
'
)
{
true
}
expect
(
Dir
).
to
receive
(
:exist?
).
with
(
'../../ee
'
)
{
true
}
is_expected
.
to
be_truthy
end
it
'returns true if
CHANGELOG-EE.md
exists'
do
it
'returns true if
ee
exists'
do
stub_env
(
'CI_PROJECT_NAME'
,
nil
)
expect
(
File
).
to
receive
(
:exist?
).
with
(
'../../CHANGELOG-EE.md
'
)
{
true
}
expect
(
Dir
).
to
receive
(
:exist?
).
with
(
'../../ee
'
)
{
true
}
is_expected
.
to
be_truthy
end
it
"returns false if
CHANGELOG-EE.md
doesn't exist"
do
it
"returns false if
ee
doesn't exist"
do
stub_env
(
'CI_PROJECT_NAME'
,
nil
)
expect
(
File
).
to
receive
(
:exist?
).
with
(
'../../CHANGELOG-EE.md
'
)
{
false
}
expect
(
Dir
).
to
receive
(
:exist?
).
with
(
'../../ee
'
)
{
false
}
is_expected
.
to
be_falsy
end
...
...
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