mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-06 01:07:00 +00:00
40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# something went wrong function
|
|
|
|
something_went_wrong () {
|
|
curl \
|
|
-X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-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
|
|
|
|
curl \
|
|
-X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-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
|
|
|
|
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
|
|
|
|
curl \
|
|
-X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-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() |