From 8f38cbd73608e9409c83660b835b22918c64ce43 Mon Sep 17 00:00:00 2001 From: cytopia Date: Tue, 25 Dec 2018 16:39:34 +0100 Subject: [PATCH 01/16] Add examples for how to install Ms ODBC after accepting the license --- .../01-update-apt-index.sh-example | 6 ++ cfg/php-startup-5.2/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ cfg/php-startup-5.3/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ cfg/php-startup-5.4/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ cfg/php-startup-5.5/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ cfg/php-startup-5.6/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ .../02-ms-odbc-driver.sh-example | 55 +++++++++++++++++++ cfg/php-startup-7.0/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ .../02-ms-odbc-driver.sh-example | 55 +++++++++++++++++++ cfg/php-startup-7.1/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ .../02-ms-odbc-driver.sh-example | 55 +++++++++++++++++++ cfg/php-startup-7.2/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ .../02-ms-odbc-driver.sh-example | 55 +++++++++++++++++++ cfg/php-startup-7.3/README.md | 13 +++++ .../01-update-apt-index.sh-example | 6 ++ cfg/php-startup-7.4/README.md | 13 +++++ 24 files changed, 410 insertions(+) create mode 100755 cfg/php-startup-5.2/01-update-apt-index.sh-example create mode 100644 cfg/php-startup-5.2/README.md create mode 100755 cfg/php-startup-5.3/01-update-apt-index.sh-example create mode 100644 cfg/php-startup-5.3/README.md create mode 100755 cfg/php-startup-5.4/01-update-apt-index.sh-example create mode 100644 cfg/php-startup-5.4/README.md create mode 100755 cfg/php-startup-5.5/01-update-apt-index.sh-example create mode 100644 cfg/php-startup-5.5/README.md create mode 100755 cfg/php-startup-5.6/01-update-apt-index.sh-example create mode 100644 cfg/php-startup-5.6/README.md create mode 100755 cfg/php-startup-7.0/01-update-apt-index.sh-example create mode 100755 cfg/php-startup-7.0/02-ms-odbc-driver.sh-example create mode 100644 cfg/php-startup-7.0/README.md create mode 100755 cfg/php-startup-7.1/01-update-apt-index.sh-example create mode 100755 cfg/php-startup-7.1/02-ms-odbc-driver.sh-example create mode 100644 cfg/php-startup-7.1/README.md create mode 100755 cfg/php-startup-7.2/01-update-apt-index.sh-example create mode 100755 cfg/php-startup-7.2/02-ms-odbc-driver.sh-example create mode 100644 cfg/php-startup-7.2/README.md create mode 100755 cfg/php-startup-7.3/01-update-apt-index.sh-example create mode 100755 cfg/php-startup-7.3/02-ms-odbc-driver.sh-example create mode 100644 cfg/php-startup-7.3/README.md create mode 100755 cfg/php-startup-7.4/01-update-apt-index.sh-example create mode 100644 cfg/php-startup-7.4/README.md diff --git a/cfg/php-startup-5.2/01-update-apt-index.sh-example b/cfg/php-startup-5.2/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-5.2/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-5.2/README.md b/cfg/php-startup-5.2/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-5.2/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-5.3/01-update-apt-index.sh-example b/cfg/php-startup-5.3/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-5.3/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-5.3/README.md b/cfg/php-startup-5.3/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-5.3/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-5.4/01-update-apt-index.sh-example b/cfg/php-startup-5.4/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-5.4/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-5.4/README.md b/cfg/php-startup-5.4/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-5.4/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-5.5/01-update-apt-index.sh-example b/cfg/php-startup-5.5/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-5.5/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-5.5/README.md b/cfg/php-startup-5.5/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-5.5/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-5.6/01-update-apt-index.sh-example b/cfg/php-startup-5.6/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-5.6/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-5.6/README.md b/cfg/php-startup-5.6/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-5.6/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-7.0/01-update-apt-index.sh-example b/cfg/php-startup-7.0/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-7.0/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example new file mode 100755 index 000000000..b0c192e30 --- /dev/null +++ b/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example @@ -0,0 +1,55 @@ +#!/bin/bash +# +# This script will automatically install the Microsoft ODBC driver for MsSQL +# support for PHP during startup. +# +# In order for it to work, you must read and accept their License/EULA: +# https://odbceula.blob.core.windows.net/eula17/LICENSE172.TXT +# + + +# ------------------------------------------------------------------------------------------------ +# EDIT THE VARIABLE BELOW TO ACCEPT THE EULA (If you agree to their terms) +# ------------------------------------------------------------------------------------------------ + +### +### Set this to "Y" (capital 'Y') if you accept the EULA. +### +ACCEPT_EULA=N + + + +# ------------------------------------------------------------------------------------------------ +# DO NOT EDIT BELOW THIS LINE +# ------------------------------------------------------------------------------------------------ + +### +### Where to retrieve the deb package +### +MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17/" + + +### +### Pre-flight check +### +if [ "${ACCEPT_EULA}" != "Y" ]; then + echo "MS ODBC EULA not accepted. Aborting installation." + exit 0 +fi + + +### +### EULA accepted, so we can proceed +### + +# Extract latest *.deb packate +MSODBC_DEB="$( curl -k -sS "${MSODBC_URL}" | grep -Eo 'msodbcsql[-._0-9]+?_amd64\.deb' | tail -1 )" + +# Download to temporary location +curl -k -sS "${MSODBC_URL}${MSODBC_DEB}" > "/tmp/${MSODBC_DEB}" + +# Install +ACCEPT_EULA="${ACCEPT_EULA}" dpkg -i "/tmp/${MSODBC_DEB}" + +# Remove artifacts +rm -f "/tmp/${MSODBC_DEB}" diff --git a/cfg/php-startup-7.0/README.md b/cfg/php-startup-7.0/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-7.0/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-7.1/01-update-apt-index.sh-example b/cfg/php-startup-7.1/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-7.1/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example new file mode 100755 index 000000000..b0c192e30 --- /dev/null +++ b/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example @@ -0,0 +1,55 @@ +#!/bin/bash +# +# This script will automatically install the Microsoft ODBC driver for MsSQL +# support for PHP during startup. +# +# In order for it to work, you must read and accept their License/EULA: +# https://odbceula.blob.core.windows.net/eula17/LICENSE172.TXT +# + + +# ------------------------------------------------------------------------------------------------ +# EDIT THE VARIABLE BELOW TO ACCEPT THE EULA (If you agree to their terms) +# ------------------------------------------------------------------------------------------------ + +### +### Set this to "Y" (capital 'Y') if you accept the EULA. +### +ACCEPT_EULA=N + + + +# ------------------------------------------------------------------------------------------------ +# DO NOT EDIT BELOW THIS LINE +# ------------------------------------------------------------------------------------------------ + +### +### Where to retrieve the deb package +### +MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17/" + + +### +### Pre-flight check +### +if [ "${ACCEPT_EULA}" != "Y" ]; then + echo "MS ODBC EULA not accepted. Aborting installation." + exit 0 +fi + + +### +### EULA accepted, so we can proceed +### + +# Extract latest *.deb packate +MSODBC_DEB="$( curl -k -sS "${MSODBC_URL}" | grep -Eo 'msodbcsql[-._0-9]+?_amd64\.deb' | tail -1 )" + +# Download to temporary location +curl -k -sS "${MSODBC_URL}${MSODBC_DEB}" > "/tmp/${MSODBC_DEB}" + +# Install +ACCEPT_EULA="${ACCEPT_EULA}" dpkg -i "/tmp/${MSODBC_DEB}" + +# Remove artifacts +rm -f "/tmp/${MSODBC_DEB}" diff --git a/cfg/php-startup-7.1/README.md b/cfg/php-startup-7.1/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-7.1/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-7.2/01-update-apt-index.sh-example b/cfg/php-startup-7.2/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-7.2/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example new file mode 100755 index 000000000..b0c192e30 --- /dev/null +++ b/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example @@ -0,0 +1,55 @@ +#!/bin/bash +# +# This script will automatically install the Microsoft ODBC driver for MsSQL +# support for PHP during startup. +# +# In order for it to work, you must read and accept their License/EULA: +# https://odbceula.blob.core.windows.net/eula17/LICENSE172.TXT +# + + +# ------------------------------------------------------------------------------------------------ +# EDIT THE VARIABLE BELOW TO ACCEPT THE EULA (If you agree to their terms) +# ------------------------------------------------------------------------------------------------ + +### +### Set this to "Y" (capital 'Y') if you accept the EULA. +### +ACCEPT_EULA=N + + + +# ------------------------------------------------------------------------------------------------ +# DO NOT EDIT BELOW THIS LINE +# ------------------------------------------------------------------------------------------------ + +### +### Where to retrieve the deb package +### +MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17/" + + +### +### Pre-flight check +### +if [ "${ACCEPT_EULA}" != "Y" ]; then + echo "MS ODBC EULA not accepted. Aborting installation." + exit 0 +fi + + +### +### EULA accepted, so we can proceed +### + +# Extract latest *.deb packate +MSODBC_DEB="$( curl -k -sS "${MSODBC_URL}" | grep -Eo 'msodbcsql[-._0-9]+?_amd64\.deb' | tail -1 )" + +# Download to temporary location +curl -k -sS "${MSODBC_URL}${MSODBC_DEB}" > "/tmp/${MSODBC_DEB}" + +# Install +ACCEPT_EULA="${ACCEPT_EULA}" dpkg -i "/tmp/${MSODBC_DEB}" + +# Remove artifacts +rm -f "/tmp/${MSODBC_DEB}" diff --git a/cfg/php-startup-7.2/README.md b/cfg/php-startup-7.2/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-7.2/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-7.3/01-update-apt-index.sh-example b/cfg/php-startup-7.3/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-7.3/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example new file mode 100755 index 000000000..b0c192e30 --- /dev/null +++ b/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example @@ -0,0 +1,55 @@ +#!/bin/bash +# +# This script will automatically install the Microsoft ODBC driver for MsSQL +# support for PHP during startup. +# +# In order for it to work, you must read and accept their License/EULA: +# https://odbceula.blob.core.windows.net/eula17/LICENSE172.TXT +# + + +# ------------------------------------------------------------------------------------------------ +# EDIT THE VARIABLE BELOW TO ACCEPT THE EULA (If you agree to their terms) +# ------------------------------------------------------------------------------------------------ + +### +### Set this to "Y" (capital 'Y') if you accept the EULA. +### +ACCEPT_EULA=N + + + +# ------------------------------------------------------------------------------------------------ +# DO NOT EDIT BELOW THIS LINE +# ------------------------------------------------------------------------------------------------ + +### +### Where to retrieve the deb package +### +MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17/" + + +### +### Pre-flight check +### +if [ "${ACCEPT_EULA}" != "Y" ]; then + echo "MS ODBC EULA not accepted. Aborting installation." + exit 0 +fi + + +### +### EULA accepted, so we can proceed +### + +# Extract latest *.deb packate +MSODBC_DEB="$( curl -k -sS "${MSODBC_URL}" | grep -Eo 'msodbcsql[-._0-9]+?_amd64\.deb' | tail -1 )" + +# Download to temporary location +curl -k -sS "${MSODBC_URL}${MSODBC_DEB}" > "/tmp/${MSODBC_DEB}" + +# Install +ACCEPT_EULA="${ACCEPT_EULA}" dpkg -i "/tmp/${MSODBC_DEB}" + +# Remove artifacts +rm -f "/tmp/${MSODBC_DEB}" diff --git a/cfg/php-startup-7.3/README.md b/cfg/php-startup-7.3/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-7.3/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. diff --git a/cfg/php-startup-7.4/01-update-apt-index.sh-example b/cfg/php-startup-7.4/01-update-apt-index.sh-example new file mode 100755 index 000000000..d324ef890 --- /dev/null +++ b/cfg/php-startup-7.4/01-update-apt-index.sh-example @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Simple example showing how to update the packet index +# + +DEBIAN_FRONTEND=noninteractive apt-get update -q diff --git a/cfg/php-startup-7.4/README.md b/cfg/php-startup-7.4/README.md new file mode 100644 index 000000000..d75100abb --- /dev/null +++ b/cfg/php-startup-7.4/README.md @@ -0,0 +1,13 @@ +# Custom startup scripts + +Any script inside this directory ending by `.sh` will be executed during the PHP container startup. +This is useful to apply your custom settings such as installing software that usually requires +the user to accept a license or similar. + +A few examples are given that do not end by `.sh` which won't be run. If you want to use the +provided examples, copy them to a file ending by `.sh` + + +## Important + +All provided scripts will be executed with **root** permissions. From aa574e9205cf1c912719d54b9e930eea7108729b Mon Sep 17 00:00:00 2001 From: cytopia Date: Tue, 25 Dec 2018 16:39:48 +0100 Subject: [PATCH 02/16] Adjust ignored files --- .gitignore | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 0c215b604..dfb9e1d88 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,18 @@ /cfg/php-fpm-7.3/*.conf /cfg/php-fpm-7.4/*.conf +# Ignore custom PHP-FPM startup scripts +/cfg/php-fpm-5.2/*.sh +/cfg/php-fpm-5.3/*.sh +/cfg/php-fpm-5.4/*.sh +/cfg/php-fpm-5.5/*.sh +/cfg/php-fpm-5.6/*.sh +/cfg/php-fpm-7.0/*.sh +/cfg/php-fpm-7.1/*.sh +/cfg/php-fpm-7.2/*.sh +/cfg/php-fpm-7.3/*.sh +/cfg/php-fpm-7.4/*.sh + # Ignore custom PHP-FPM modules /mod/php-fpm-5.2/*.so /mod/php-fpm-5.3/*.so From 0115ee3b77c4a93d39e7cb98ff20039192b1ac73 Mon Sep 17 00:00:00 2001 From: cytopia Date: Tue, 25 Dec 2018 16:40:19 +0100 Subject: [PATCH 03/16] Allow for custom startup scripts --- docker-compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 638e5c1ab..ca712ea03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,7 +95,7 @@ services: # PHP / HHVM # ------------------------------------------------------------ php: - image: devilbox/php-fpm:${PHP_SERVER}-work-0.58 + image: devilbox/php-fpm:${PHP_SERVER}-work-0.59 ## ## All .env variables @@ -192,6 +192,9 @@ services: # to load custom PHP modules - ${DEVILBOX_PATH}/mod/php-fpm-${PHP_SERVER}:/usr/lib64/php/custom-modules:ro${MOUNT_OPTIONS} + # Mount devilbox user-defined PHP-FPM startup *.sh scripts + - ${DEVILBOX_PATH}/cfg/php-startup-${PHP_SERVER}:/startup.d:rw${MOUNT_OPTIONS} + # Mount devilbox user-defined bash config - ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d:rw${MOUNT_OPTIONS} From 3359bd3f9aa413fe94e38ae08fee511b96ea66f0 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 11:55:01 +0100 Subject: [PATCH 04/16] Pull docker images until success to circumvent short network outages --- .tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tests/Makefile b/.tests/Makefile index ea733ab19..deb848441 100644 --- a/.tests/Makefile +++ b/.tests/Makefile @@ -80,7 +80,7 @@ pull: @echo "####################################################################################################" @echo "# PULLING LATEST CONTAINER" @echo "####################################################################################################" - cd $(DEVILBOX_PATH) && docker-compose pull + cd $(DEVILBOX_PATH) && until docker-compose pull; do sleep 1; done @echo @echo From 42602d2ce3824bb4a47a4cb260ca99dbe37e9eb0 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 12:15:00 +0100 Subject: [PATCH 05/16] Bump version date --- .devilbox/www/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devilbox/www/config.php b/.devilbox/www/config.php index 5e4c32658..218c1610f 100644 --- a/.devilbox/www/config.php +++ b/.devilbox/www/config.php @@ -14,7 +14,7 @@ $DEVILBOX_VERSION = 'v0.15'; -$DEVILBOX_DATE = '2018-12-23'; +$DEVILBOX_DATE = '2018-12-26'; $DEVILBOX_API_PAGE = 'devilbox-api/status.json'; // From 30ea9ff2b5a9248164e7e8c097f2037edce75552 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 15:31:15 +0100 Subject: [PATCH 06/16] Fix undefined variable in intranet vhost_gen overview --- .devilbox/www/htdocs/info_vhostgen.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devilbox/www/htdocs/info_vhostgen.php b/.devilbox/www/htdocs/info_vhostgen.php index f4b4fb87b..c493652c0 100644 --- a/.devilbox/www/htdocs/info_vhostgen.php +++ b/.devilbox/www/htdocs/info_vhostgen.php @@ -47,7 +47,7 @@

Note: If the resulting virtual host config does not reflect the vhost-gen template changes, you will need to restart the Devilbox.

Overview

virtual host config


- + .conf

vhost-gen config


From 09c564c68d1d141c052c9824ba333d144a8673a9 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 17:31:09 +0100 Subject: [PATCH 07/16] Add documentation for custom startup scripts --- docs/advanced/custom-startup-commands.rst | 221 ++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 222 insertions(+) create mode 100644 docs/advanced/custom-startup-commands.rst diff --git a/docs/advanced/custom-startup-commands.rst b/docs/advanced/custom-startup-commands.rst new file mode 100644 index 000000000..89cd52c84 --- /dev/null +++ b/docs/advanced/custom-startup-commands.rst @@ -0,0 +1,221 @@ +.. _custom_startup_commands: + +*********************** +Custom startup commands +*********************** + +You can provide custom startup commands via bash scripts to each of the PHP container. +This may be useful to specify additional software to install or additional settings to apply during +the initial startup. + +**Table of Contents** + +.. contents:: :local: + + +General +======= + +You can add custom ``bash`` scripts for each PHP version separately. Provided scripts must end +by the file extension ``.sh`` and should be executable. Anything not ending by ``.sh`` will be +ignored. + +Where +----- + +Startup scripts can be added to ``cfg/php-startup-X.Y/``. +See the directory structure for PHP startup script directories inside ``./cfg/`` directory: + +.. code-block:: bash + + host> ls -l path/to/devilbox/cfg/ | grep 'php-startup' + + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-5.2/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-5.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-5.4/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-5.5/ + drwxr-xr-x 2 cytopia cytopia 4096 Apr 3 22:04 php-startup-5.6/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-7.0/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-7.1/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-7.2/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-7.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-startup-7.4/ + + +Custom scripts are added by placing a file into ``cfg/php-startup-X.X/`` (where ``X.X`` stands for +your PHP version). The file must end by ``.sh`` in order to be executed by the PHP container. + +Some of the PHP startup directories contain a few example files with the file suffix ``-example``. +If you want to use them, copy these files to a new name without the ``-example`` suffix and ensure +they end by ``.sh``. + +When +---- + +The scripts will be executed by the PHP container during initial startup. Whenever you change your +scripts, ensure to restart the Devilbox. + +How +--- + +The scripts will always be executed inside the PHP container (Debian Linux) and will be run with +``root`` privileges. + + +Examples +======== + +The following examples should already exist as example files within ``cfg/php-startup-X.Y``, but +will covered here as well to show some real world examples of what can be done with startup scripts. + +Installing Microsoft ODBC driver +-------------------------------- + +This example will add Microsofts ODBC driver to PHP 7.1. These drivers are required in order to +make the PHP modules ``pdo_sqlsrv`` and ``sqlsrv`` work. The two mentioned modules are already +available in the PHP container, but are explicitly disabled via :ref:`env_file_php_modules_disable`. + +They won't work without the ODBC driver installed, which unfortunately cannot be bundled, as it +requires every user to accept a license/EULA by Microsoft. + + +.. code-block:: bash + + # Navigate to starup dir of PHP 7.1 + host> cd path/to/devilbox/cfg/php-startup-7.1 + + # Create an .sh file + host> touch ms-odbc.sh + + # Open the file in your favourite editor + host> vi ms-odbc.sh + +Paste the following into ``ms-obbc.sh`` and **ensure to accept the EULA** by changing +``ACCEPT_EULA=N`` to ``ACCEPT_EULA=Y``. + +.. code-block:: bash + :caption: ms-odbc.sh + :emphasize-lines: 18 + + !/bin/bash + # + # This script will automatically install the Microsoft ODBC driver for MsSQL + # support for PHP during startup. + # + # In order for it to work, you must read and accept their License/EULA: + # https://odbceula.blob.core.windows.net/eula17/LICENSE172.TXT + # + + + # ------------------------------------------------------------------------------------------------ + # EDIT THE VARIABLE BELOW TO ACCEPT THE EULA (If you agree to their terms) + # ------------------------------------------------------------------------------------------------ + + ### + ### Set this to "Y" (capital 'Y') if you accept the EULA. + ### + ACCEPT_EULA=N + + + + # ------------------------------------------------------------------------------------------------ + # DO NOT EDIT BELOW THIS LINE + # ------------------------------------------------------------------------------------------------ + + ### + ### Where to retrieve the deb package + ### + MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17/" + + + ### + ### Pre-flight check + ### + if [ "${ACCEPT_EULA}" != "Y" ]; then + echo "MS ODBC EULA not accepted. Aborting installation." + exit 0 + fi + + + ### + ### EULA accepted, so we can proceed + ### + + # Extract latest *.deb packate + MSODBC_DEB="$( curl -k -sS "${MSODBC_URL}" | grep -Eo 'msodbcsql[-._0-9]+?_amd64\.deb' | tail -1 )" + + # Download to temporary location + curl -k -sS "${MSODBC_URL}${MSODBC_DEB}" > "/tmp/${MSODBC_DEB}" + + # Install + ACCEPT_EULA="${ACCEPT_EULA}" dpkg -i "/tmp/${MSODBC_DEB}" + + # Remove artifacts + rm -f "/tmp/${MSODBC_DEB}" + + +.. important:: + The script will not work, if you have not accepted the EULA. + + +Installing Oracle oci8 and pdo_oci PHP modules +---------------------------------------------- + +This example will install Oracle instaclient as well as PHP modules ``pdo_oci`` and ``oci8`` in +order to use PHP to connect to Oracle. This startup script will only be provided to PHP 7.2 + + +.. code-block:: bash + + # Navigate to starup dir of PHP 7.2 + host> cd path/to/devilbox/cfg/php-startup-7.2 + + # Create an .sh file + host> touch oracle.sh + + # Open the file in your favourite editor + host> vi oracle.sh + + +Paste the following into ``oracle.sh``: + +.. code-block:: bash + :caption: oracle.sh + + #!/bin/bash + # + # https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ + # + + # Install 'alien' to install rpm packages + apt-get update -q + DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien + + # Instantclient (basic lite) + curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + + # Instantclient (devel) + curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + + # Install RPMs + alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + + # Rempve RPMs + rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + + # Necessary symlinks + ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ + ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ + ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ + ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ + ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ + + # Build and install PHP extension oci8 + docker-php-ext-configure oci8 --with-oci8=instantclient + docker-php-ext-install oci8 + + # Build and install PHP extension pdo_oci + docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 + docker-php-ext-install pdo_oci diff --git a/docs/index.rst b/docs/index.rst index a78ad2829..d5f3e1c39 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -70,6 +70,7 @@ host is ready to be served with your custom domain. :maxdepth: 2 :numbered: + advanced/custom-startup-commands advanced/customize-php-globally advanced/customize-webserver-globally advanced/connect-to-host-os From d930c08a45bacd7e2d7337c47d555cc17adc7399 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 17:31:23 +0100 Subject: [PATCH 08/16] Fix requirements to build documentation --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 1ea5e3036..49229a0ec 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,7 +20,7 @@ You can also build the documentation locally before pushing to ensure everything #### Requirements ``` -sudo pip install sphinx sphinx-autobuild +sudo pip install sphinx sphinx-autobuild recommonmark sudo pip install sphinx_rtd_theme ``` #### How to build and error-check From dbd69c8d59062dea1b9dfa5650bc1d8facfe55f1 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 17:36:09 +0100 Subject: [PATCH 09/16] Refs #394 - Add startup script examples for Oracle instaclient --- .gitignore | 20 +++++----- .../03-oracle-oci8-and-pdo_oci.sh-example | 39 +++++++++++++++++++ .../03-oracle-oci8-and-pdo_oci.sh-example | 39 +++++++++++++++++++ .../03-oracle-oci8-and-pdo_oci.sh-example | 39 +++++++++++++++++++ .../03-oracle-oci8-and-pdo_oci.sh-example | 39 +++++++++++++++++++ 5 files changed, 166 insertions(+), 10 deletions(-) create mode 100755 cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example create mode 100755 cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example create mode 100755 cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example create mode 100755 cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example diff --git a/.gitignore b/.gitignore index dfb9e1d88..2d84d7da7 100644 --- a/.gitignore +++ b/.gitignore @@ -83,16 +83,16 @@ /cfg/php-fpm-7.4/*.conf # Ignore custom PHP-FPM startup scripts -/cfg/php-fpm-5.2/*.sh -/cfg/php-fpm-5.3/*.sh -/cfg/php-fpm-5.4/*.sh -/cfg/php-fpm-5.5/*.sh -/cfg/php-fpm-5.6/*.sh -/cfg/php-fpm-7.0/*.sh -/cfg/php-fpm-7.1/*.sh -/cfg/php-fpm-7.2/*.sh -/cfg/php-fpm-7.3/*.sh -/cfg/php-fpm-7.4/*.sh +/cfg/php-startup-5.2/*.sh +/cfg/php-startup-5.3/*.sh +/cfg/php-startup-5.4/*.sh +/cfg/php-startup-5.5/*.sh +/cfg/php-startup-5.6/*.sh +/cfg/php-startup-7.0/*.sh +/cfg/php-startup-7.1/*.sh +/cfg/php-startup-7.2/*.sh +/cfg/php-startup-7.3/*.sh +/cfg/php-startup-7.4/*.sh # Ignore custom PHP-FPM modules /mod/php-fpm-5.2/*.so diff --git a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example new file mode 100755 index 000000000..72926e87a --- /dev/null +++ b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example @@ -0,0 +1,39 @@ +#!/bin/bash +# +# https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ +# + +#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - + +# Install 'alien' to install rpm packages +apt-get update -q +DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien + +# Instantclient (basic lite) +curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + +# Instantclient (devel) +curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Install RPMs +alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Rempve RPMs +rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Necessary symlinks +ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ + +# Build and install PHP extension oci8 +docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-install oci8 + +# Build and install PHP extension pdo_oci +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 +docker-php-ext-install pdo_oci diff --git a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example new file mode 100755 index 000000000..72926e87a --- /dev/null +++ b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example @@ -0,0 +1,39 @@ +#!/bin/bash +# +# https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ +# + +#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - + +# Install 'alien' to install rpm packages +apt-get update -q +DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien + +# Instantclient (basic lite) +curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + +# Instantclient (devel) +curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Install RPMs +alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Rempve RPMs +rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Necessary symlinks +ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ + +# Build and install PHP extension oci8 +docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-install oci8 + +# Build and install PHP extension pdo_oci +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 +docker-php-ext-install pdo_oci diff --git a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example new file mode 100755 index 000000000..72926e87a --- /dev/null +++ b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example @@ -0,0 +1,39 @@ +#!/bin/bash +# +# https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ +# + +#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - + +# Install 'alien' to install rpm packages +apt-get update -q +DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien + +# Instantclient (basic lite) +curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + +# Instantclient (devel) +curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Install RPMs +alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Rempve RPMs +rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Necessary symlinks +ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ + +# Build and install PHP extension oci8 +docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-install oci8 + +# Build and install PHP extension pdo_oci +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 +docker-php-ext-install pdo_oci diff --git a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example new file mode 100755 index 000000000..72926e87a --- /dev/null +++ b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example @@ -0,0 +1,39 @@ +#!/bin/bash +# +# https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ +# + +#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - + +# Install 'alien' to install rpm packages +apt-get update -q +DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien + +# Instantclient (basic lite) +curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm + +# Instantclient (devel) +curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Install RPMs +alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Rempve RPMs +rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm +rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm + +# Necessary symlinks +ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ + +# Build and install PHP extension oci8 +docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-install oci8 + +# Build and install PHP extension pdo_oci +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 +docker-php-ext-install pdo_oci From b37afe3268d73763b1c52ac4275b9c8ff58b3240 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 26 Dec 2018 17:36:47 +0100 Subject: [PATCH 10/16] Use latest PHP images without env var name collisions --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ca712ea03..a4635bc61 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,7 +95,7 @@ services: # PHP / HHVM # ------------------------------------------------------------ php: - image: devilbox/php-fpm:${PHP_SERVER}-work-0.59 + image: devilbox/php-fpm:${PHP_SERVER}-work-0.61 ## ## All .env variables From ddbe0f9bb6a44ac169c6a699da7c1065e46ece53 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 27 Dec 2018 13:02:57 +0100 Subject: [PATCH 11/16] Test against available php modules --- .tests/Makefile | 8 + .tests/get-modules.sh | 229 ++++++++++++++++++ .travis.yml | 15 +- README.md | 113 +++++++-- .../03-oracle-oci8-and-pdo_oci.sh-example | 2 +- .../03-oracle-oci8-and-pdo_oci.sh-example | 2 +- .../03-oracle-oci8-and-pdo_oci.sh-example | 2 +- .../03-oracle-oci8-and-pdo_oci.sh-example | 2 +- 8 files changed, 348 insertions(+), 25 deletions(-) create mode 100755 .tests/get-modules.sh diff --git a/.tests/Makefile b/.tests/Makefile index deb848441..c3c0ddfef 100644 --- a/.tests/Makefile +++ b/.tests/Makefile @@ -22,6 +22,14 @@ PROJECT = vhost-tests VHOST = $(PROJECT).loc +# ------------------------------------------------------------------------------------------------- +# Misc Targets +# ------------------------------------------------------------------------------------------------- +update-readme: + cat "../README.md" \ + | perl -00 -pe "s/.*/\n$$(./get-modules.sh)\n/s" \ + > "../README.md" + # ------------------------------------------------------------------------------------------------- # Testing Targets # ------------------------------------------------------------------------------------------------- diff --git a/.tests/get-modules.sh b/.tests/get-modules.sh new file mode 100755 index 000000000..868d92f9b --- /dev/null +++ b/.tests/get-modules.sh @@ -0,0 +1,229 @@ +#!/usr/bin/env bash + +### +### Get PHP modules (5 rounds) +### + +if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 5.2" + exit 1 + fi + fi + fi + fi +fi +if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 5.3" + exit 1 + fi + fi + fi + fi +fi +if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 5.4" + exit 1 + fi + fi + fi + fi +fi +if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 5.5" + exit 1 + fi + fi + fi + fi +fi +if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 5.6" + exit 1 + fi + fi + fi + fi +fi +if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 7.0" + exit 1 + fi + fi + fi + fi +fi +if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 7.1" + exit 1 + fi + fi + fi + fi +fi +if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 7.2" + exit 1 + fi + fi + fi + fi +fi +if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 7.3" + exit 1 + fi + fi + fi + fi +fi +if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + sleep 5; + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + >&2 echo "Failed to retrieve modules for PHP 7.4" + exit 1 + fi + fi + fi + fi +fi + +ALL="$( echo "${PHP52}, ${PHP53}, ${PHP54}, ${PHP55}, ${PHP56}, ${PHP70}, ${PHP71}, ${PHP72}, ${PHP73}, ${PHP74}" | sed 's/,/\n/g' | sed -e 's/^\s*//g' -e 's/\s*$//g' | sort -u )" + +Y="✓" + +echo "| Modules | PHP 5.2 | PHP 5.3 | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 |" +echo "|----------------|---------|---------|---------|---------|---------|---------|---------|---------|---------|---------|" +echo "${ALL}" | while read line; do + printf "| %-15s%s" "${line}" "|" + + if echo ",${PHP52}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP53}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP54}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP55}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP56}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP70}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP71}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP72}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP73}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + if echo ",${PHP74}," | sed 's/,\s/,/g' | grep -Eq ",${line},"; then + printf " %s |" "${Y}" + else + printf " |" + fi + + printf "\n" +done diff --git a/.travis.yml b/.travis.yml index 80dd5a4fa..2dcad2114 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,11 @@ services: ### Specify combinations ### env: + ### + ### Check PHP Modules + ### + - S1=MODULES + ### ### Check Documentation ### @@ -196,7 +201,7 @@ env: ### install: # Update Debian/Ubuntu package index - - if [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then + - if [ "${S1}" != "MODULES" ] && [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then until sudo apt-get update -qq; do sleep 5; done fi @@ -227,7 +232,7 @@ install: echo "${COMPOSE_VERSION}"; # Install Docker and Docker Compose - - if [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then + - if [ "${S1}" != "MODULES" ] && [ "${S1}" != "DOCUMENTATION" ] && [ "${S1}" != "UPDATE" ]; then until sudo apt-get -y -qq -o Dpkg::Options::="--force-confnew" install docker-ce${DOCKER_APT}; do sleep 5; done; until curl -L -sS https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose; do sleep 5; done; chmod +x docker-compose; @@ -270,7 +275,11 @@ before_script: ### Test ### script: - - if [ "${S1}" = "DOCUMENTATION" ]; then + - if [ "${S1}" = "MODULES" ]; then + cd .tests/; + make update-readme; + git diff --quiet || { echo "Build Changes"; git diff; git status; false; } + elif [ "${S1}" = "DOCUMENTATION" ]; then cd docs/; make build; make linkcheck; diff --git a/README.md b/README.md index 261e12878..894099c0a 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ Furthermore, the Devilbox provides an **identical** and **reproducible developme * [Docker Engine 1.12.0+](https://docs.docker.com/compose/compose-file/compose-versioning/#version-21) * [Docker Compose 1.9.0+](https://docs.docker.com/compose/compose-file/compose-versioning/#version-21) - ## Available Container The Devilbox ships the following pre-configured Docker container in any available version. @@ -55,8 +54,6 @@ The Devilbox ships the following pre-configured Docker container in any availabl > **Documentation:** > [Available Container](https://devilbox.readthedocs.io/en/latest/readings/available-container.html) - - ## Community The Devilbox has a lot of features reaching from a simple single-user development environment that @@ -99,8 +96,6 @@ simplify your every-day life. If you ever run into any unforseen issues, feel fr - - ## Usage #### Quick start @@ -142,7 +137,6 @@ C:\devilbox> docker-compose up > [Start the Devilbox](https://devilbox.readthedocs.io/en/latest/getting-started/start-the-devilbox.html) | > [.env file](https://devilbox.readthedocs.io/en/latest/configuration-files/env-file.html) - #### Selective start The above will start all containers, you can however also just start the containers you actually need. This is achieved by simply specifying them in the docker-compose command. @@ -153,7 +147,6 @@ $ docker-compose up httpd php mysql redis > **Documentation:** > [Start only some container](https://devilbox.readthedocs.io/en/latest/getting-started/start-the-devilbox.html#start-some-container) - ![Devilbox](docs/img/devilbox-dash-selective.png) #### Run different versions @@ -352,7 +345,6 @@ Additionally to the default stack, there are a variety of other services that ca > **Documentation:** > [Enable custom container](https://devilbox.readthedocs.io/en/latest/custom-container/enable-all-container.html) - #### Enter the container You can also work directly inside the php container. Simply use the bundled scripts `shell.sh` (or `shell.bat` for Windows). @@ -386,13 +378,11 @@ Your projects can be found in `/shared/httpd`. DNS records are automatically ava > [Work inside the PHP container](https://devilbox.readthedocs.io/en/latest/intermediate/work-inside-the-php-container.html) | > [Directory overview](https://devilbox.readthedocs.io/en/latest/getting-started/directory-overview.html) - #### Quick Video intro [![Devilbox setup and workflow](docs/img/devilbox_01-setup-and-workflow.png "devilbox - setup and workflow")](https://www.youtube.com/watch?v=reyZMyt2Zzo) [![Devilbox email catch-all](docs/img/devilbox_02-email-catch-all.png "devilbox - email catch-all")](https://www.youtube.com/watch?v=e-U-C5WhxGY) - ## Feature overview The Devilbox has everything setup for you. The only thing you will have to install is [Docker](https://docs.docker.com/engine/installation/) and [Docker Compose](https://docs.docker.com/compose/install/). Virtual hosts and DNS entries will be created automatically, just by adding new project folders. @@ -487,7 +477,6 @@ The following batteries are available in the Devilbox intranet by default: > **Documentation:** > [Devilbox Intranet](https://devilbox.readthedocs.io/en/latest/getting-started/devilbox-intranet.html) - #### Tools The following tools will assist you on creating new projects easily as well as helping you check your code against guidelines. @@ -587,19 +576,111 @@ Well-known and popular tools will be at your service as well: > **Documentation:** > [Available Tools](https://devilbox.readthedocs.io/en/latest/readings/available-tools.html) - #### Available PHP Modules The Devilbox is a development stack, so it is made sure that a lot of PHP modules are available out of the box in order to work with many different frameworks. -> *amqp, apc, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mhash, mongo, mongodb, msgpack, mysql, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, SQLite, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib* + +| Modules | PHP 5.2 | PHP 5.3 | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | +|----------------|---------|---------|---------|---------|---------|---------|---------|---------|---------|---------| +| amqp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| apc | | ✓ | ✓ | ✓ | ✓ | | | | | | +| apcu | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | +| bcmath | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| bz2 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| calendar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| Core | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| ctype | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| curl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| date | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| dba | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| dom | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| enchant | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| ereg | | ✓ | ✓ | ✓ | ✓ | | | | | | +| exif | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| fileinfo | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| filter | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| ftp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| gd | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| gettext | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| gmp | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| hash | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| iconv | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| igbinary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| imagick | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | +| imap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| interbase | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| intl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| json | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| ldap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| libxml | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| mbstring | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| mcrypt | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| memcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| memcached | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| mhash | | | | | ✓ | | | | | | +| mongo | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | +| mongodb | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| msgpack | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| mysql | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | +| mysqli | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| mysqlnd | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| openssl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pcntl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pcre | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| PDO | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pdo_dblib | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| PDO_Firebird | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pdo_mysql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pdo_pgsql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pdo_sqlite | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pdo_sqlsrv | | | | | | ✓ | ✓ | ✓ | ✓ | | +| pgsql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| phalcon | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| Phar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| posix | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| pspell | ✓ | ✓ | ✓ | ✓ | ✓ | | | | ✓ | ✓ | +| rdkafka | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| readline | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| recode | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| redis | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| Reflection | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| session | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| shmop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| SimpleXML | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| snmp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| soap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| sockets | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| sodium | | | | | | | | ✓ | ✓ | ✓ | +| SPL | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| SQLite | ✓ | ✓ | | | | | | | | | +| sqlite3 | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| sqlsrv | | | | | | ✓ | ✓ | ✓ | ✓ | | +| standard | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| swoole | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| sysvmsg | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| sysvsem | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| sysvshm | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| tidy | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| tokenizer | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| uploadprogress | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| wddx | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xdebug | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | +| xml | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xmlreader | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xmlrpc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xmlwriter | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xsl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| Zend OPcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| zip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| zlib | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + PHP modules can be enabled or disabled on demand to reflect the state of your target environment. > **Documentation:** > [Enable/disable PHP modules](https://devilbox.readthedocs.io/en/latest/intermediate/enable-disable-php-modules.html) - #### Custom PHP Modules You can also copy any custom modules into `mod/(php-fpm)-` and add a custom `*.ini` file to load them. @@ -643,7 +724,6 @@ As far as tested there are no limitations and you can use any Framework or CMS j > [Setup Yii](https://devilbox.readthedocs.io/en/latest/examples/setup-yii.html) | > [Setup Zend](https://devilbox.readthedocs.io/en/latest/examples/setup-zend.html) - ## Intranet overview The Devilbox comes with a pre-configured intranet on `http://localhost` and `https://localhost`. This can be explicitly disabled or password-protected. The intranet will not only show you, the chosen configuration, but also validate the status of the current configuration, such as if **DNS records** exists (on host and container), are directories properly set-up. Additionally it provides external tools to let you interact with databases and emails. @@ -660,7 +740,6 @@ The Devilbox comes with a pre-configured intranet on `http://localhost` and `htt > **Documentation:** > [Devilbox Intranet](https://devilbox.readthedocs.io/en/latest/getting-started/devilbox-intranet.html) - ## Screenshots A few examples of how the built-in intranet looks like. @@ -686,7 +765,6 @@ A few examples of how the built-in intranet looks like. - ## Contributing [![Open Source Helpers](https://www.codetriage.com/cytopia/devilbox/badges/users.svg)](https://www.codetriage.com/cytopia/devilbox) The Devilbox is still a young project with a long roadmap of features to come. Features are @@ -701,7 +779,6 @@ To increase visibility and bug-free operation: Additionally you can [subscribe to Devilbox on CodeTriage](https://www.codetriage.com/cytopia/devilbox), read up on [CONTRIBUTING.md](CONTRIBUTING.md) and check the [ROADMAP](https://github.com/cytopia/devilbox/issues/23) about what is already planned for the near future. - ## Logos Logos and banners can be found at **[devilbox/artwork](https://github.com/devilbox/artwork)**. Feel free to use or modify them by the terms of their license. diff --git a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example index 72926e87a..2a8fc3c6a 100755 --- a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example @@ -19,7 +19,7 @@ curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum. alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm -# Rempve RPMs +# Remove RPMs rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm diff --git a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example index 72926e87a..2a8fc3c6a 100755 --- a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example @@ -19,7 +19,7 @@ curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum. alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm -# Rempve RPMs +# Remove RPMs rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm diff --git a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example index 72926e87a..2a8fc3c6a 100755 --- a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example @@ -19,7 +19,7 @@ curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum. alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm -# Rempve RPMs +# Remove RPMs rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm diff --git a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example index 72926e87a..2a8fc3c6a 100755 --- a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example @@ -19,7 +19,7 @@ curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum. alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm -# Rempve RPMs +# Remove RPMs rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm From cb7ec86765ece20490cc65fdc20e5b35c9ab6d26 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 27 Dec 2018 13:16:30 +0100 Subject: [PATCH 12/16] Test startup files --- .tests/Makefile | 13 ++++++++++- .tests/startup-tests/startup.sh | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 .tests/startup-tests/startup.sh diff --git a/.tests/Makefile b/.tests/Makefile index c3c0ddfef..f6a5aad49 100644 --- a/.tests/Makefile +++ b/.tests/Makefile @@ -144,7 +144,8 @@ info: ### ### Run tests ### -test: test-vhost test-intra +test: test-vhost test-intra test-startup + test-intra: @echo "####################################################################################################" @@ -278,6 +279,16 @@ test-vhost: @echo +test-startup: + @echo "####################################################################################################" + @echo "# RUNNING TESTS: STARTUP" + @echo "####################################################################################################" + @echo + @if ! $(CURRENT_PATH)startup-tests/startup.sh; then \ + exit 1; \ + fi + + # ------------------------------------------------------------------------------------------------- # Helper Targets # ------------------------------------------------------------------------------------------------- diff --git a/.tests/startup-tests/startup.sh b/.tests/startup-tests/startup.sh new file mode 100755 index 000000000..12adc7722 --- /dev/null +++ b/.tests/startup-tests/startup.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" +COMPOSEPATH="${SCRIPTPATH}/../../" +CONTAINER="$( cd "${COMPOSEPATH}" && docker-compose ps -q php )" + +#FILES="$()" +cd "${COMPOSEPATH}" && docker-compose exec -T php bash -c "find /startup.d/*.sh-example -type f -print0 2>/dev/null" \ + | xargs -0 -n 1 echo \ + | while read f; do + + echo "# ----------------------------------------------------------------------------------------" + echo "# [TEST] ${f}" + echo "# ----------------------------------------------------------------------------------------" + if ! docker exec -t ${CONTAINER} bash "${f}"; then + sleep 5 + if ! docker exec -t ${CONTAINER} bash "${f}"; then + sleep 5 + if ! docker exec -t ${CONTAINER} bash "${f}"; then + sleep 5 + if ! docker exec -t ${CONTAINER} bash "${f}"; then + sleep 5 + if ! docker exec -t ${CONTAINER} bash "${f}"; then + echo "[FAIl] ${f}" + exit 1 + fi + fi + fi + fi + fi + echo "[OK] ${f}" + echo + echo +done From 7fabead92d90663f7308547ada494928f55ece6e Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 27 Dec 2018 13:46:31 +0100 Subject: [PATCH 13/16] Auto accept EULA for CI tests --- .tests/startup-tests/startup.sh | 10 +++++----- cfg/php-startup-7.0/02-ms-odbc-driver.sh-example | 5 +++++ cfg/php-startup-7.1/02-ms-odbc-driver.sh-example | 5 +++++ cfg/php-startup-7.2/02-ms-odbc-driver.sh-example | 5 +++++ cfg/php-startup-7.3/02-ms-odbc-driver.sh-example | 5 +++++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.tests/startup-tests/startup.sh b/.tests/startup-tests/startup.sh index 12adc7722..7802fc0b7 100755 --- a/.tests/startup-tests/startup.sh +++ b/.tests/startup-tests/startup.sh @@ -16,15 +16,15 @@ cd "${COMPOSEPATH}" && docker-compose exec -T php bash -c "find /startup.d/*.sh- echo "# ----------------------------------------------------------------------------------------" echo "# [TEST] ${f}" echo "# ----------------------------------------------------------------------------------------" - if ! docker exec -t ${CONTAINER} bash "${f}"; then + if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then sleep 5 - if ! docker exec -t ${CONTAINER} bash "${f}"; then + if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then sleep 5 - if ! docker exec -t ${CONTAINER} bash "${f}"; then + if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then sleep 5 - if ! docker exec -t ${CONTAINER} bash "${f}"; then + if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then sleep 5 - if ! docker exec -t ${CONTAINER} bash "${f}"; then + if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then echo "[FAIl] ${f}" exit 1 fi diff --git a/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example index b0c192e30..a439457ca 100755 --- a/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example +++ b/cfg/php-startup-7.0/02-ms-odbc-driver.sh-example @@ -32,6 +32,11 @@ MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17 ### ### Pre-flight check ### +if [ "${#}" = "1" ]; then + if [ "${1}" = "ACCEPT_EULA=1" ]; then + ACCEPT_EULA=Y + fi +fi if [ "${ACCEPT_EULA}" != "Y" ]; then echo "MS ODBC EULA not accepted. Aborting installation." exit 0 diff --git a/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example index b0c192e30..a439457ca 100755 --- a/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example +++ b/cfg/php-startup-7.1/02-ms-odbc-driver.sh-example @@ -32,6 +32,11 @@ MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17 ### ### Pre-flight check ### +if [ "${#}" = "1" ]; then + if [ "${1}" = "ACCEPT_EULA=1" ]; then + ACCEPT_EULA=Y + fi +fi if [ "${ACCEPT_EULA}" != "Y" ]; then echo "MS ODBC EULA not accepted. Aborting installation." exit 0 diff --git a/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example index b0c192e30..a439457ca 100755 --- a/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example +++ b/cfg/php-startup-7.2/02-ms-odbc-driver.sh-example @@ -32,6 +32,11 @@ MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17 ### ### Pre-flight check ### +if [ "${#}" = "1" ]; then + if [ "${1}" = "ACCEPT_EULA=1" ]; then + ACCEPT_EULA=Y + fi +fi if [ "${ACCEPT_EULA}" != "Y" ]; then echo "MS ODBC EULA not accepted. Aborting installation." exit 0 diff --git a/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example b/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example index b0c192e30..a439457ca 100755 --- a/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example +++ b/cfg/php-startup-7.3/02-ms-odbc-driver.sh-example @@ -32,6 +32,11 @@ MSODBC_URL="https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17 ### ### Pre-flight check ### +if [ "${#}" = "1" ]; then + if [ "${1}" = "ACCEPT_EULA=1" ]; then + ACCEPT_EULA=Y + fi +fi if [ "${ACCEPT_EULA}" != "Y" ]; then echo "MS ODBC EULA not accepted. Aborting installation." exit 0 From fad12d120d06a53642de1e9c46e7fb7e527553bd Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 27 Dec 2018 13:51:09 +0100 Subject: [PATCH 14/16] Tie PHP module check against currently used php-fpm tag --- .tests/get-modules.sh | 104 ++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/.tests/get-modules.sh b/.tests/get-modules.sh index 868d92f9b..db207f239 100755 --- a/.tests/get-modules.sh +++ b/.tests/get-modules.sh @@ -1,18 +1,22 @@ #!/usr/bin/env bash +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" +COMPOSEPATH="${SCRIPTPATH}/.." +PHP_TAG="$( grep 'devilbox/php' "${COMPOSEPATH}/docker-compose.yml" | sed 's/^.*-work-//g' )" + ### ### Get PHP modules (5 rounds) ### -if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '52-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 5.2" exit 1 fi @@ -20,15 +24,15 @@ if ! PHP52="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '53-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 5.3" exit 1 fi @@ -36,15 +40,15 @@ if ! PHP53="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '54-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 5.4" exit 1 fi @@ -52,15 +56,15 @@ if ! PHP54="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '55-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 5.5" exit 1 fi @@ -68,15 +72,15 @@ if ! PHP55="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '56-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 5.6" exit 1 fi @@ -84,15 +88,15 @@ if ! PHP56="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '70-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 7.0" exit 1 fi @@ -100,15 +104,15 @@ if ! PHP70="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '71-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 7.1" exit 1 fi @@ -116,15 +120,15 @@ if ! PHP71="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '72-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 7.2" exit 1 fi @@ -132,15 +136,15 @@ if ! PHP72="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '73-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 7.3" exit 1 fi @@ -148,15 +152,15 @@ if ! PHP73="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-f fi fi fi -if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then +if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then sleep 5; - if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/master/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then + if ! PHP74="$( curl -sS https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md | tac | tac | grep -E '74-mods' | sed -e 's/.*">//g' -e 's/<.*//g' )"; then >&2 echo "Failed to retrieve modules for PHP 7.4" exit 1 fi From 79b197822acafa840c738a66eb76a241814803f4 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 27 Dec 2018 14:14:01 +0100 Subject: [PATCH 15/16] Ensure oracle oci8/pdo_oci work on every version --- .../03-oracle-oci8-and-pdo_oci.sh-example | 10 ++-------- .../03-oracle-oci8-and-pdo_oci.sh-example | 10 ++-------- .../03-oracle-oci8-and-pdo_oci.sh-example | 12 +++--------- .../03-oracle-oci8-and-pdo_oci.sh-example | 12 +++--------- 4 files changed, 10 insertions(+), 34 deletions(-) diff --git a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example index 2a8fc3c6a..37b5f1e4f 100755 --- a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example @@ -3,8 +3,6 @@ # https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ # -#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - - # Install 'alien' to install rpm packages apt-get update -q DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien @@ -24,14 +22,10 @@ rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Necessary symlinks -ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/*.so* /usr/lib/ # Build and install PHP extension oci8 -docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/lib/oracle/18.3/client64/lib/,18.3 docker-php-ext-install oci8 # Build and install PHP extension pdo_oci diff --git a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example index 2a8fc3c6a..37b5f1e4f 100755 --- a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example @@ -3,8 +3,6 @@ # https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ # -#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - - # Install 'alien' to install rpm packages apt-get update -q DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien @@ -24,14 +22,10 @@ rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Necessary symlinks -ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/*.so* /usr/lib/ # Build and install PHP extension oci8 -docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/lib/oracle/18.3/client64/lib/,18.3 docker-php-ext-install oci8 # Build and install PHP extension pdo_oci diff --git a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example index 2a8fc3c6a..025439a9a 100755 --- a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example @@ -3,8 +3,6 @@ # https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ # -#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - - # Install 'alien' to install rpm packages apt-get update -q DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien @@ -24,16 +22,12 @@ rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Necessary symlinks -ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/*.so* /usr/lib/ # Build and install PHP extension oci8 -docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/lib/oracle/18.3/client64/lib/,18.3 docker-php-ext-install oci8 # Build and install PHP extension pdo_oci -docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr/lib/oracle/18.3/client64/lib/,18.3 docker-php-ext-install pdo_oci diff --git a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example index 2a8fc3c6a..025439a9a 100755 --- a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example @@ -3,8 +3,6 @@ # https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ # -#curl -sS http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 2>/dev/null | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - - # Install 'alien' to install rpm packages apt-get update -q DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests alien @@ -24,16 +22,12 @@ rm -f /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm rm -f /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Necessary symlinks -ln -s /usr/lib/oracle/18.3/client64/lib/libmql1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libipc1.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libnnz18.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libons.so /usr/lib/ -ln -s /usr/lib/oracle/18.3/client64/lib/libclntshcore.so.18.1 /usr/lib/ +ln -s /usr/lib/oracle/18.3/client64/lib/*.so* /usr/lib/ # Build and install PHP extension oci8 -docker-php-ext-configure oci8 --with-oci8=instantclient +docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/lib/oracle/18.3/client64/lib/,18.3 docker-php-ext-install oci8 # Build and install PHP extension pdo_oci -docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr,18.3 +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr/lib/oracle/18.3/client64/lib/,18.3 docker-php-ext-install pdo_oci From 4e44082cd8d848d3b9d371a897ce85ba31d7e1bc Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 27 Dec 2018 14:28:49 +0100 Subject: [PATCH 16/16] Import GPG key into rpm before installing software to ensure it is valid --- cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example | 1 + cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example | 1 + cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example | 1 + cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example | 1 + 4 files changed, 4 insertions(+) diff --git a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example index 37b5f1e4f..1091b5ff6 100755 --- a/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.0/03-oracle-oci8-and-pdo_oci.sh-example @@ -14,6 +14,7 @@ curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https:// curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Install RPMs +rpm --import http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm diff --git a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example index 37b5f1e4f..1091b5ff6 100755 --- a/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.1/03-oracle-oci8-and-pdo_oci.sh-example @@ -14,6 +14,7 @@ curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https:// curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Install RPMs +rpm --import http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm diff --git a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example index 025439a9a..9c5bf8bd1 100755 --- a/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.2/03-oracle-oci8-and-pdo_oci.sh-example @@ -14,6 +14,7 @@ curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https:// curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Install RPMs +rpm --import http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm diff --git a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example index 025439a9a..9c5bf8bd1 100755 --- a/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example +++ b/cfg/php-startup-7.3/03-oracle-oci8-and-pdo_oci.sh-example @@ -14,6 +14,7 @@ curl -o /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm https:// curl -o /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm # Install RPMs +rpm --import http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 alien -i /tmp/oracle-instantclient18.3-basiclite-18.3.0.0.0-2.x86_64.rpm alien -i /tmp/oracle-instantclient18.3-devel-18.3.0.0.0-2.x86_64.rpm