Hi,
You can create a “SCM template” in json format and then use it on your projects.
rd projects scm config -p ProjectEXAMPLE -i=import -f=myfile.json
This generates a json file like the following one:
{ "config": { "strictHostKeyChecking": "yes", "gitPasswordPath": "keys/gitpasswd", "format": "xml", "dir": "/home/rundeck/projects/ProjectEXAMPLE/ScmImport", "branch": "master", "url": "http://user@git:8080/git/root/myrepo.git", "filePattern": ".*\\.xml", "useFilePattern": "true", "pathTemplate": "${job.id}.${config.format}", "importUuidBehavior": "preserve", "sshPrivateKeyPath": "", "fetchAutomatically": "true", "pullAutomatically": "true" } }Edit the “dir” path to set a new directory:
{ "config": { "strictHostKeyChecking": "yes", "gitPasswordPath": "keys/gitpasswd", "format": "xml", "dir": "/home/rundeck/projects/NewProject/ScmImport", "branch": "master", "url": "http://user@git:8080/git/root/myrepo.git", "filePattern": ".*\\.xml", "useFilePattern": "true", "pathTemplate": "${job.id}.${config.format}", "importUuidBehavior": "preserve", "sshPrivateKeyPath": "", "fetchAutomatically": "true", "pullAutomatically": "true" } }rd projects scm setup -p NewProject -i=import -f=myfile.json -t=git-import
Of course, you can create an script to automate this.
Hope it helps!