Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/docker-provider-beta' into docke…
Browse files Browse the repository at this point in the history
…r-provider

# Conflicts:
#	provision/core/mariadb/provision.sh
  • Loading branch information
pentatonicfunk committed Oct 29, 2024
2 parents 33db168 + d224835 commit 060f8a0
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 62 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ permalink: /docs/en-US/changelog/
* Provisioner/Hook timings now show milliseconds ( #2735 )
* Added a `skip_site_provisioner_update` option to prevent site provisioners being overwritten by updates ( #2733 )
* Only start services that aren't running in post-up scripts ( #2732 )
* Upgraded Ubuntu from 20.04 to 24.04 for docker provider ( #2739 )

### Bug Fixes

* VVV will check if Parallels is installed before defaulting to docker on Arm64/Apple Silicon due to issues with Docker detection ( #2722 )
* Switched from Rackspace to Starburst services for MariaDB mirrors ( #2728 )
* Switched from Starburst to OVH for MariaDB mirrors ( #2741 )
* Fixes for service starts under some situations in Docker ( #2732 )
* Fixed an issue with trailing slashes and site provisioners introduced in an earlier version (#2731)

Expand Down
3 changes: 0 additions & 3 deletions config/default-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ general:
# GitHub token to use from composer
#github_token: xxxxxx

# Set the default version of PHP CLI
# php_cli_version: 8.2

# Settings for the vagrant plugins supported by VVV
vagrant-plugins:
disksize: 10GB # requires the disk size vagrant plugin
12 changes: 5 additions & 7 deletions config/homebin/vagrant_provision
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ source /srv/provision/provision-helpers.sh

vvv_success " ▷ Post provision script"

mysql_service_name=$(vvv_get_mysql_service_name)

if [[ -f /srv/config/homebin/vagrant_provision_custom ]]; then
vvv_info " * Custom vagrant provision script found, executing vagrant_provision_custom"
/srv/config/homebin/vagrant_provision_custom
Expand All @@ -31,11 +29,11 @@ else
fi

vvv_info " * Restarting MariaDB service"
if sudo service "${mysql_service_name[@]}" status > /dev/null; then
sudo service "${mysql_service_name[@]}" restart
else
sudo service "${mysql_service_name[@]}" start
fi
if sudo service mariadb status > /dev/null; then
sudo service mariadb restart
else
sudo service mariadb start
fi

if [ ! -f /.dockerenv ]; then
if [ -x "$(command -v ntpdate)" ]; then
Expand Down
9 changes: 3 additions & 6 deletions config/homebin/vagrant_up
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ TEARS="${CYAN}░${RED}"
EYE="${CYAN}${RED}"
URL="\033[4;38;5;3m"

mysql_service_name=$(vvv_get_mysql_service_name)

if [[ -f /srv/config/homebin/vagrant_up_custom ]]; then
vvv_info " * Custom vagrant up script found, executing vagrant_up_custom"
/srv/config/homebin/vagrant_up_custom
Expand All @@ -39,10 +37,9 @@ if ! sudo service nginx status > /dev/null; then
sudo service nginx start
fi


vvv_info " * Starting MariaDB service"
if ! sudo service "${mysql_service_name[@]}" status > /dev/null; then
sudo service "${mysql_service_name[@]}" start
if ! sudo service mariadb status > /dev/null; then
vvv_info " * Starting MariaDB service"
sudo service mariadb start
fi

vvv_info " * Checking PHP-FPM Services"
Expand Down
8 changes: 1 addition & 7 deletions config/homebin/vvv_restore_php_default
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/usr/bin/env bash

# Load config.yml
VVV_CONFIG=/srv/config/default-config.yml
if [[ -f /srv/config/config.yml ]]; then
VVV_CONFIG=/srv/config/config.yml
fi

DEFAULTPHP=$(cat ${VVV_CONFIG} | shyaml -q get-value general.php_cli_version "8.2")
DEFAULTPHP="8.2"
php_version=$(readlink -f /usr/bin/php)
if [[ $php_version != *"${DEFAULTPHP}"* ]]; then
echo " * Restoring the default PHP CLI version ( ${DEFAULTPHP} )"
Expand Down
18 changes: 8 additions & 10 deletions provision/core/mariadb/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ function mysql_setup() {
vvv_info " * Copied /srv/provision/core/mariadb/config/debian.cnf to /etc/mysql/debian.cnf"

# Due to systemd dependencies, in docker, mysql service is not auto started
# also docker isn't systemd based, so the service name is different: see: https://mariadb.com/kb/en/systemd/ vs https://mariadb.com/kb/en/sysvinit/
mysql_service_name=$(vvv_get_mysql_service_name)
vvv_info " * Ensuring MariaDB service is started"
service "${mysql_service_name[@]}" status > /dev/null || service "${mysql_service_name[@]}" start
service mariadb status > /dev/null || service mariadb start

if [ ! -f /.dockerenv ]; then
check_mysql_root_password
Expand All @@ -137,19 +135,19 @@ function mysql_setup() {
# MySQL gives us an error if we restart a non running service, which
# happens after a `vagrant halt`. Check to see if it's running before
# deciding whether to start or restart.
if service "${mysql_service_name[@]}" status > /dev/null; then
if service mariadb status > /dev/null; then
vvv_info " * Restarting the mariadb service"
if ! service "${mysql_service_name[@]}" restart; then
if ! service mariadb restart; then
vvv_error " * Restarting the MariaDB failed! Fetching service status."
service "${mysql_service_name[@]}" status
service mariadb status
exit 1
fi
else
vvv_info " * Starting mariadb service"
service "${mysql_service_name[@]}" start
if ! service "${mysql_service_name[@]}" start; then
vvv_info " * Restarting mariadb service"
service mariadb start
if ! service mariadb start; then
vvv_error " * Starting MariaDB failed! Fetching service status."
service "${mysql_service_name[@]}" status
service mariadb status
exit 1
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions provision/core/mariadb/sources-debian-bookworm.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# https://mariadb.org/download/
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://deb.mariadb.org/10.11/debian bookworm main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/debian bookworm main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/debian bookworm main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/debian bookworm main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/debian bookworm main
4 changes: 2 additions & 2 deletions provision/core/mariadb/sources-debian-bullseye.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# https://mariadb.org/download/
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://deb.mariadb.org/10.11/debian bullseye main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/debian bullseye main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/debian bullseye main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/debian bullseye main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/debian bullseye main
4 changes: 2 additions & 2 deletions provision/core/mariadb/sources-debian-buster.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# https://mariadb.org/download/
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://deb.mariadb.org/10.11/debian buster main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/debian buster main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/debian buster main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/debian buster main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/debian buster main
4 changes: 2 additions & 2 deletions provision/core/mariadb/sources-ubuntu-bionic.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# https://mariadb.org/download/
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://deb.mariadb.org/10.11/ubuntu bionic main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/ubuntu bionic main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/ubuntu bionic main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/ubuntu bionic main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/ubuntu bionic main
4 changes: 2 additions & 2 deletions provision/core/mariadb/sources-ubuntu-jammy.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# https://mariadb.org/download/
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://deb.mariadb.org/10.11/ubuntu jammy main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/ubuntu jammy main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.11/ubuntu jammy main
deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/ubuntu jammy main
# deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.11/ubuntu jammy main
27 changes: 8 additions & 19 deletions provision/provision-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,15 @@ function network_check() {
#
# If you need to modify this list, contact us on GitHub with the changes.
declare -a hosts_to_test=(
"https://ppa.launchpadcontent.net" # needed for core ubuntu packages
"https://wordpress.org" # WordPress!!
"https://github.com" # needed for dashboard, extensions, etc
"https://raw.githubusercontent.com" # some scripts and provisioners rely on this
"https://getcomposer.org" # composer is used for lots of sites and provisioners
"https://packagist.org" # Composer Packages
"https://mariadb.gb.ssimn.org" # MariaDB mirror
"http://mariadb.mirrors.ovh.net" # MariaDB mirror[ovh]
"https://ppa.launchpadcontent.net" # Needed for core ubuntu packages
"https://wordpress.org" # WordPress!!
"https://github.com" # Needed for dashboard, extensions, etc
"https://raw.githubusercontent.com" # Some scripts and provisioners rely on this
"https://getcomposer.org" # Composer is used for lots of sites and provisioners
"https://packagist.org" # Composer Packages
"http://mariadb.mirrors.ovh.net" # MariaDB mirror[ovh]
"http://ports.ubuntu.com/"
"https://nginx.org/packages/mainline/"
"https://nginx.org/packages/mainline/" # Nginx
)
declare -a failed_hosts=()
for url in "${hosts_to_test[@]}"; do
Expand Down Expand Up @@ -732,13 +731,3 @@ function vvv_search_replace_in_file() {
fi
}
export -f vvv_search_replace_in_file

# @description Identify the service name for the MySQL service via /etc/init.d/ contents
# TODO: test on virtualbox
function vvv_get_mysql_service_name() {
if [ ! -f /etc/init.d/mariadb ]; then
echo "mysql"
fi
echo "mariadb"
}
export -f vvv_get_mysql_service_name

0 comments on commit 060f8a0

Please sign in to comment.