2021-04-06 08:28:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Easy deploy script..
|
|
|
|
|
|
|
|
echo 'Fetching latest git commit'
|
2021-12-25 00:30:55 +00:00
|
|
|
cd /var/www/goscrobble-api
|
2021-04-06 08:28:04 +00:00
|
|
|
git pull
|
|
|
|
|
|
|
|
echo 'Building backend'
|
2022-01-05 22:30:15 +00:00
|
|
|
go build -o goscrobble cmd/goscrobble/*.go
|
2021-04-06 08:28:04 +00:00
|
|
|
|
2022-01-05 22:30:15 +00:00
|
|
|
|
|
|
|
echo 'Fetching lastest frontend commit'
|
2021-12-25 00:30:55 +00:00
|
|
|
cd /var/www/goscrobble-web
|
2022-01-05 22:30:15 +00:00
|
|
|
git pull
|
|
|
|
|
2021-04-06 08:28:04 +00:00
|
|
|
echo 'Installing frontend packages'
|
|
|
|
npm install --production
|
|
|
|
|
|
|
|
echo 'Building frontend'
|
|
|
|
npm run build --env production
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
echo 'Restarting Go service'
|
|
|
|
systemctl restart goscrobble.service
|