000ncp: Install templates during docker startup

- docker-build.yml: Fix update-test job

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias K 2023-01-05 02:19:32 +01:00 committed by Tobias Knöppler
parent 731e25e36b
commit 23f698da20
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
5 changed files with 18 additions and 5 deletions

View File

@ -130,7 +130,7 @@ jobs:
RUN echo 'Mutex posixsem' >> /etc/apache2/mods-available/ssl.conf
EOF
docker buildx build --platform "$platform" -t ncp-testing -f Dockerfile -o type=image,name=ncp-testing .
docker buildx build --platform "$platform" -t ncp-testing -f Dockerfile --load .
popd
rm -r "$tmpdir"
docker run --platform "$platform" -v ncdata:/data -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi ncp-testing localhost
@ -201,7 +201,7 @@ jobs:
for attempt in {1..3}
do
echo ":: System Tests (attempt $attempt/3) ::"
python system_tests.py --no-ping --non-interactive || awk "{ print \"${LOG_TEST} \" \$0 }"
python system_tests.py --no-ping --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test (attempt $attempt) failed!"
sleep 12

View File

@ -21,7 +21,13 @@ persistent_cfg /etc/cron.weekly
}
persistent_cfg /usr/local/bin /data/bin
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
install_template "php/90-ncp.ini.sh" "/etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini"
install_template "php/pool.d.www.conf.sh" "/etc/php/${PHPVER}/fpm/pool.d/www.conf"
#install_template "mysql/91-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/91-ncp.cnf"
install_template "ncp-metrics.cfg.sh" "/usr/local/etc/ncp-metrics.cfg"
touch /var/log/ncp.log
tail -f -n0 /data/nextcloud/data/nextcloud.log &
{ tail -f -n0 /data/ncdata/data/nextcloud.log || tail -f -n0 /data/nextcloud/data/nextcloud.log; } &
exit 0

View File

@ -216,6 +216,9 @@ install_template() {
local template="${1?}"
local target="${2?}"
local bkp="$(mktemp)"
echo "Installing template '$template'..."
mkdir -p "$(dirname "$target")"
[[ -f "$target" ]] && cp -a "$target" "$bkp"
{

View File

@ -5,11 +5,15 @@ source /usr/local/etc/library.sh
PHPVER="${PHPVER?ERROR: PHPVER variable unset!}"
if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]]
if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]] && ! is_docker
then
echo "INFO: Restoring template to default settings" >&2
TMP_DIR="/tmp"
elif is_docker
then
DATADIR="$(get_nc_config_value datadirectory || echo '/data/ncdata/data')"
TMP_DIR="$DATADIR/.opcache"
else
TMP_DIR="$(source "${BINDIR}/CONFIG/nc-datadir.sh"; tmpl_opcache_dir)"
fi

View File

@ -5,7 +5,7 @@ source /usr/local/etc/library.sh
PHPVER="${PHPVER?ERROR: PHPVER variable unset!}"
if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]]
if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-limits.sh" ]]
then
echo "INFO: Restoring template to default settings" >&2