gitea and gitlab sync

This commit is contained in:
waltem01 2022-06-02 12:04:46 +02:00
parent 82847a9695
commit b9ec9f801d
4 changed files with 20 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,3 +1,2 @@
DuckRevamp/*
server/node_modules/*
gitUpdate.sh
server/node_modules/*

4
gitUpdate.sh Normal file
View File

@ -0,0 +1,4 @@
cd /var/www/DancingDuck
git pull gitea master
git push origin master
systemctl restart duckSite.service

4
gitlabSync.sh Normal file
View File

@ -0,0 +1,4 @@
cd /var/www/DancingDuck
git pull origin master
git push gitea master
systemctl restart duckSite.service

View File

@ -42,6 +42,17 @@ app.post('/receiveUpdate', (req, res) => {
});
});
app.post('/gitlabUpdate', (req, res) => {
res.status(200).json({success:true});
let updater = exec(`sh ${__dirname}/../gitlabSync.sh`, (error, stdout, stderr) => {
console.log(stdout);
console.error(stderr);
if (error !== null) {
console.error(`exec error: ${error}`);
}
});
});
function sleep(ms) {
return new Promise(r => {
setTimeout(r, ms);