This is an extension for Mission Control to use GitHub webhooks, and other features (in the future).
Install the extension in your mission control project.
cd /path/to/mission-control
npm install --save mc-ext-github
Add GITHUB_WEBHOOK_SECRET=a_securely_generated_random_string
(and input a random key which will be used later to configure webhooks)
A quick method for generating an alphanumeric string:
openssl rand -hex 24
Restart Mission Control
cd /path/to/mission-control
mc stop
mc start
-
Go to your repository on GitHub.
-
Click on "Settings".
-
Click on "Webhooks & services"
-
Click on Add Webhook
-
Enter the URL of your Mission Control with the extension webhook endpoint included
http://your-host-name/ext/mc/github/webhooks/execute-pipeline/1234
. Replace1234
with your pipeline configuration id to trigger. (Note: It is highly recommended to use HTTPS.) -
Enter the
GITHUB_WEBHOOK_SECRET
from your .env file. -
Choose "Let me select individual events".
-
Check the events that you want to trigger a build. You may want to check "push" and "pull request".
-
Click "Add webhook"
You can access properties a github webhook payload with {[ mc.webhook.example ]}
. For example, if you wanted the commit to build for a push event, you might access {[ mc.webhook.after ]}
(which is the sha of the commit).