Skip to content
Snippets Groups Projects
Commit 5bdabe77 authored by jurgenhaas's avatar jurgenhaas
Browse files

Merge branch 'release/v1.17.1'

parents 230e6fad 04d5c83b
No related branches found
No related tags found
No related merge requests found
......@@ -61,3 +61,11 @@ php-7.4:
- docker push ${CI_REGISTRY_IMAGE}/php-7.4:${VERSION}
only:
- tags
php-8.0:
stage: build
script:
- docker build --pull --build-arg PHP_VERSION=8.0 --build-arg VERSION=${VERSION} -t ${CI_REGISTRY_IMAGE}/php-8.0:${VERSION} .
- docker push ${CI_REGISTRY_IMAGE}/php-8.0:${VERSION}
only:
- tags
v1.17.0 2020-12-29
------------------
composer/plugin/docker4drupal#39 Add support for PHP 8.0
docker/l3d#26 Check for correct PHP version when starting the L3D container
docker/l3d#59 Add support for optional .env file in user home directory
v1.16.0 2020-12-28
------------------
docker/l3d#47 Optionally downgrade composer to version 1
......
......@@ -53,7 +53,7 @@ The same test also works with other hosts where your public key is configured as
Go to the project root for which you want to use **L3D** and execute the installed script: simply type `l3d` at the command prompt.
It will ask you for the PHP version (input `7.0`, `7.1`, `7.2`, `7.3` or `7.4`), the project name and template to be used. Then it will download the matching **L3D** image and start a container for you. Furthermore you can choose, if want to use composer 1 for some reason. To downgrade just set the value `1`. The default is the version 2.
It will ask you for the PHP version (input `7.0`, `7.1`, `7.2`, `7.3`, `7.4` or `8.0`), the project name and template to be used. Then it will download the matching **L3D** image and start a container for you. Furthermore you can choose, if want to use composer 1 for some reason. To downgrade just set the value `1`. The default is the version 2.
Inside the container you'll find the directory `/drupal` which contains everything from your project's root. You can work from there by using these available tools:
......
#!/bin/bash
function removecontainer() {
docker container ls --all -q -f name=^${PROJECT}_ > /tmp/reset.lst
IDS=$(cat /tmp/reset.lst)
if [[ ! -n ${IDS} ]]; then
echo "No containers to be removed."
return
fi
echo "Deleting containers ..."
for CONTAINERID in `cat /tmp/reset.lst`; do
docker rm -f $CONTAINERID
done
rm /tmp/reset.lst
}
function removenetwork() {
ID=$(docker network ls -q -f name=traefik_${PROJECT})
if [[ ! -n ${ID} ]]; then
echo "No network to be removed."
return
fi
echo "Deleting network ..."
cd ${HOME}/.traefik || return
sed -i -e "/- ${PROJECT}$/d" docker-compose.yml
sed -i -e "/^ ${PROJECT}:$/{N;d;}" docker-compose.yml
docker-compose stop
docker network rm traefik_${PROJECT}
docker-compose up -d
}
if [[ -n $1 ]]; then
PROJECT=$1
else
echo "Please provide the project name you want to delete."
exit
fi
read -p "Are you sure you want to remove the project ${PROJECT} with all containers and network? Type YES to confirm: " CONFIRM
if [[ "$CONFIRM" == YES ]]; then
removecontainer
removenetwork
fi
......@@ -6,5 +6,5 @@ echo ""
echo "Version: ${VERSION}"
echo "Support: https://gitlab.lakedrops.com/docker/l3d"
echo ""
echo "Usage: l3d [ help | version | selfupdate | update | reset | PROJECTNAME ]"
echo "Usage: l3d [ help | version | selfupdate [VERSION] | update | reset | PROJECTNAME | delete PROJECTNAME ]"
echo ""
......@@ -15,6 +15,8 @@ export PHP_VERSION=7.3
/usr/local/bin/update
export PHP_VERSION=7.4
/usr/local/bin/update
export PHP_VERSION=8.0
/usr/local/bin/update
echo "Cleaning old container"
docker kill l3drun >/dev/null
......@@ -10,6 +10,7 @@ function getConfig {
7.2 ) break;;
7.3 ) break;;
7.4 ) break;;
8.0 ) break;;
* ) echo "Version not supported.";;
esac
done
......
......@@ -46,6 +46,9 @@ elif [[ -n ${SHELL} ]]; then
else
L3DSHELL="/usr/bin/fish"
fi
if [[ -f "${HOME}/.env" ]]; then
export $(cat ${HOME}/.env | xargs) > /dev/null 2>&1
fi
if [[ -f ".env" ]]; then
export $(cat .env | xargs) > /dev/null 2>&1
fi
......
......@@ -9,6 +9,11 @@ function permissions {
}
function readEnv {
if [[ -f "${HOME}/.env" ]]; then
# shellcheck disable=SC2046
# shellcheck disable=SC2002
export $(cat ${HOME}/.env | xargs) > /dev/null 2>&1
fi
if [[ -f ".env" ]]; then
# shellcheck disable=SC2046
# shellcheck disable=SC2002
......@@ -184,6 +189,13 @@ function initialSetup {
}
readEnv
# Validate PHP version
INSTALLED_PHP_VERSION=$(php -r "echo(substr(phpversion(),0,3));")
if [[ "$INSTALLED_PHP_VERSION" != "$PHP_VERSION" ]]; then
echo -e "\\033[31m" ============================================= "\\033[0m"
echo -e "\\033[31m" ERROR: PHP $INSTALLED_PHP_VERSION installed but $PHP_VERSION expected !!! "\\033[0m"
echo -e "\\033[31m" ============================================= "\\033[0m"
fi
if [[ "$COMPOSER_DOWNGRADE" == "1" ]]; then
composer self-update --1
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment