ef-labs / stash-hook-mirror

An Atlassian Stash repository hook for mirroring to one or more remote git repositories.
MIT License
77 stars 58 forks source link

Configure via REST-API #82

Closed DenisBY closed 4 years ago

DenisBY commented 4 years ago

Is it possible to configure this plugin using REST-API? Actually I want to use terraform bitbucket plugin and I found only 'hook' value (com.englishtown.stash-hook-mirror:mirror-repository-hook) but I don't have any idea how to provide 'Mirror Repo URL', 'Username' and 'Password' as 'settings' map. Please help

DenisBY commented 4 years ago

Found it here: https://github.com/ef-labs/stash-hook-mirror/blob/master/src/main/java/com/englishtown/bitbucket/hook/MirrorSettings.java

Just in case someone interested. Full resource is:

resource "bitbucketserver_repository_hook" "repository_hook" {
  project    = var.project
  repository = var.repository
  hook       = "com.englishtown.stash-hook-mirror:mirror-repository-hook"
  settings = {
    mirrorRepoUrl = "https://git-codecommit.eu-central-1.amazonaws.com/v1/repos/${var.repository}"
    username      = var.username
    password      = var.password
    tags          = true
    notes         = true
    atomic        = true
  }
}