gitea and gitlab sync
This commit is contained in:
parent
82847a9695
commit
b9ec9f801d
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
DuckRevamp/*
|
||||
server/node_modules/*
|
||||
gitUpdate.sh
|
||||
server/node_modules/*
|
4
gitUpdate.sh
Normal file
4
gitUpdate.sh
Normal 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
4
gitlabSync.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
cd /var/www/DancingDuck
|
||||
git pull origin master
|
||||
git push gitea master
|
||||
systemctl restart duckSite.service
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user