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
5bf1363e
Commit
5bf1363e
authored
Jul 09, 2014
by
Sean Edge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding support+tests for annotated tags.
parent
f959bd4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-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
+26
-7
No files found.
README.md
View file @
5bf1363e
...
...
@@ -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 @
5bf1363e
...
...
@@ -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 @
5bf1363e
...
...
@@ -60,14 +60,33 @@ 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
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