From eaa59180d3b3d7904cab9daf05ec373bf8a5ca7e Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 12 Jan 2022 20:46:34 +0100 Subject: [PATCH] removed github webhook, its now external --- backend/src/webhook/github.ts | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 backend/src/webhook/github.ts diff --git a/backend/src/webhook/github.ts b/backend/src/webhook/github.ts deleted file mode 100644 index ebebe652c..000000000 --- a/backend/src/webhook/github.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { spawn } from 'child_process' -import path from 'path' -import CONFIG from '../config' - -export const githubWebhook = async (req: any, res: any): Promise => { - // End call as early as possible - res.status(200).end() - - // Handle push events - if (req.headers['x-github-event'] === 'push') { - const payload = req.body - - if (payload.ref === `refs/heads/${CONFIG.WEBHOOK_GITHUB_BRANCH}`) { - // spawn shell and detach process to allow killing of parent process in the update script - const child = spawn( - path.join(__dirname, '../../../deployment/bare_metal/start.sh'), - [CONFIG.WEBHOOK_GITHUB_BRANCH], - { - detached: true, - stdio: ['ignore', 'ignore', 'ignore'], - }, - ) - child.unref() - } - } -}