2020-07-23 17:30:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2020-07-24 13:57:16 +00:00
|
|
|
if [[ $1 ]]; then
|
2020-07-23 17:30:24 +00:00
|
|
|
#
|
|
|
|
# Set environment variables for Docker
|
|
|
|
#
|
2020-07-24 14:39:30 +00:00
|
|
|
if ! [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
2020-09-10 17:33:29 +00:00
|
|
|
WP_VERSION=$(git ls-remote --tags https://github.com/wordpress/wordpress.git | cut -f3 -d/ | grep -E '^\d+\.\d+(.\d+)*$' | tail -n 1)
|
2020-07-24 14:39:30 +00:00
|
|
|
fi
|
2020-07-24 13:57:16 +00:00
|
|
|
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
2020-07-23 17:30:24 +00:00
|
|
|
export WORDPRESS_VERSION=$WP_VERSION
|
|
|
|
else
|
2020-09-10 17:33:29 +00:00
|
|
|
export WORDPRESS_VERSION="5.5.1"
|
2020-07-23 17:30:24 +00:00
|
|
|
fi
|
|
|
|
|
2020-07-24 14:39:30 +00:00
|
|
|
if ! [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
2020-09-10 17:33:29 +00:00
|
|
|
PVER=$(git ls-remote --tags https://github.com/php/php-src.git | cut -f3 -d/ | grep -E '^php-\d+\.\d+(.\d+)*$' | tail -n 1)
|
|
|
|
TRAVIS_PHP_VERSION=${PVER/php-/}
|
2020-07-24 14:39:30 +00:00
|
|
|
fi
|
2020-07-24 13:57:16 +00:00
|
|
|
if [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
2020-07-23 17:30:24 +00:00
|
|
|
export DC_PHP_VERSION=$TRAVIS_PHP_VERSION
|
|
|
|
else
|
2020-09-10 17:33:29 +00:00
|
|
|
export DC_PHP_VERSION="7.4.9"
|
2020-07-23 17:30:24 +00:00
|
|
|
fi
|
|
|
|
|
2020-07-24 14:39:30 +00:00
|
|
|
if ! [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
2020-09-10 17:33:29 +00:00
|
|
|
MVER=$(git ls-remote --tags https://github.com/mariadb/server.git | cut -f3 -d/ | grep -E '^mariadb-\d\d\.\d+(.\d+)*$' | tail -n 1)
|
|
|
|
TRAVIS_MARIADB_VERSION=${MVER/mariadb-/}
|
2020-07-24 14:39:30 +00:00
|
|
|
fi
|
2020-07-24 13:57:16 +00:00
|
|
|
if [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
2020-07-23 17:30:24 +00:00
|
|
|
export DC_MARIADB_VERSION=$TRAVIS_MARIADB_VERSION
|
|
|
|
else
|
2020-09-10 17:33:29 +00:00
|
|
|
export DC_MARIADB_VERSION="10.5.5"
|
2020-07-23 17:30:24 +00:00
|
|
|
fi
|
|
|
|
|
2020-07-24 13:57:16 +00:00
|
|
|
if [[ $1 == 'up' ]]; then
|
2020-07-23 17:30:24 +00:00
|
|
|
echo WordPress $WORDPRESS_VERSION
|
|
|
|
echo PHP $DC_PHP_VERSION
|
|
|
|
echo MariaDB $DC_MARIADB_VERSION
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Run Docker
|
2020-07-24 13:57:16 +00:00
|
|
|
./bin/docker-compose.js $1
|