aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-03-28 01:09:07 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-03-29 00:45:48 +0300
commitb70d97fbc42d43b60f3b7991af94230fcf1c4f1b (patch)
tree82d479cd41f87224b80228396a78d405dea01529
parentfurther renaming work (diff)
downloadcgitize-b70d97fbc42d43b60f3b7991af94230fcf1c4f1b.tar.gz
cgitize-b70d97fbc42d43b60f3b7991af94230fcf1c4f1b.zip
.ci: random local repository directory
-rwxr-xr-x.ci/local/test.sh16
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