BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b205db63
Commit
b205db63
authored
Dec 12, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_shell_commands_in_shell_install' into 'master'
Fix shell commands in shell install Fixes #1610 See merge request !1320
parents
9a3ae331
e5951cf4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
shell.rake
lib/tasks/gitlab/shell.rake
+19
-4
No files found.
lib/tasks/gitlab/shell.rake
View file @
b205db63
...
@@ -17,15 +17,19 @@ namespace :gitlab do
...
@@ -17,15 +17,19 @@ namespace :gitlab do
# Clone if needed
# Clone if needed
unless
File
.
directory?
(
target_dir
)
unless
File
.
directory?
(
target_dir
)
s
h
(
*
%W(git clone
#{
args
.
repo
}
#{
target_dir
}
)
)
s
ystem
(
*
%W(git clone --
#{
args
.
repo
}
#{
target_dir
}
)
)
end
end
# Make sure we're on the right tag
# Make sure we're on the right tag
Dir
.
chdir
(
target_dir
)
do
Dir
.
chdir
(
target_dir
)
do
# First try to checkout without fetching
# First try to checkout without fetching
# to avoid stalling tests if the Internet is down.
# to avoid stalling tests if the Internet is down.
reset
=
"git reset --hard $(git describe
#{
args
.
tag
}
|| git describe origin/
#{
args
.
tag
}
)"
reseted
=
reset_to_commit
(
args
)
sh
"
#{
reset
}
|| git fetch origin &&
#{
reset
}
"
unless
reseted
system
(
*
%W(git fetch origin)
)
reset_to_commit
(
args
)
end
config
=
{
config
=
{
user:
user
,
user:
user
,
...
@@ -54,7 +58,7 @@ namespace :gitlab do
...
@@ -54,7 +58,7 @@ namespace :gitlab do
File
.
open
(
"config.yml"
,
"w+"
)
{
|
f
|
f
.
puts
config
.
to_yaml
}
File
.
open
(
"config.yml"
,
"w+"
)
{
|
f
|
f
.
puts
config
.
to_yaml
}
# Launch installation process
# Launch installation process
s
h
"bin/install"
s
ystem
(
*
%W(bin/install)
)
end
end
# Required for debian packaging with PKGR: Setup .ssh/environment with
# Required for debian packaging with PKGR: Setup .ssh/environment with
...
@@ -118,5 +122,16 @@ namespace :gitlab do
...
@@ -118,5 +122,16 @@ namespace :gitlab do
puts
"Quitting..."
.
red
puts
"Quitting..."
.
red
exit
1
exit
1
end
end
def
reset_to_commit
(
args
)
tag
,
status
=
Gitlab
::
Popen
.
popen
(
%W(git describe --
#{
args
.
tag
}
)
)
unless
status
.
zero?
tag
,
status
=
Gitlab
::
Popen
.
popen
(
%W(git describe -- origin/
#{
args
.
tag
}
)
)
end
tag
=
tag
.
strip
system
(
*
%W(git reset --hard
#{
tag
}
)
)
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