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
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
nexedi
gitlab-shell
Commits
59bffe6b
Commit
59bffe6b
authored
Jul 15, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #162 from asedge/annotated_tags
Adding support+tests for annotated tags.
parents
f959bd4d
df90f59c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
README.md
README.md
+2
-1
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+6
-1
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+29
-7
No files found.
README.md
View file @
59bffe6b
...
...
@@ -58,9 +58,10 @@ Remove branch
./bin/gitlab-projects rm-branch gitlab/gitlab-ci.git 3-0-stable
Create tag
Create tag
(lightweight & annotated)
./bin/gitlab-projects create-tag gitlab/gitlab-ci.git v3.0.0 3-0-stable
./bin/gitlab-projects create-tag gitlab/gitlab-ci.git v3.0.0 3-0-stable 'annotated message goes here'
Remove tag
...
...
lib/gitlab_projects.rb
View file @
59bffe6b
...
...
@@ -67,7 +67,12 @@ class GitlabProjects
def
create_tag
tag_name
=
ARGV
.
shift
ref
=
ARGV
.
shift
||
"HEAD"
cmd
=
%W(git --git-dir=
#{
full_path
}
tag --
#{
tag_name
}
#{
ref
}
)
cmd
=
%W(git --git-dir=
#{
full_path
}
tag)
if
ARGV
.
size
>
0
msg
=
ARGV
.
shift
cmd
+=
%W(-a -m
#{
msg
}
)
end
cmd
+=
%W(--
#{
tag_name
}
#{
ref
}
)
system
(
*
cmd
)
end
...
...
spec/gitlab_projects_spec.rb
View file @
59bffe6b
...
...
@@ -60,14 +60,36 @@ describe GitlabProjects do
let
(
:gl_projects_create
)
{
build_gitlab_projects
(
'import-project'
,
repo_name
,
'https://github.com/randx/six.git'
)
}
let
(
:gl_projects
)
{
build_gitlab_projects
(
'create-tag'
,
repo_name
,
'test_tag'
,
'master'
)
}
context
"lightweight tag"
do
let
(
:gl_projects
)
{
build_gitlab_projects
(
'create-tag'
,
repo_name
,
'test_tag'
,
'master'
)
}
it
"should create a tag"
do
gl_projects_create
.
exec
gl_projects
.
exec
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
it
"should create a tag"
do
gl_projects_create
.
exec
gl_projects
.
exec
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
context
"annotated tag"
do
msg
=
'some message'
tag_name
=
'test_annotated_tag'
let
(
:gl_projects
)
{
build_gitlab_projects
(
'create-tag'
,
repo_name
,
tag_name
,
'master'
,
msg
)
}
it
"should create an annotated tag"
do
gl_projects_create
.
exec
system
(
*
%W(git --git-dir=
#{
tmp_repo_path
}
config user.name Joe)
)
system
(
*
%W(git --git-dir=
#{
tmp_repo_path
}
config user.email joe@smith.com)
)
gl_projects
.
exec
tag_ref
=
capture_in_tmp_repo
(
%W(git rev-parse
#{
tag_name
}
^{})
)
master_ref
=
capture_in_tmp_repo
(
%W(git rev-parse master)
)
tag_msg
=
capture_in_tmp_repo
(
%W(git tag -l -n1
#{
tag_name
}
)
)
tag_ref
.
should
==
master_ref
tag_msg
.
should
==
tag_name
+
' '
+
msg
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