Feat(ktm-booking): Initial commit
Some checks failed
ktm-booking-bot/ktm-booking-bot/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
2022-09-27 02:50:07 +08:00
commit 7cf10b07d4
44 changed files with 4569 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@v1.8.4
# go to backend directory
cd backend
# rebuild swagger docs
swag init --dir cmd/server/ --parseDependency
# build binary
go build git.samuelpua.com/telboon/ktm-train-bot/backend/cmd/server
# go to base directory
cd ..

7
scripts/deploy.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/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="_docker_mnt/_postgres_data" --delete . samuel@athena.gaia:~/ktm-booking-bot || true
ssh -p 777 -o StrictHostKeyChecking=no -i /tmp/ssh-key samuel@athena.gaia "cd /home/samuel/ktm-booking-bot && docker-compose up --build -d"
rm /tmp/ssh-key

9
scripts/dev_postgres_docker.sh Executable file
View File

@@ -0,0 +1,9 @@
docker rm -f dev_postgres
docker run -d \
-v `pwd`/_docker_mnt/_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

15
scripts/test.sh Executable file
View File

@@ -0,0 +1,15 @@
#! /bin/bash
# source .env
set -a
source .env
# go to backend directory
cd backend
# build binary
go test -cover ./...
# go to base directory
cd ..