test deploy
This commit is contained in:
parent
b5c59cbddb
commit
2172cb8bad
16
api/api.service
Normal file
16
api/api.service
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Api
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
User=node
|
||||||
|
Group=node
|
||||||
|
|
||||||
|
WorkingDirectory=/home/node/app
|
||||||
|
ExecStart=/usr/bin/node /home/node/app/dist/index.js
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -4,6 +4,6 @@ import express from 'express';
|
|||||||
const app = express();
|
const app = express();
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.get('/', (req, res) => res.send('coucou\n'));
|
app.get('/', (req, res) => res.send('coucou ?\n'));
|
||||||
|
|
||||||
app.listen(8000, () => console.log('running...'));
|
app.listen(8000, () => console.log('running...'));
|
||||||
|
20
deploy.sh
Executable file
20
deploy.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
useradd node -md /home/node -s /usr/sbin/nologin
|
||||||
|
|
||||||
|
python3 install.py
|
||||||
|
python3 build.py
|
||||||
|
|
||||||
|
rm -r /var/www/html/*
|
||||||
|
mv www/public/* /var/www/html
|
||||||
|
|
||||||
|
mv api/api.service /etc/systemd/system
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable api
|
||||||
|
|
||||||
|
systemctl stop api
|
||||||
|
mkdir /home/node/app
|
||||||
|
rm -r /home/node/app/*
|
||||||
|
mv api/dist /home/node/app
|
||||||
|
mv api/node_modules /home/node/app
|
||||||
|
systemctl start api
|
@ -3,7 +3,7 @@ import App from './App.svelte';
|
|||||||
const app = new App({
|
const app = new App({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
props: {
|
props: {
|
||||||
name: 'tout le monde'
|
name: 'tout tout le monde'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user