Feat(Initial): Initial Go codebase
All checks were successful
Webhook-Everything/Webhook-Everything/pipeline/head This commit looks good

This commit is contained in:
2022-05-29 00:06:52 +08:00
parent f31bc0cd52
commit 53829a2788
27 changed files with 1489 additions and 0 deletions

16
scripts/build.sh Executable file
View File

@@ -0,0 +1,16 @@
#! /bin/bash
# Install goswag
go install github.com/swaggo/swag/cmd/swag@latest
# go to backend directory
cd backend
# rebuild swagger docs
swag init --dir cmd/server/ --parseDependency
# build binary
go build git.samuelpua.com/telboon/webhook-everything/backend/cmd/server
# go to base directory
cd ..

6
scripts/deploy.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
echo $ATHENA_DEPLOYMENT_SSH_KEY | base64 -d > /tmp/ssh-key
chmod 600 /tmp/ssh-key
rsync -v -e "ssh -o StrictHostKeyChecking=no -i /tmp/ssh-key -p 777" -a --exclude="_postgres_data" --delete . samuel@athena.gaia:~/webhook-everything || true
ssh -p 777 -o StrictHostKeyChecking=no -i /tmp/ssh-key samuel@athena.gaia "cd /home/samuel/webhook-everything && docker-compose up --build -d"

9
scripts/dev_postgres_docker.sh Executable file
View File

@@ -0,0 +1,9 @@
docker rm -f dev_postgres
docker run -d \
-v `pwd`/_postgres_data:/var/lib/postgresql/data \
-e POSTGRES_USER=testuser \
-e POSTGRES_PASSWORD=testpassword \
-e POSTGRES_DB=testdb \
--name dev_postgres \
-p 127.0.0.1:5432:5432 \
postgres:14