Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
c02ec5b6
Commit
c02ec5b6
authored
Mar 11, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'shell_style' into 'master'
Shell Style
parents
79bceae6
73c8ea9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
20 deletions
+24
-20
bin/install
bin/install
+9
-9
hooks/update
hooks/update
+1
-1
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+14
-10
No files found.
bin/install
View file @
c02ec5b6
...
...
@@ -10,18 +10,18 @@ config = GitlabConfig.new
key_dir
=
File
.
dirname
(
"
#{
config
.
auth_file
}
"
)
commands
=
[
"mkdir -p
#{
config
.
repos_path
}
"
,
"mkdir -p
#{
key_dir
}
"
,
"chmod 700
#{
key_dir
}
"
,
"touch
#{
config
.
auth_file
}
"
,
"chmod 600
#{
config
.
auth_file
}
"
,
"chmod -R ug+rwX,o-rwx
#{
config
.
repos_path
}
"
,
"find
#{
config
.
repos_path
}
-type d -print0 | xargs -0 chmod g+s"
%W(mkdir -p
#{
config
.
repos_path
}
)
,
%W(mkdir -p
#{
key_dir
}
)
,
%W(chmod 700
#{
key_dir
}
)
,
%W(touch
#{
config
.
auth_file
}
)
,
%W(chmod 600
#{
config
.
auth_file
}
)
,
%W(chmod -R ug+rwX,o-rwx
#{
config
.
repos_path
}
)
,
%W(find
#{
config
.
repos_path
}
-type d -exec chmod g+s {} ;)
]
commands
.
each
do
|
cmd
|
print
"
#{
cmd
}
: "
if
system
(
cmd
)
print
"
#{
cmd
.
join
(
' '
)
}
: "
if
system
(
*
cmd
)
puts
'OK'
else
puts
'Failed'
...
...
hooks/update
View file @
c02ec5b6
...
...
@@ -6,7 +6,7 @@
refname
=
ARGV
[
0
]
key_id
=
ENV
[
'GL_ID'
]
repo_path
=
`pwd`
repo_path
=
Dir
.
pwd
require_relative
'../lib/gitlab_update'
...
...
spec/gitlab_projects_spec.rb
View file @
c02ec5b6
...
...
@@ -31,8 +31,8 @@ describe GitlabProjects do
it
"should create a branch"
do
gl_projects_create
.
exec
gl_projects
.
exec
branch_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_branch`
.
strip
master_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse master`
.
strip
branch_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_branch)
)
master_ref
=
capture_in_tmp_repo
(
%W(git rev-parse master)
)
branch_ref
.
should
==
master_ref
end
end
...
...
@@ -49,9 +49,9 @@ describe GitlabProjects do
it
"should remove a branch"
do
gl_projects_create
.
exec
gl_projects_create_branch
.
exec
branch_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_branch`
.
strip
branch_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_branch)
)
gl_projects
.
exec
branch_del
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_branch`
.
strip
branch_del
=
capture_in_tmp_repo
(
%W(git rev-parse test_branch)
)
branch_del
.
should_not
==
branch_ref
end
end
...
...
@@ -65,8 +65,8 @@ describe GitlabProjects do
it
"should create a tag"
do
gl_projects_create
.
exec
gl_projects
.
exec
tag_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_tag`
.
strip
master_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse master`
.
strip
tag_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_tag)
)
master_ref
=
capture_in_tmp_repo
(
%W(git rev-parse master)
)
tag_ref
.
should
==
master_ref
end
end
...
...
@@ -83,9 +83,9 @@ describe GitlabProjects do
it
"should remove a branch"
do
gl_projects_create
.
exec
gl_projects_create_tag
.
exec
branch_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_tag`
.
strip
branch_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_tag)
)
gl_projects
.
exec
branch_del
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_tag`
.
strip
branch_del
=
capture_in_tmp_repo
(
%W(git rev-parse test_tag)
)
branch_del
.
should_not
==
branch_ref
end
end
...
...
@@ -179,8 +179,8 @@ describe GitlabProjects do
before
do
FileUtils
.
mkdir_p
(
tmp_repo_path
)
system
(
"git init --bare
#{
tmp_repo_path
}
"
)
system
(
"touch
#{
tmp_repo_path
}
/refs/heads/stable"
)
system
(
*
%W(git init --bare
#{
tmp_repo_path
}
)
)
FileUtils
.
touch
(
File
.
join
(
tmp_repo_path
,
"refs/heads/stable"
)
)
File
.
read
(
File
.
join
(
tmp_repo_path
,
'HEAD'
)).
strip
.
should
==
'ref: refs/heads/master'
end
...
...
@@ -300,4 +300,8 @@ describe GitlabProjects do
def
repo_name
'gitlab-ci.git'
end
def
capture_in_tmp_repo
(
cmd
)
IO
.
popen
(
cmd
,
chdir:
tmp_repo_path
).
read
.
strip
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