gitea and gitlab sync
This commit is contained in:
parent
82847a9695
commit
b9ec9f801d
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
||||||
DuckRevamp/*
|
DuckRevamp/*
|
||||||
server/node_modules/*
|
server/node_modules/*
|
||||||
gitUpdate.sh
|
|
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) {
|
function sleep(ms) {
|
||||||
return new Promise(r => {
|
return new Promise(r => {
|
||||||
setTimeout(r, ms);
|
setTimeout(r, ms);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user