Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
4d10376f
Commit
4d10376f
authored
13 years ago
by
Aurélien Dunand
Committed by
Seblu
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add copy command
Signed-off-by:
Seblu
<
sebastien.luttringer@smartjog.com
>
parent
1a390558
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/is
+38
-0
38 additions, 0 deletions
bin/is
with
38 additions
and
0 deletions
bin/is
+
38
−
0
View file @
4d10376f
...
...
@@ -238,6 +238,36 @@ def c_clean(parser, args):
'''
raise
NotImplementedError
(
"
Not yet implemented
"
)
def
c_copy
(
parser
,
args
):
'''
Copy an image from a repository to another one
'''
args
.
repo_filter
=
args
.
repo_src
repoman
=
load_repositories
(
args
)
if
len
(
repoman
)
==
0
:
raise
Exception
(
"
No repository selected
"
)
elif
len
(
repoman
)
>
1
:
raise
Exception
(
"
Please select only one repository
"
)
repo_src
=
repoman
[
0
]
args
.
repo_filter
=
args
.
repo_dst
repoman
=
load_repositories
(
args
)
if
len
(
repoman
)
==
0
:
raise
Exception
(
"
No repository selected
"
)
elif
len
(
repoman
)
>
1
:
raise
Exception
(
"
Please select only one repository
"
)
repo_dst
=
repoman
[
0
]
if
args
.
image_version
is
None
:
args
.
image_version
=
repo_src
.
last
(
args
.
image
)
if
args
.
image_version
==
-
1
:
raise
Exception
(
"
Unable to find last version of %s
"
%
args
.
image
)
arrow
(
"
Copying %s v%s from %s to %s
"
%
(
args
.
image
,
args
.
image_version
,
repo_src
.
config
.
name
,
repo_dst
.
config
.
name
))
arrowlevel
(
1
)
pkg
=
repo_src
.
get
(
args
.
image
,
args
.
image_version
)
repo_dst
.
add
(
pkg
)
arrowlevel
(
-
1
)
arrow
(
"
Done
"
)
def
c_help
(
parser
,
args
):
'''
Show help
...
...
@@ -366,6 +396,14 @@ p_get.set_defaults(func=c_get)
p_clean
=
subparsers
.
add_parser
(
"
clean
"
,
help
=
c_clean
.
__doc__
.
lower
())
p_clean
.
set_defaults
(
func
=
c_clean
)
# copy command parser
p_copy
=
subparsers
.
add_parser
(
"
copy
"
,
help
=
c_copy
.
__doc__
.
lower
())
p_copy
.
add_argument
(
"
repo_src
"
,
help
=
"
name of source repository
"
)
p_copy
.
add_argument
(
"
repo_dst
"
,
help
=
"
name of destination repository
"
)
p_copy
.
add_argument
(
"
image
"
,
help
=
"
image name
"
)
p_copy
.
add_argument
(
"
image_version
"
,
nargs
=
"
?
"
,
help
=
"
image version
"
)
p_copy
.
set_defaults
(
func
=
c_copy
)
# help command parser
p_help
=
subparsers
.
add_parser
(
"
help
"
,
help
=
c_help
.
__doc__
.
lower
())
p_help
.
add_argument
(
"
command
"
,
choices
=
subparsers
.
choices
,
nargs
=
"
?
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment