The repository is expected to pass a JSON payload providing the path (or substring) of the repository URL configured in a Bamboo linked repository.
Code Block |
---|
{"path":"protocol://path/to/repo"} |
The plugin will then trigger all active plans using that repository
Be careful when using post-commit script in subversion
...
Tip |
---|
Alternately, you can simply hard-code the top-level URL path on each repository once. (even automated jobs should know the repo name/path at provisioning time) |
Example
Users and bamboo plan are using an endpoint like https://svn.mycompany/team-one-repo/project-path/trunk
But the server's svn process sees the path to the directory on the server, file: ///var/svn-repositories/team-one-repo
Therefore a sample post-commit script to work on all repos would need to update the default argument before POSTing it to the plugin. This assumes a standard config on many servers/repositories. Otherwise simply hard code it (even automated jobs should know the repo name/path at provisioning time)!
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/bash repoPath=$1 # remember this is the FS path as seen by the SVN tool, NOT the FQDN seen by the user. You may need to append to the proper host/protocol #repoPath = "/var/svn-repositories/team-one-repo" $repoContext=${repoPath#/var/svn-repostories} #strips off the front #repoContext = "/team-one-repo" curl -X POST "http://localhost:6990/bamboo/rest/linkedrepositorytrigger/1.0/commit" -d '{"path":"'$repoContext'"}' -H "Content-type: text/json" |
...