Updated env vars to allow specifying branch

Also fixed CACHE_DOMAIN_REPO to CACHE_DOMAINS_REPO to align with DNS
better
This commit is contained in:
VibroAxe 2019-12-02 11:04:26 +00:00
parent 4424b30e8c
commit bf361ef18b
4 changed files with 15 additions and 4 deletions

View file

@ -9,7 +9,9 @@ ENV CACHE_MAX_AGE 3560d
ENV UPSTREAM_DNS 8.8.8.8 8.8.4.4
ENV BEAT_TIME 1h
ENV LOGFILE_RETENTION 3560
ENV CACHE_DOMAIN_REPO https://github.com/uklans/cache-domains.git
ENV CACHE_DOMAINS_REPO https://github.com/uklans/cache-domains.git
ENV CACHE_DOMAINS_BRANCH master
ENV BRANCH master
ENV UPSTREAM_DNS 8.8.8.8 8.8.4.4
ENV NGINX_WORKER_PROCESSES auto

View file

@ -164,7 +164,7 @@ If you have any questions, please check [our FAQs](faq.md). If this doesn't answ
## 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.
If you want to test a new build with a forked uklans repo you can specify a combination of `-e CACHE_DOMAINS_REPO="https://github.com/vibroaxe/cache-domains.git" -e CACHE_DOMAINS_BRANCH="testing"` or even `-v <your repo here>:/data/cachedomains -e NOFETCH=true` if using a locally bind mounted git repo.
## Thanks

View file

@ -0,0 +1,9 @@
#!/bin/bash
if [[ -z "${CACHE_DOMAIN_REPO}" ]]; then
echo "ERROR: CACHE_DOMAIN_REPO environment variable has be deprecated in favour of CACHE_DOMAINS_REPO. Please update your config"
exit 1
fi

View file

@ -5,12 +5,12 @@ mkdir -p /data/cachedomains
cd /data/cachedomains
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostCACHE_IDENTIFIERChecking=no"
if [[ ! -d .git ]]; then
git clone ${CACHE_DOMAIN_REPO} .
git clone ${CACHE_DOMAINS_REPO} .
fi
if [[ "${NOFETCH:-false}" != "true" ]]; then
git fetch origin
git reset --hard origin/master
git reset --hard origin/${CACHE_DOMAINS_BRANCH}
fi
TEMP_PATH=$(mktemp -d)
OUTPUTFILE=${TEMP_PATH}/outfile.conf