reorganize src/ for refactor of UCI build
reorganize, refactor and improve testingmaster
parent
496d3cbd68
commit
cbc8afedda
4
build
4
build
|
@ -10,10 +10,10 @@ if [[ $build ]];then
|
|||
if [[ $BUILD_CADDY_CONF ]]; then
|
||||
CONF_DIR=${CONF_DIR:-${PWD}/conf}
|
||||
if [[ -d $CONF_DIR ]]; then
|
||||
mkdir -p ${BUILD_SRC}/init/caddy/conf
|
||||
mkdir -p ${BUILD_SRC}/init/opt/caddy/conf
|
||||
echo adding caddy conf/ directory $CONF_DIR to build
|
||||
ls -la $CONF_DIR
|
||||
/bin/cp -R $CONF_DIR/. ${BUILD_SRC}/init/caddy/conf
|
||||
/bin/cp -R $CONF_DIR/. ${BUILD_SRC}/init/opt/caddy/conf
|
||||
fi
|
||||
fi
|
||||
BUILD_PKGS=${BUILD_PKGS:-${PWD}/caddy.pkgs}
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
source $ENV_DIR/run.env
|
||||
export ENTRYPOINT_CMD=caddy
|
||||
export ENTRYPOINT_CMD_PATH=$BIN_DIR/caddy
|
||||
export BUILD_NAME=caddy
|
||||
[ -f "$ENV_DIR/run.env" ] && source $ENV_DIR/run.env
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
#!/bin/bash
|
||||
# set -e
|
||||
echo -e "********** Caddy Setup and Install ***************"
|
||||
if [[ $(env | grep CADDY_LIB) ]]; then
|
||||
mkdir -p $CADDY_HOME 2> /dev/null
|
||||
if [[ -d caddy/ ]]; then
|
||||
echo "copying caddy/ to $CADDY_HOME"
|
||||
/bin/cp -R -p caddy/. $CADDY_HOME
|
||||
fi
|
||||
pushd $CADDY_HOME || exit 2
|
||||
mkdir -p $CADDY_HOME >/dev/null
|
||||
pushd $CADDY_HOME > /dev/null || exit 2
|
||||
echo making caddy subdirectories $PWD
|
||||
mkdir data conf settings bin 2> /dev/null
|
||||
popd
|
||||
popd > /dev/null || exit 2
|
||||
chown -R 1000:1000 $CADDY_HOME
|
||||
echo -e "------------------"
|
||||
echo $CADDY_HOME
|
||||
|
|
|
@ -40,6 +40,7 @@ case "$1" in
|
|||
conf=Caddyfile
|
||||
fi
|
||||
if [[ -f $conf ]]; then
|
||||
echo checking for any run time packages to add...
|
||||
caddy_add_packages
|
||||
echo running: $CADDY_BIN run --config $conf --adapter caddyfile
|
||||
$CADDY_BIN run --config $conf --adapter caddyfile
|
|
@ -1,3 +1,6 @@
|
|||
# will be sourced when "login" action is run via /etc/profile
|
||||
# set these to customize the "custom" entrypoint command
|
||||
export ENTRYPOINT_CMD=caddy
|
||||
export ENTRYPOINT_CMD_PATH=$BIN_DIR/caddy
|
||||
source $ENV_DIR/caddy.env
|
||||
export VOLUME_DIRS="$XDG_CONFIG_HOME $XDG_DATA_HOME $CADDY_CONF"
|
|
@ -0,0 +1,8 @@
|
|||
ca-certificates
|
||||
libcap
|
||||
mailcap
|
||||
jq
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
echo install packages for alpine caddy
|
||||
apk update; apk upgrade;
|
||||
# note: shadow, bash, bash-completion coreutils are installed by default for alpine
|
||||
apk add --no-cache --no-progress ca-certificates libcap mailcap git jq bash curl
|
||||
|
||||
|
||||
|
11
test/build
11
test/build
|
@ -1 +1,10 @@
|
|||
../build -e test.env $@
|
||||
#!/bin/bash
|
||||
[[ $1 = "-f" ]] && force=force && shift
|
||||
if [[ ! $(udbuild image exists -e test.env) || $force ]] ; then
|
||||
echo $force building image
|
||||
../build -e test.env -a build.env $@
|
||||
echo done building image
|
||||
else
|
||||
echo using existing image, use -f to force rebuild
|
||||
fi
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
UCI_SHELL=true
|
|
@ -1 +1,3 @@
|
|||
source ./build $1
|
||||
[[ $force ]] && shift 1
|
||||
udbuild try -e test.env -m /opt/caddy/conf -h conf caddy $@
|
||||
|
|
|
@ -10,7 +10,7 @@ services:
|
|||
- $CREDENTIALS
|
||||
volumes:
|
||||
- conf:/opt/caddy/conf
|
||||
- opt:/opt
|
||||
# - opt:/opt
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
|
@ -22,8 +22,8 @@ volumes:
|
|||
type: none
|
||||
device: ${PWD}/conf
|
||||
o: bind
|
||||
opt:
|
||||
driver_opts:
|
||||
type: none
|
||||
device: ${PWD}/opt
|
||||
o: bind
|
||||
# opt:
|
||||
# driver_opts:
|
||||
# type: none
|
||||
# device: ${PWD}/opt
|
||||
# o: bind
|
|
@ -0,0 +1,3 @@
|
|||
[[ $1 ]] && opt="-n $1"
|
||||
[[ $1 == "f" ]] && opt="-f"
|
||||
docker-compose logs $opt
|
|
@ -0,0 +1 @@
|
|||
docker-compose down -v
|
|
@ -0,0 +1,5 @@
|
|||
# if no image run ./build first
|
||||
source ./build $1
|
||||
[[ $force ]] && shift 1
|
||||
mkdir -p opt conf
|
||||
docker-compose ${@:-up}
|
|
@ -0,0 +1 @@
|
|||
docker-compose down
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
source .env
|
||||
docker exec -it caddy-testing bash -l
|
|
@ -1 +1,3 @@
|
|||
# if no image run ./build first
|
||||
source ./build $1
|
||||
udbuild try -e test.env -m /opt/caddy/conf -h conf -s list-packages
|
|
@ -1 +0,0 @@
|
|||
udbuild try -e test.env -m /opt/caddy/conf -h conf shell $@
|
|
@ -1,7 +0,0 @@
|
|||
# if no image run ./build first
|
||||
if docker image inspect testing/caddy >/dev/null 2>&1 ;then
|
||||
docker-compose ${@:-up}
|
||||
else
|
||||
./build -e test -t default -p
|
||||
docker-compose ${@:-up}
|
||||
fi
|
Loading…
Reference in New Issue