Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Apr 6, 2024
1 parent bfcfc13 commit 7c57395
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions deploy/npm_server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const express = require('express');
const { spawn } = require('child_process');

const app = express();

app.get('/release/pull', (req, res) => {
const deployProcess = spawn('/bin/bash', ['-c', './script.sh'],
{
cwd: process.cwd(),
stdio: "inherit"
}
);
res.send('Hello World');
});

const server = app.listen(5000, '0.0.0.0', () => {
console.log('Server running');
});
7 changes: 7 additions & 0 deletions deploy/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
for i in {1..10}
do
docker compose pull
# docker-compose config
docker compose up -d
sleep 10
done

0 comments on commit 7c57395

Please sign in to comment.