From 459f8af361138e3a5db93f22d00993d5da58eb74 Mon Sep 17 00:00:00 2001 From: VibroAxe Date: Sat, 22 Jun 2019 16:41:45 +0100 Subject: [PATCH] Added NOFETCH option to prevent git reset When developing/updating the uklans repo it is helpful to bind mount a local copy for testing. -e NOFETCH=true Resolves #41 --- README.md | 5 +++++ overlay/hooks/entrypoint-pre.d/15_generate_maps.sh | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0307742..dad118e 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,11 @@ If you're a games publisher and you'd like LAN parties, gaming centers and other If you have any questions, please check [our FAQs](faq.md). If this doesn't answer your question, please raise an issue in GitHub. +## How to help out +To build just run `docker build --tag lancachenet/monolithic:testing .`. To test you can run `./run_tests.sh` + +If you want to test a new build with a forked uklans repo/branch you can specify `-e CACHE_DOMAIN_REPO=""` and even `-e NOFETCH=true` if using a locally bind mounted git repo. + ## Thanks - Based on original configs from [ansible-lanparty](https://github.com/ti-mo/ansible-lanparty). diff --git a/overlay/hooks/entrypoint-pre.d/15_generate_maps.sh b/overlay/hooks/entrypoint-pre.d/15_generate_maps.sh index c14d4ed..fea7578 100644 --- a/overlay/hooks/entrypoint-pre.d/15_generate_maps.sh +++ b/overlay/hooks/entrypoint-pre.d/15_generate_maps.sh @@ -7,8 +7,11 @@ export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostCACHE_I if [[ ! -d .git ]]; then git clone ${CACHE_DOMAIN_REPO} . fi -git fetch origin -git reset --hard origin/master + +if [[ "${NOFETCH:-false}" != "true" ]]; then + git fetch origin + git reset --hard origin/master +fi TEMP_PATH=$(mktemp -d) OUTPUTFILE=${TEMP_PATH}/outfile.conf echo "map \$http_host \$cacheidentifier {" >> $OUTPUTFILE