Skip to content

microservice that provides easy way for configuring/re-configuring a repository with totem

Notifications You must be signed in to change notification settings

totem/configurator

Repository files navigation

configurator

Build Status

A microservice for adding Totem's webhooks to GitHub repositories

Works with the Totem dashboard

Setup

Clone and install dependencies

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

Register your GitHub application or generate personal access token

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.

Set environment variables

  • CONFIGURATOR_HOST: the host that the configurator is deployed to
  • CONFIGURATOR_RUNTIME_CONFIG: the URL to your runtime config for the configurator from your config service
  • TOTEM_SERVICES_CONFIG: the URL to your totem services config on your config service (https://{{config-service-url}}/providers/s3/groups/{{env}}/configs/totem-services)
OAuth
  • CONFIGURATOR_GITHUB_CLIENT_ID: the client ID for your registered GitHub app
  • CONFIGURATOR_GITHUB_CLIENT_SECRET: the client secret for your registered GitHub app
Personal Access Token
  • CONFIGURATOR_GITHUB_ACCESS_TOKEN: the personal access token you generated on GitHub

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

Runnning

Local development

gulp

This will serve the app at http://localhost:5000.

Production

npm start

This will serve the app at port 5000.

Tests

Linting

gulp lint

Unit tests

gulp unit

Both

gulp test

About

microservice that provides easy way for configuring/re-configuring a repository with totem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published