Skip to content

A simple solution to migrate your docker image repositories from one organization to another.

Notifications You must be signed in to change notification settings

infracloudio/docker-org-migrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 

Repository files navigation

docker-org-migrator

Usage

Using Help Command:

$ ./org-repo-migrator.sh -h

  ./org-repo-migrator.sh [OPTIONS] VALUE

  example (using short-args): 
  ./org-repo-migrator.sh -s=",source-organization" -d="destination-organization" -sr="repo 1 repo 2 ..repo n" -ip="true/false" 

  example (using long-args):
  ./org-repo-migrator.sh -src=",source-organization" -dest="destination-organization" --skip-repos="repo 1 repo 2 ..repo n" --include-private="true/false"


  Options:
  -s, --src               Name of the source organization from where the repository needs to be pulled for migration
  -d, --dest              Name of the destination organization where the repository needs to be migrated
  -sr, --skip-repos       List of repos to include for migration, if none is provided results in inclusion of all the repos
  -ip, --include-private  Include private repos (if true, private and public repos are migrated)

Execution of script:

Fetch token

Export below environment variables to fetch token:

  export DOCKER_USERNAME="<dockerhub-username>"
  export DOCKER_AUTH="<dockerhub-password>"

or

  export DOCKER_AUTH="<dockerhub-access-token>"

Instead of Password, Personal Access Token can also be used for DOCKER_AUTH variable

with short options

./org-repo-migrator.sh -s="" -d="" -sr="" -ip="<true/false>"

$ ./org-repo-migrator.sh -s="<source-org>" -d="<destination-org>" -sr="<repo names to skip>" -ip="<true/false>"

with long options

./org-repo-migrator.sh --src="" --dest="" --skip-repos="" --include-private="<true/false>"

$ ./org-repo-migrator.sh --src="<source-org>" --dest="<destination-org>" --skip-repos="<repo names to skip>" --include-private="false"

Parameters

-s/--src = DockerHub source organization from where the repositories are to be migrated
-d/--dest = DockerHub destination organization where the repositories are migrated
-sr/--skip-repos = List of repo names given in "", to skip for migration
-ip/--include-private = (optional) if set true, private repos will also be migrated along with public repos

Note: -ip/--include-private is an Optional Parameter, if not included defaults to "false", if included and left "" will result in "false"

$ ./org-repo-migrator.sh -s/--src="<source-org"  -d/--dest="<destination-org>" -sr/--skip-repos="<repo names to skip>"  
$ ./org-repo-migrator.sh -s/--src="<source-org"  -d/--dest="<destination-org>" -sr/--skip-repos="<repo names to skip>" -ip/--include-private=""

example:

$ ./org-repo-migrator.sh -s/--src="source-org" -d/--dest="remote-org" --skip-repos="repo 1 repo 2 ..repo n" --include-private="false"

--skip-repos can be skipped to include all the repositories

About

A simple solution to migrate your docker image repositories from one organization to another.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages