Command line: Create new repository(group) / a repository(project) inside an existing repo group in RhodeCode (uses Hg Mercurial) -
i'm looking way create new repository "newrepo" , new project "newproject" in rhodecode using command line way (instead of using rhodecode browser based gui clicks).
rhodecode version 2.2.5 , got repositories/projects (after migrated hg mercurial rhodecode interface). works great migrated projects or if create new repository/project inside existing repository manually using rhodecode gui interface.
now, want create new repository / project using command line cli/api way can automate repository/project creation process (from jenkins).
i searched bit , found have use following link couldn't find easy example on how run it: https://docs.rhodecode.com/rhodecode-enterprise/api/api.html#create-repo
has of tried create new repository in rhodecode using shell script or groovy etc? thanks.
ps: i'm not looking creating new hg/mercurial repository (hg init, hg push / hg pull etc).
automation i'm trying this:
create new repo / project or new repository group repository in it. grant access set of users/groups or create 1 etc. create empty readme / delete_me_anytime file automatically.
once above created, i'll create project structure locally on machine , perform hg push above mentioned newly created repository/project or repositorygroup/repository whatever call it.
hg clone http://e100020@servermerc.hola.company.com:8010/newrepo/newproject
hg add readme # add first file
hg commit -m "initial" # commit message
hg push # push changes back
auto create jenkins build / etc jobs , auto launch first build , done it.
i know how bullet 2, 3 automatically (using template job formats etc, in jenkins , running maven/gradle build build project) 1st bullet i'm trying find, how @ command line?
for bullet 1: found this.
rhodecode-api
the rhodecode api lets connect rhodecode enterprise , carry out management tasks, more information api, see api documentation. pass arguments on comamnd-line use method:option syntax.
example usage:
# run get_repos api call , sample output $ rhodecode-api --instance-name=enterprise-1 create_repo repo_name:brand-new repo_type:hg description:repo-desc { "error": null, "id": 1110, "result": { "msg": "created new repository `brand-new`", "success": true, "task": null } }
your solution using our api helper best. recommend using auth-tokens jenkins api calls, push operations. way have more control on credentials, , auth-tokens can revokable. work in similar way googles application-specific passwords.
Comments
Post a Comment