feat: added better deploy script

This commit is contained in:
2022-10-29 22:23:56 +02:00
parent 7f6f2e866b
commit f964b7790d
2 changed files with 46 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,4 @@
.env
node_modules/
json.sqlite
deploy.sh
dist/

46
deploy.sh Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
something_went_wrong () {
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/SrIzan10/vinci/statuses/$(git rev-parse origin/main) \
-f state='failure' \
-f description='The build just errored!' \
-f context='deployment/rpi'
}
# send a pending request thing
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/SrIzan10/vinci/statuses/$(git rev-parse origin/main) \
-f state='pending' \
-f description='The build succeded!' \
-f context='deployment/rpi'
# do all commands
try
git pull
docker build . -t srizan10/vinci
docker stop vinci
docker rm vinci
docker run -d -t --name vinci -p 7272:7272 --restart unless-stopped srizan10/vinci
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/SrIzan10/vinci/statuses/$(git rev-parse origin/main) \
-f state='pending' \
-f description='The build succeded!' \
-f context='deployment/rpi'
catch
something_went_wrong()
exit 1