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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
73d61d68
Commit
73d61d68
authored
Sep 18, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hooks_migration_skipper' into '7-2-stable'
Hooks migration skipper See merge request !1093
parents
ff1633f4
23659252
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
db/migrate/20140903115954_migrate_to_new_shell.rb.skip
db/migrate/20140903115954_migrate_to_new_shell.rb.skip
+5
-0
lib/tasks/gitlab/migrate/shell_hooks.rake
lib/tasks/gitlab/migrate/shell_hooks.rake
+36
-0
No files found.
db/migrate/20140903115954_migrate_to_new_shell.rb.skip
0 → 100644
View file @
73d61d68
class MigrateToNewShell < ActiveRecord::Migration
def change
# The migration was performed by the rake task
end
end
lib/tasks/gitlab/migrate/shell_hooks.rake
0 → 100644
View file @
73d61d68
namespace
:gitlab
do
namespace
:migrate
do
task
shell_hooks: :environment
do
migration_file
=
Rails
.
root
.
join
(
'db/migrate/20140903115954_migrate_to_new_shell.rb'
)
migration_source_file
=
"
#{
migration_file
}
.skip"
unless
File
.
exists?
(
migration_file
)
begin
FileUtils
.
cp
(
migration_source_file
,
migration_file
)
rescue
=>
ex
warn
"Please make sure
#{
migration_file
}
exists."
warn
"
\n
sudo cp
#{
migration_source_file
}
#{
migration_file
}
\n\n
"
raise
ex
end
end
gitlab_shell_path
=
Gitlab
.
config
.
gitlab_shell
.
path
unless
system
(
"
#{
gitlab_shell_path
}
/bin/create-hooks"
)
abort
'Failed to rewrite gitlab-shell hooks in repositories'
end
hooks_migration_id
=
'20140903115954'
unless
system
(
*
%W(rake db:migrate:up VERSION=
#{
hooks_migration_id
}
)
)
abort
"Failed to run migration
#{
hooks_migration_id
}
"
end
puts
'Repositories updated with new hooks'
begin
FileUtils
.
rm
(
migration_file
)
rescue
warn
"Please remove
#{
migration_file
}
"
warn
"
\n
sudo rm
#{
migration_file
}
\n\n
"
end
end
end
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