File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ COPY config/* /root/config/
1010
1111RUN if [ ! -f /.dockerenv ]; then touch /.dockerenv; fi && \
1212 cd /root/setup && \
13- ./install_packages.sh && \
13+ ./install_packages.sh -u && \
1414 ./create_user.sh && \
1515 ./setup_perl.sh && \
1616 ./setup_apache.sh && \
Original file line number Diff line number Diff line change 77echo " Creating user account..."
88
99USERNAME=" ${1:- docker} "
10+ USER_ID=2000
11+ USER_GID=2000
1012
1113# adduser is not preinstalled on noble
1214DEBIAN_FRONTEND=noninteractive apt-get install -y \
@@ -18,8 +20,8 @@ if [ -d /home/ubuntu ]; then
1820 rm -rf ubuntu
1921fi
2022
21- addgroup --gid 2000 " ${USERNAME} "
22- adduser --system --uid=2000 --gid=2000 --home " /home/${USERNAME} " --shell /bin/bash " ${USERNAME} "
23+ addgroup --gid " ${USER_GID} " " ${USERNAME} "
24+ adduser --system --uid=" ${USER_ID} " --gid=" ${USER_GID} " --home " /home/${USERNAME} " --shell /bin/bash " ${USERNAME} "
2325adduser " ${USERNAME} " " ${USERNAME} "
2426
2527mkdir -p " /home/${USERNAME} /.ssh"
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # Has to be run as admin
3+ # Has to be run as root
44
55set -e
66
77echo " Installing base software packages..."
88
9- # @todo make updating of preinstalled sw optional, so that f.e. we can have faster builds as part of CI
9+ UPDATE_INSTALLED=false
1010
1111export DEBIAN_FRONTEND=noninteractive
1212
13+ while getopts " :u" opt
14+ do
15+ case $opt in
16+ u)
17+ UPDATE_INSTALLED=true
18+ ;;
19+ \? )
20+ echo " Invalid option: -$OPTARG " >&2
21+ exit 1
22+ ;;
23+ esac
24+ done
25+
1326if [ ! -d /usr/share/man/man1 ]; then mkdir -p /usr/share/man/man1; fi
1427
1528apt-get update
1629
17- apt-get upgrade -y
30+ if [ " $UPDATE_INSTALLED " = true ]; then
31+ apt-get upgrade -y
32+ fi
1833
1934apt-get install -y \
2035 git locales sudo unzip wget
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33# Install and configure apache2
4- # Has to be run as admin
5- # @todo make this work across all ubuntu versions (precise to noble)
4+ # Has to be run as root
5+ # @todo make sure this works across all ubuntu versions (precise to noble)
66
77echo " Installing and configuring Apache2..."
88
@@ -35,11 +35,11 @@ if [ -f /etc/apache2/sites-available/default-ssl.conf ]; then
3535 rm /etc/apache2/sites-available/default-ssl.conf
3636fi
3737
38- # NB: TESTS_ROOT_DIR in /etc/apache2/envvars is reset by entrypoint.sh when running in a local container
39- # @todo avoid adding these lines if they already exist
38+ # @todo avoid adding these lines if they already exist - rewrite them instead
4039if [ -n " ${GITHUB_ACTIONS} " ]; then
4140 echo " export TESTS_ROOT_DIR=$( pwd) " >> /etc/apache2/envvars
4241else
42+ # NB: TESTS_ROOT_DIR in /etc/apache2/envvars is reset by entrypoint.sh when running in a local container
4343 echo " export TESTS_ROOT_DIR=/var/www/html" >> /etc/apache2/envvars
4444fi
4545echo " export HTTPSERVER=localhost" >> /etc/apache2/envvars
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33# Install and configure the 'app'
4- # Has to be run as admin
4+ # Has to be run as root
55
66set -e
77
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ rm composer-setup.php
2929
3030# ##
3131
32- if [ -f /usr/local/bin/composer.phar -a " $RESULT " = 0 ]; then
32+ if [ -f /usr/local/bin/composer.phar ] && [ " $RESULT " = 0 ]; then
3333 mv /usr/local/bin/composer.phar /usr/local/bin/composer && chmod 755 /usr/local/bin/composer
3434fi
3535
Original file line number Diff line number Diff line change 22
33# Installs php modules necessary to test the Perl file in the extras dir
44
5- # Has to be run as admin
5+ # Has to be run as root
66
77# @todo test in the VM env: do we need any ubuntu dev packages ?
88
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # Has to be run as admin
3+ # Has to be run as root
44
55# @todo make it optional to install xdebug. It is fe. missing in sury's ppa for Xenial
66# @todo make it optional to install fpm. It is not needed for the cd workflow
77# @todo make it optional to disable xdebug ?
88# @todo set the list of required php extensions in a variable, allow it to be overridden
9- # @todo allow to force usage of shivammatur/ ondrej repos regardless of php version in use
9+ # @todo allow to force usage of shivammatur or ondrej repos regardless of php version in use
1010
1111set -e
1212
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33# Install and configure privoxy
4- # Has to be run as admin
4+ # Has to be run as root
55
66set -e
77
88echo " Installing privoxy..."
99
1010SCRIPT_DIR=" $( dirname " $( readlink -f " $0 " ) " ) "
1111
12- DEBIAN_FRONTEND=noninteractive apt-get install -y privoxy
12+ export DEBIAN_FRONTEND=noninteractive
13+
14+ apt-get install -y privoxy
1315
1416cp -f " $SCRIPT_DIR /../config/privoxy" /etc/privoxy/config
1517service privoxy restart
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33# @todo rename: this is not based on a vm. Also, the 'ci' folder should really be called 'env' or 'testenv'...
4- # @todo support getting the various settings as cli options as well as via env vars?
4+ # @todo support getting the various settings as cli options as well as via env vars (use getopts)
55
66set -e
77
@@ -317,6 +317,11 @@ case "${ACTION}" in
317317 unlock
318318 ;;
319319
320+ -h)
321+ help
322+ exit 0
323+ ;;
324+
320325 * )
321326 printf " \n\e[31mERROR:\e[0m unknown action '%s'\n\n" " ${ACTION} " >&2
322327 help
You can’t perform that action at this time.
0 commit comments