start start.sh on githook

This commit is contained in:
Ulf Gebhardt 2022-01-12 09:53:30 +01:00
parent 1d59fc7a4e
commit 59efb3fcf5
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -1,3 +1,6 @@
// eslint-disable-next-line camelcase
import child_process from 'child_process'
import path from 'path'
import CONFIG from '../config'
export const githubWebhook = async (req: any, res: any): Promise<void> => {
@ -15,8 +18,9 @@ export const githubWebhook = async (req: any, res: any): Promise<void> => {
console.log(payload)
if (payload.ref === `refs/heads/${CONFIG.WEBHOOK_GITHUB_BRANCH}`) {
// eslint-disable-next-line no-console
console.log('MATCH!')
child_process.execFile(path.join(__dirname, '../../../deployment/bare_metal/start.sh'), [
CONFIG.WEBHOOK_GITHUB_BRANCH,
])
}
}
}