diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-28 01:09:07 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-29 00:45:48 +0300 |
commit | b70d97fbc42d43b60f3b7991af94230fcf1c4f1b (patch) | |
tree | 82d479cd41f87224b80228396a78d405dea01529 /.ci/local | |
parent | further renaming work (diff) | |
download | cgitize-b70d97fbc42d43b60f3b7991af94230fcf1c4f1b.tar.gz cgitize-b70d97fbc42d43b60f3b7991af94230fcf1c4f1b.zip |
.ci: random local repository directory
Diffstat (limited to '.ci/local')
-rwxr-xr-x | .ci/local/test.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/.ci/local/test.sh b/.ci/local/test.sh index 43b9bbb..e7cd2c7 100755 --- a/.ci/local/test.sh +++ b/.ci/local/test.sh @@ -2,18 +2,27 @@ set -o errexit -o nounset -o pipefail -readonly local_repo_path="$HOME/test_repo" +local_repo_path= readonly cgitize_conf_path="$HOME/etc/cgitize/cgitize.conf" readonly my_repos_path="$HOME/etc/cgitize/my_repos.py" readonly output_path="$HOME/var/cgitize/output" +cleanup() { + echo + echo ---------------------------------------------------------------------- + echo Cleaning up + echo ---------------------------------------------------------------------- + + rm -rf -- "$local_repo_path" +} + setup_local_repo() { echo echo ---------------------------------------------------------------------- echo Setting up upstream repository echo ---------------------------------------------------------------------- - mkdir -p -- "$local_repo_path" + local_repo_path="$( mktemp -d )" pushd -- "$local_repo_path" > /dev/null git init @@ -60,7 +69,7 @@ from cgitize.repo import Repo MY_REPOS = ( - Repo('test_repo', clone_url='$HOME/test_repo'), + Repo('test_repo', clone_url='$local_repo_path'), ) EOF } @@ -97,6 +106,7 @@ verify() { } main() { + trap cleanup EXIT setup run verify |