mirror of
https://github.com/lancachenet/monolithic
synced 2024-11-24 21:13:02 +00:00
Merge pull request #73 from lancachenet/env_cache_domains_branch
Updated env vars to allow specifying branch
This commit is contained in:
commit
1e15d97551
5 changed files with 36 additions and 4 deletions
|
@ -9,7 +9,8 @@ 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 UPSTREAM_DNS 8.8.8.8 8.8.4.4
|
||||
ENV NGINX_WORKER_PROCESSES auto
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
9
overlay/hooks/entrypoint-pre.d/00_deprecation.sh
Normal file
9
overlay/hooks/entrypoint-pre.d/00_deprecation.sh
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
22
run-tests.sh
22
run-tests.sh
|
@ -8,6 +8,8 @@ if [ $? -ne 0 ]; then
|
|||
exit $?
|
||||
fi
|
||||
|
||||
GOSS_WAIT_OPS="-r 60s -s 1s"
|
||||
|
||||
docker build --tag lancachenet/monolithic:goss-test .
|
||||
case $1 in
|
||||
circleci)
|
||||
|
@ -26,6 +28,26 @@ case $1 in
|
|||
#remove invalid system-err outputs from junit output so circleci can read it
|
||||
sed -i '/<system-err>.*<\/system-err>/d' reports/goss/report.xml
|
||||
;;
|
||||
docker)
|
||||
shift;
|
||||
if [[ "$1" == "keepimage" ]]; then
|
||||
KEEPIMAGE=true
|
||||
shift
|
||||
fi
|
||||
docker run --name monolithic-goss-test $@ lancachenet/monolithic:goss-test
|
||||
docker stop monolithic-goss-test
|
||||
docker rm monolithic-goss-test
|
||||
RESULT=$?
|
||||
;;
|
||||
edit)
|
||||
shift;
|
||||
if [[ "$1" == "keepimage" ]]; then
|
||||
KEEPIMAGE=true
|
||||
shift
|
||||
fi
|
||||
dgoss edit $@ lancachenet/monolithic:goss-test
|
||||
RESULT=$?
|
||||
;;
|
||||
*)
|
||||
if [[ "$1" == "keepimage" ]]; then
|
||||
KEEPIMAGE=true
|
||||
|
|
Loading…
Reference in a new issue