From 939756073407f08007c13a25647e0f9a1934f844 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 10 Sep 2021 16:04:46 +0700 Subject: [PATCH] improved deployment for testing environment --- .dockerignore | 3 +++ .gitignore | 3 --- deploy.sh | 7 +++++++ tubearchivist/testing.sh | 9 +++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 tubearchivist/testing.sh diff --git a/.dockerignore b/.dockerignore index 596cca4..f635741 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,3 +16,6 @@ venv/ # Unneeded graphics assets/* + +# for local testing only +testing.sh \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1476e95..b59df49 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,3 @@ db.sqlite3 # frontend fonts *ttf.woff - -# for local testing only -testing.sh diff --git a/deploy.sh b/deploy.sh index ad4020b..c10364d 100755 --- a/deploy.sh +++ b/deploy.sh @@ -16,6 +16,8 @@ function sync_blackhole { export PASS=$remote_pw rsync -a --progress --delete-after \ + --exclude ".git" \ + --exclude ".gitignore" \ --exclude "**/cache" \ --exclude "**/__pycache__/" \ --exclude "db.sqlite3" \ @@ -32,6 +34,8 @@ function sync_test { host="tubearchivist.local" rsync -a --progress --delete-after \ + --exclude ".git" \ + --exclude ".gitignore" \ --exclude "**/cache" \ --exclude "**/__pycache__/" \ --exclude "db.sqlite3" \ @@ -42,6 +46,9 @@ function sync_test { ssh "$host" 'docker build -t bbilly1/tubearchivist:latest tubearchivist' ssh "$host" 'docker-compose -f docker/docker-compose.yml up -d' + ssh "$host" 'docker cp tubearchivist/tubearchivist/testing.sh tubearchivist:/app/testing.sh' + ssh "$host" 'docker exec tubearchivist chmod +x /app/testing.sh' + } diff --git a/tubearchivist/testing.sh b/tubearchivist/testing.sh new file mode 100644 index 0000000..ae20ba1 --- /dev/null +++ b/tubearchivist/testing.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# install debug and testing tools into slim container + +apt update && apt install -y vim htop bmon net-tools iputils-ping procps + +pip install ipython + +## +exit 0