mirror of
https://github.com/cgzirim/seek-tune.git
synced 2025-12-17 08:54:19 +00:00
Merge branch 'main' of github.com:cgzirim/song-recognition
This commit is contained in:
commit
41e10f71ca
6 changed files with 27 additions and 28 deletions
14
appspec.yml
14
appspec.yml
|
|
@ -5,8 +5,14 @@ files:
|
|||
destination: /home/ubuntu/song-recognition
|
||||
hooks:
|
||||
BeforeInstall:
|
||||
- location: scripts/BeforeInstall.sh
|
||||
AfterInstall:
|
||||
- location: scripts/AfterInstall.sh
|
||||
- location: scripts/ApplicationStart.sh
|
||||
- location: scripts/before_install.sh
|
||||
runas: ubuntu
|
||||
AfterInstall:
|
||||
- location: scripts/after_install.sh
|
||||
runas: ubuntu
|
||||
ApplicationStart:
|
||||
- location: scripts/start_server.sh
|
||||
runas: ubuntu
|
||||
ApplicationStop:
|
||||
- location: scripts/stop_server.sh
|
||||
runas: ubuntu
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
start_backend() {
|
||||
cd /home/ubuntu/song-recognition
|
||||
touch back.txt
|
||||
go build -tags netgo -ldflags '-s -w' -o app
|
||||
nohup ./app > backend.log 2>&1 &
|
||||
}
|
||||
|
||||
start_client() {
|
||||
cd /home/ubuntu/song-recognition/client
|
||||
touch client.txt
|
||||
|
||||
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
nvm install 16
|
||||
nvm use 16
|
||||
npm install
|
||||
npm run build
|
||||
nohup serve -s build > client.log 2>&1 &
|
||||
}
|
||||
|
||||
start_backend && start_client
|
||||
16
scripts/start_server.sh
Normal file
16
scripts/start_server.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
start_server() {
|
||||
cd /home/ubuntu/song-recognition
|
||||
go build -tags netgo -ldflags '-s -w' -o app
|
||||
nohup ./app > backend.log 2>&1 &
|
||||
}
|
||||
|
||||
start_client() {
|
||||
cd /home/ubuntu/song-recognition/client
|
||||
npm install
|
||||
npm run build
|
||||
nohup serve -s build > client.log 2>&1 &
|
||||
}
|
||||
|
||||
start_server
|
||||
1
scripts/stop_server.sh
Normal file
1
scripts/stop_server.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
sudo kill -9 $(sudo lsof -t -i:5000)
|
||||
Loading…
Add table
Reference in a new issue