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
heptapod
heptapod
Commits
59fa0ed1e576
Unverified
Commit
c2efb6b1
authored
Oct 06, 2017
by
Rémy Coutable
Browse files
Fix the ee_compat_check task for forks
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
044024480b29
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/ee_compat_check.rb
View file @
59fa0ed1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Gitlab
# Checks if a set of migrations requires downtime or not.
# Checks if a set of migrations requires downtime or not.
class
EeCompatCheck
class
EeCompatCheck
CE_REPO
=
'https://gitlab.com/gitlab-org/gitlab-ce.git'
.
freeze
DEFAULT_
CE_REPO
=
'https://gitlab.com/gitlab-org/gitlab-ce.git'
.
freeze
EE_REPO
=
'https://gitlab.com/gitlab-org/gitlab-ee.git'
.
freeze
EE_REPO
=
'https://gitlab.com/gitlab-org/gitlab-ee.git'
.
freeze
CHECK_DIR
=
Rails
.
root
.
join
(
'ee_compat_check'
)
CHECK_DIR
=
Rails
.
root
.
join
(
'ee_compat_check'
)
IGNORED_FILES_REGEX
=
/(VERSION|CHANGELOG\.md:\d+)/
.
freeze
IGNORED_FILES_REGEX
=
/(VERSION|CHANGELOG\.md:\d+)/
.
freeze
...
@@ -20,7 +20,7 @@ class EeCompatCheck
...
@@ -20,7 +20,7 @@ class EeCompatCheck
attr_reader
:ee_repo_dir
,
:patches_dir
,
:ce_repo
,
:ce_branch
,
:ee_branch_found
attr_reader
:ee_repo_dir
,
:patches_dir
,
:ce_repo
,
:ce_branch
,
:ee_branch_found
attr_reader
:failed_files
attr_reader
:failed_files
def
initialize
(
branch
:,
ce_repo:
CE_REPO
)
def
initialize
(
branch
:,
ce_repo:
DEFAULT_
CE_REPO
)
@ee_repo_dir
=
CHECK_DIR
.
join
(
'ee-repo'
)
@ee_repo_dir
=
CHECK_DIR
.
join
(
'ee-repo'
)
@patches_dir
=
CHECK_DIR
.
join
(
'patches'
)
@patches_dir
=
CHECK_DIR
.
join
(
'patches'
)
@ce_branch
=
branch
@ce_branch
=
branch
...
@@ -132,7 +132,7 @@ def ee_branch_compat_check!
...
@@ -132,7 +132,7 @@ def ee_branch_compat_check!
def
check_patch
(
patch_path
)
def
check_patch
(
patch_path
)
step
(
"Checking out master"
,
%w[git checkout master]
)
step
(
"Checking out master"
,
%w[git checkout master]
)
step
(
"Resetting to latest master"
,
%w[git reset --hard origin/master]
)
step
(
"Resetting to latest master"
,
%w[git reset --hard origin/master]
)
step
(
"Fetching CE/
#{
ce_branch
}
"
,
%W[git fetch
#{
CE_REPO
}
#{
ce_branch
}
]
)
step
(
"Fetching CE/
#{
ce_branch
}
"
,
%W[git fetch
#{
ce_repo
}
#{
ce_branch
}
]
)
step
(
step
(
"Checking if
#{
patch_path
}
applies cleanly to EE/master"
,
"Checking if
#{
patch_path
}
applies cleanly to EE/master"
,
# Don't use --check here because it can result in a 0-exit status even
# Don't use --check here because it can result in a 0-exit status even
...
...
lib/tasks/gitlab/dev.rake
View file @
59fa0ed1
...
@@ -4,7 +4,10 @@ namespace :gitlab do
...
@@ -4,7 +4,10 @@ namespace :gitlab do
task
:ee_compat_check
,
[
:branch
]
=>
:environment
do
|
_
,
args
|
task
:ee_compat_check
,
[
:branch
]
=>
:environment
do
|
_
,
args
|
opts
=
opts
=
if
ENV
[
'CI'
]
if
ENV
[
'CI'
]
{
branch:
ENV
[
'CI_COMMIT_REF_NAME'
]
}
{
ce_repo:
ENV
[
'CI_REPOSITORY_URL'
],
branch:
ENV
[
'CI_COMMIT_REF_NAME'
]
}
else
else
unless
args
[
:branch
]
unless
args
[
:branch
]
puts
"Must specify a branch as an argument"
.
color
(
:red
)
puts
"Must specify a branch as an argument"
.
color
(
:red
)
...
...
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