A microservice for adding Totem's webhooks to GitHub repositories
Works with the Totem dashboard
git clone [email protected]:totem/configurator.git
cd configurator
npm install
For local development Gulp is required. If it's not already installed, run:
npm install -g gulp
To use OAuth, you can register a new application here. Set the 'Authorization callback URL' to the domain you are hosting this service at with a path of /auth/github/callback
.
Alternatively, you can generate a personal access token here, and use that to authorize the configurator. You must give the token a scope containing write:repo_hook
.
CONFIGURATOR_HOST
: the host that the configurator is deployed toCONFIGURATOR_RUNTIME_CONFIG
: the URL to your runtime config for the configurator from your config serviceTOTEM_SERVICES_CONFIG
: the URL to your totem services config on your config service (https://{{config-service-url}}/providers/s3/groups/{{env}}/configs/totem-services
)
CONFIGURATOR_GITHUB_CLIENT_ID
: the client ID for your registered GitHub appCONFIGURATOR_GITHUB_CLIENT_SECRET
: the client secret for your registered GitHub app
CONFIGURATOR_GITHUB_ACCESS_TOKEN
: the personal access token you generated on GitHub
Set up config service
Your config service should serve something along the lines of the following:
hooks:
- name: 'web'
config:
url: '{{URL to your Image Factory webhook}}'
content_type: 'json'
events:
- push
- name: 'web'
config:
url: '{{URL to your Orchestrator webhook}}'
content_type: 'json'
events:
- delete
gulp
This will serve the app at http://localhost:5000
.
npm start
This will serve the app at port 5000
.
gulp lint
gulp unit
gulp test