From f615aeacd5bf47770e225a6137c9781afe620401 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 7 May 2022 20:22:51 +0700 Subject: [PATCH] add sync_test to build for testing environment --- deploy.sh | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/deploy.sh b/deploy.sh index b505716..dfe4e6c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -23,10 +23,32 @@ function validate { } +function sync_test { + + host="tubearchivist.local" + # make base folder + ssh "$host" "mkdir -p docker" + + # copy project files to build image + rsync -a --progress --delete-after \ + --exclude ".git" \ + --exclude ".gitignore" \ + --exclude "**/cache" \ + --exclude "**/__pycache__/" \ + . -e ssh "$host":tubearchivist-metrics + + ssh "$host" "docker buildx build -t bbilly1/tubearchivist-metrics:latest tubearchivist-metrics --load" + + ssh "$host" 'docker compose -f docker/docker-compose.yml up -d' + +} + if [[ $1 == "validate" ]]; then - validate + validate "$2" +elif [[ $1 == "test" ]]; then + sync_test else - echo "valid options are: validate" + echo "valid options are: validate | test" fi -exit 0 \ No newline at end of file +exit 0