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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
d6b0ac96
Commit
d6b0ac96
authored
Feb 25, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invoke Kernel#system with separate arguments
parent
b30b9c9c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
26 deletions
+31
-26
lib/gitlab/upgrader.rb
lib/gitlab/upgrader.rb
+13
-9
lib/tasks/gitlab/generate_docs.rake
lib/tasks/gitlab/generate_docs.rake
+1
-1
lib/tasks/gitlab/test.rake
lib/tasks/gitlab/test.rake
+6
-6
lib/tasks/sidekiq.rake
lib/tasks/sidekiq.rake
+4
-4
spec/support/test_env.rb
spec/support/test_env.rb
+7
-6
No files found.
lib/gitlab/upgrader.rb
View file @
d6b0ac96
...
@@ -50,21 +50,25 @@ module Gitlab
...
@@ -50,21 +50,25 @@ module Gitlab
def
update_commands
def
update_commands
{
{
"Stash changed files"
=>
"git stash"
,
"Stash changed files"
=>
%W(git stash)
,
"Get latest code"
=>
"git fetch"
,
"Get latest code"
=>
%W(git fetch)
,
"Switch to new version"
=>
"git checkout v
#{
latest_version
}
"
,
"Switch to new version"
=>
%W(git checkout v
#{
latest_version
}
)
,
"Install gems"
=>
"bundle"
,
"Install gems"
=>
%W(bundle)
,
"Migrate DB"
=>
"bundle exec rake db:migrate RAILS_ENV=production"
,
"Migrate DB"
=>
%W(bundle exec rake db:migrate)
,
"Recompile assets"
=>
"bundle exec rake assets:clean assets:precompile RAILS_ENV=production"
,
"Recompile assets"
=>
%W(bundle exec rake assets:clean assets:precompile)
,
"Clear cache"
=>
"bundle exec rake cache:clear RAILS_ENV=production"
"Clear cache"
=>
%W(bundle exec rake cache:clear)
}
}
end
end
def
env
{
'RAILS_ENV'
=>
'production'
}
end
def
upgrade
def
upgrade
update_commands
.
each
do
|
title
,
cmd
|
update_commands
.
each
do
|
title
,
cmd
|
puts
title
puts
title
puts
" ->
#{
cmd
}
"
puts
" ->
#{
cmd
.
join
(
' '
)
}
"
if
system
(
cmd
)
if
system
(
env
,
*
cmd
)
puts
" -> OK"
puts
" -> OK"
else
else
puts
" -> FAILED"
puts
" -> FAILED"
...
...
lib/tasks/gitlab/generate_docs.rake
View file @
d6b0ac96
namespace
:gitlab
do
namespace
:gitlab
do
desc
"GITLAB | Generate sdocs for project"
desc
"GITLAB | Generate sdocs for project"
task
generate_docs: :environment
do
task
generate_docs: :environment
do
system
(
"bundle exec sdoc -o doc/code app lib"
)
system
(
*
%W(bundle exec sdoc -o doc/code app lib)
)
end
end
end
end
lib/tasks/gitlab/test.rake
View file @
d6b0ac96
...
@@ -2,15 +2,15 @@ namespace :gitlab do
...
@@ -2,15 +2,15 @@ namespace :gitlab do
desc
"GITLAB | Run all tests"
desc
"GITLAB | Run all tests"
task
:test
do
task
:test
do
cmds
=
[
cmds
=
[
"rake db:setup"
,
%W(rake db:setup)
,
"rake db:seed_fu"
,
%W(rake db:seed_fu)
,
"rake spinach"
,
%W(rake spinach)
,
"rake spec"
,
%W(rake spec)
,
"rake jasmine:ci"
%W(rake jasmine:ci)
]
]
cmds
.
each
do
|
cmd
|
cmds
.
each
do
|
cmd
|
system
(
cmd
+
" RAILS_ENV=test"
)
system
(
{
'RAILS_ENV'
=>
'test'
},
*
cmd
)
raise
"
#{
cmd
}
failed!"
unless
$?
.
exitstatus
.
zero?
raise
"
#{
cmd
}
failed!"
unless
$?
.
exitstatus
.
zero?
end
end
...
...
lib/tasks/sidekiq.rake
View file @
d6b0ac96
namespace
:sidekiq
do
namespace
:sidekiq
do
desc
"GITLAB | Stop sidekiq"
desc
"GITLAB | Stop sidekiq"
task
:stop
do
task
:stop
do
system
"script/background_jobs stop"
system
*
%W(script/background_jobs stop)
end
end
desc
"GITLAB | Start sidekiq"
desc
"GITLAB | Start sidekiq"
task
:start
do
task
:start
do
system
"script/background_jobs start"
system
*
%W(script/background_jobs start)
end
end
desc
'GitLab | Restart sidekiq'
desc
'GitLab | Restart sidekiq'
task
:restart
do
task
:restart
do
system
"script/background_jobs restart"
system
*
%W(script/background_jobs restart)
end
end
desc
"GITLAB | Start sidekiq with launchd on Mac OS X"
desc
"GITLAB | Start sidekiq with launchd on Mac OS X"
task
:launchd
do
task
:launchd
do
system
"script/background_jobs start_no_deamonize"
system
*
%W(script/background_jobs start_no_deamonize)
end
end
end
end
spec/support/test_env.rb
View file @
d6b0ac96
...
@@ -104,10 +104,12 @@ module TestEnv
...
@@ -104,10 +104,12 @@ module TestEnv
def
reset_satellite_dir
def
reset_satellite_dir
setup_stubs
setup_stubs
FileUtils
.
cd
(
seed_satellite_path
)
do
[
`git reset --hard --quiet`
%W(git reset --hard --quiet)
,
`git clean -fx`
%W(git clean -fx)
,
`git checkout --quiet origin/master`
%W(git checkout --quiet origin/master)
].
each
do
|
git_cmd
|
system
(
*
git_cmd
,
chdir:
seed_satellite_path
)
end
end
end
end
...
@@ -186,7 +188,6 @@ module TestEnv
...
@@ -186,7 +188,6 @@ module TestEnv
def
create_temp_repo
(
path
)
def
create_temp_repo
(
path
)
FileUtils
.
mkdir_p
path
FileUtils
.
mkdir_p
path
command
=
"git init --quiet --bare
#{
path
}
;"
system
(
*
%W(git init --quiet --bare --
#{
path
}
)
)
system
(
command
)
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