mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-06 01:07:00 +00:00
chore: AAAAAAAAAAAAAAAAAAAAAAAAAAAA
This commit is contained in:
43
deploy.sh
43
deploy.sh
@@ -1,30 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# login ig
|
||||
|
||||
echo $COMMITSTATUS >> $GITHUB_TOKEN
|
||||
|
||||
# something went wrong function
|
||||
|
||||
something_went_wrong () {
|
||||
gh api \
|
||||
--method POST \
|
||||
curl \
|
||||
-X 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'
|
||||
-H "Authorization: Bearer $($COMMITSTATUS)" \
|
||||
https://api.github.com/repos/SrIzan10/vinci/statuses/$(git rev-parse origin/main) \
|
||||
-d '{"state":"failure","description":"The build errored!","context":"deployment/rpi"}'
|
||||
}
|
||||
|
||||
# send a pending request thing
|
||||
|
||||
gh api \
|
||||
--method POST \
|
||||
curl \
|
||||
-X 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'
|
||||
-H "Authorization: Bearer $($COMMITSTATUS)" \
|
||||
https://api.github.com/repos/SrIzan10/vinci/statuses/$(git rev-parse origin/main) \
|
||||
-d '{"state":"pending","description":"Building...","context":"deployment/rpi"}'
|
||||
|
||||
{
|
||||
git pull
|
||||
@@ -37,17 +31,12 @@ gh api \
|
||||
|
||||
docker run -d -t --name vinci -p 7272:7272 --restart unless-stopped srizan10/vinci
|
||||
|
||||
gh api \
|
||||
--method POST \
|
||||
curl \
|
||||
-X 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'
|
||||
-H "Authorization: Bearer $($COMMITSTATUS)" \
|
||||
https://api.github.com/repos/SrIzan10/vinci/statuses/$(git rev-parse origin/main) \
|
||||
-d '{"state":"success","description":"The build errored!","context":"deployment/rpi"}'
|
||||
} || {
|
||||
something_went_wrong()
|
||||
}
|
||||
|
||||
# unset env var
|
||||
|
||||
unset GITHUB_TOKEN
|
||||
}
|
||||
Reference in New Issue
Block a user