test of post-receive hook

This commit is contained in:
Robert McGovern 2022-01-22 23:34:46 +00:00
parent ad137b6efe
commit 44ae69aa2b
2 changed files with 22 additions and 0 deletions

11
.eslintrc.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: "latest",
},
rules: {},
};

11
post-receive Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/main$ ]];
then
echo "Main ref received. Deploying main branch to production..."
git --work-tree=/srv/http/galshaw.eu --git-dir=/srv/git/galshaw.eu.git checkout -f
else
echo "Ref $ref successfully received. Doing nothing: only the main branch may be deployed on this server."
fi
done