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 21:26:44 +00:00
|
|
|
WP_VERSION=$(./bin/get-latest-docker-tag.js wordpress 5 2> /dev/null)
|
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
|
2021-08-18 18:06:20 +00:00
|
|
|
export WORDPRESS_VERSION="5.8.0"
|
2020-07-23 17:30:24 +00:00
|
|
|
fi
|
|
|
|
|
2021-10-05 15:33:24 +00:00
|
|
|
if [[ $LATEST_WP_VERSION_MINUS ]]; then
|
|
|
|
export WORDPRESS_VERSION=$(./bin/get-previous-version.js $WORDPRESS_VERSION $LATEST_WP_VERSION_MINUS 2> /dev/null)
|
|
|
|
fi
|
|
|
|
|
2021-11-10 10:48:59 +00:00
|
|
|
if [[ $PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
|
|
export DC_PHP_VERSION=$PHP_VERSION
|
2020-07-23 17:30:24 +00:00
|
|
|
else
|
2021-11-10 10:48:59 +00:00
|
|
|
if ! [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
|
|
TRAVIS_PHP_VERSION=$(./bin/get-latest-docker-tag.js php 7 2> /dev/null)
|
|
|
|
fi
|
|
|
|
if [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
|
|
export DC_PHP_VERSION=$TRAVIS_PHP_VERSION
|
|
|
|
else
|
|
|
|
export DC_PHP_VERSION="7.4.25"
|
|
|
|
fi
|
2020-07-23 17:30:24 +00:00
|
|
|
fi
|
|
|
|
|
2021-11-10 10:48:59 +00:00
|
|
|
if [[ $MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
|
|
export DC_MARIADB_VERSION=$MARIADB_VERSION
|
2020-07-23 17:30:24 +00:00
|
|
|
else
|
2021-11-10 10:48:59 +00:00
|
|
|
if ! [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
|
|
TRAVIS_MARIADB_VERSION=$(./bin/get-latest-docker-tag.js mariadb 10 2> /dev/null)
|
|
|
|
fi
|
|
|
|
if [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
|
|
export DC_MARIADB_VERSION=$TRAVIS_MARIADB_VERSION
|
|
|
|
else
|
|
|
|
export DC_MARIADB_VERSION="10.6.5"
|
|
|
|
fi
|
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-10-21 13:53:00 +00:00
|
|
|
./bin/docker-compose.js $@
|