| Docker Image | Binaries
This project provided some glue code to trigger an SCM refresh in Crucible via GitLab webhooks.
To trigger an SCM refresh in Crucible you need the Crucible project ID. GitLab sends the git url within its webhooks. To be able to leverage GitLab webhooks as a trigger for refreshing Crucible we need to convert between git urls and Crucible project IDs. This tool periodically (with configurable time periods) downloads a project list from Crucible, normalizes the git url (to be able to handle http(s) and ssh urls) and uses that list whenever a GitLab webhook comes in to trigger a refresh.
The app uses the incremental-index
endpoint in Crucible which is the only endpoint which can be accessed via API key for now. For downloading the projects list we need to use real credentials.
Tested with:
- GitLab 10.2.x
- Crucible 4.2.0
You can use GitLab's "System Hooks". There is no special configuration in each GitLab repository needed. All you have to do is to configure a "System Hook" for Push events or Tag push events, point the URL to the GitLab Crucible Brigde (side note: the bridge listens on port 8888) and provide a Secret Token.
Environment Variable | Description | Example |
---|---|---|
CRUCIBLE_API_BASE_URL |
The base url to the REST service endpoint | https://crucible.example.com/cru/rest-service-fecru |
CRUCIBLE_API_KEY |
The API key which is used for triggering a refresh in Crucible. Look at the Crucible documentation on how to generate that. | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
CRUCIBLE_USERNAME |
Username of a Crucible user which can access the project list | username |
CRUCIBLE_PASSWORD |
Password of a Crucible user which can access the project list | password |
CRUCIBLE_PROJECT_REFRESH_INTERVAL |
How often the repository list should be refreshed. (In minutes) | 60 |
CRUCIBLE_PROJECT_LIMIT |
Limit of how many projects should be fetched from Crucible in one request. | 100 |
GITLAB_TOKEN |
A token in the GitLab webhook which will be used for validation in the app. | some_token |
Environment Variable | Description | Example |
---|---|---|
GITLAB_HOSTNAMES |
Space-separated list of host names used by GitLab | example.com example.org altssh.example.com:443 |