Skip to content

Commit

Permalink
13.0.0 - PHP 8.1 Default Requires Base Box >= 12.0.0, < 13.0.0 (#1739)
Browse files Browse the repository at this point in the history
* Default to PHP 8.1
* Tagging v13.0.0 and update constraints
* Update minio feature to be aware of CPU arch (#1734)
* Update cpu arch conditional check for minio
* Add test aliases for both Pest and PHPunit dynamically (#1738)
* Update localized aliases
  • Loading branch information
svpernova09 authored Dec 5, 2021
1 parent b27e499 commit cb72238
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bin/homestead
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(is_file( __DIR__.'/../vendor/autoload.php')) {
require __DIR__.'/../../../autoload.php';
}

$app = new Symfony\Component\Console\Application('Laravel Homestead', '12.8.0');
$app = new Symfony\Component\Console\Application('Laravel Homestead', '13.0.0');

$app->add(new Laravel\Homestead\MakeCommand);
$app->add(new Laravel\Homestead\WslApplyFeatures);
Expand Down
18 changes: 9 additions & 9 deletions resources/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function serve-apache() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/apache.sh
sudo bash /vagrant/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -125,7 +125,7 @@ function serve-laravel() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/laravel.sh
sudo bash /vagrant/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -137,7 +137,7 @@ function serve-proxy() {
if [[ "$1" && "$2" ]]
then
sudo dos2unix /vagrant/scripts/site-types/proxy.sh
sudo bash /vagrant/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -150,7 +150,7 @@ function serve-silverstripe() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/silverstripe.sh
sudo bash /vagrant/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -163,7 +163,7 @@ function serve-spa() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/spa.sh
sudo bash /vagrant/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -176,7 +176,7 @@ function serve-statamic() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/statamic.sh
sudo bash /vagrant/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -189,7 +189,7 @@ function serve-symfony2() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/symfony2.sh
sudo bash /vagrant/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -202,7 +202,7 @@ function serve-symfony4() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/symfony4.sh
sudo bash /vagrant/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -215,7 +215,7 @@ function serve-pimcore() {
then
sudo bash /vagrant/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/scripts/site-types/pimcore.sh
sudo bash /vagrant/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand Down
42 changes: 31 additions & 11 deletions resources/localized/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ alias art=artisan

alias codecept='vendor/bin/codecept'
alias phpspec='vendor/bin/phpspec'
alias phpunit='vendor/bin/phpunit'
alias serve=serve-laravel

alias xoff='sudo phpdismod -s cli xdebug'
Expand All @@ -24,9 +23,30 @@ function dusk() {
Xvfb :0 -screen 0 1280x960x24 &
fi

php artisan dusk --filter "$@"
if [[ $? -eq 0 ]]
then
php artisan dusk
else
php artisan dusk --filter "$@"
fi
}

function p() {
if [ -f vendor/bin/pest ]; then
vendor/bin/pest "$@"
else
vendor/bin/phpunit "$@"
fi
}

function pf() {
if [ -f vendor/bin/pest ]; then
vendor/bin/pest --filter "$@"
else
vendor/bin/phpunit --filter "$@"
fi
}

function php56() {
sudo update-alternatives --set php /usr/bin/php5.6
sudo update-alternatives --set php-config /usr/bin/php-config5.6
Expand Down Expand Up @@ -80,7 +100,7 @@ function serve-apache() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -93,7 +113,7 @@ function serve-laravel() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -105,7 +125,7 @@ function serve-proxy() {
if [[ "$1" && "$2" ]]
then
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -118,7 +138,7 @@ function serve-silverstripe() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -131,7 +151,7 @@ function serve-spa() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -144,7 +164,7 @@ function serve-statamic() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -157,7 +177,7 @@ function serve-symfony2() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -170,7 +190,7 @@ function serve-symfony4() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -183,7 +203,7 @@ function serve-pimcore() {
then
sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1"
sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-7.4}"
sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.1}"
else
echo "Error: missing required parameters."
echo "Usage: "
Expand Down
16 changes: 14 additions & 2 deletions scripts/features/minio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ then
exit 0
fi

ARCH=$(arch)


touch /home/$WSL_USER_NAME/.homestead-features/minio
chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features

wget https://dl.minio.io/server/minio/release/linux-amd64/minio
if [[ "$ARCH" == "aarch64" ]]; then
curl -sO https://dl.minio.io/server/minio/release/linux-arm64/minio
else
curl -sO https://dl.minio.io/server/minio/release/linux-amd64/minio
fi

sudo chmod +x minio
sudo mv minio /usr/local/bin
Expand Down Expand Up @@ -49,7 +56,12 @@ sudo systemctl start minio
sudo ufw allow 9600

# Installing Minio Client
curl -sO https://dl.minio.io/client/mc/release/linux-amd64/mc
if [[ "$ARCH" == "aarch64" ]]; then
curl -sO https://dl.minio.io/client/mc/release/linux-arm64/mc
else
curl -sO https://dl.minio.io/client/mc/release/linux-amd64/mc
fi

chmod +x mc
sudo mv mc /usr/local/bin
mc config host add homestead http://127.0.1.1:9600 homestead secretkey
11 changes: 8 additions & 3 deletions scripts/homestead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.configure(config, settings)
config.vm.define settings['name'] ||= 'homestead'
config.vm.box = settings['box'] ||= 'laravel/homestead'
unless settings.has_key?('SpeakFriendAndEnter')
config.vm.box_version = settings['version'] ||= '>= 11.0.0, < 12.0.0'
config.vm.box_version = settings['version'] ||= '>= 12.0.0, < 13.0.0'
end
config.vm.hostname = settings['hostname'] ||= 'homestead'

Expand Down Expand Up @@ -378,7 +378,7 @@ def self.configure(config, settings)
site['to'], # $2
site['port'] ||= http_port, # $3
site['ssl'] ||= https_port, # $4
site['php'] ||= '8.0', # $5
site['php'] ||= '8.1', # $5
params ||= '', # $6
site['xhgui'] ||= '', # $7
site['exec'] ||= 'false', # $8
Expand Down Expand Up @@ -517,14 +517,19 @@ def self.configure(config, settings)
s.args = [var['key'], var['value']]
end

config.vm.provision 'shell' do |s|
s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php/8.1/fpm/pool.d/www.conf"
s.args = [var['key'], var['value']]
end

config.vm.provision 'shell' do |s|
s.inline = "echo \"\n# Set Homestead Environment Variable\nexport $1=$2\" >> /home/vagrant/.profile"
s.args = [var['key'], var['value']]
end
end

config.vm.provision 'shell' do |s|
s.inline = 'service php5.6-fpm restart;service php7.0-fpm restart;service php7.1-fpm restart; service php7.2-fpm restart; service php7.3-fpm restart; service php7.4-fpm restart; service php8.0-fpm restart;'
s.inline = 'service php5.6-fpm restart;service php7.0-fpm restart;service php7.1-fpm restart; service php7.2-fpm restart; service php7.3-fpm restart; service php7.4-fpm restart; service php8.0-fpm restart; service php8.1-fpm restart;'
end
end

Expand Down
4 changes: 2 additions & 2 deletions scripts/in-flight-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Without having to ship an entirely new base box.

# Fix expired certs: https://github.com/laravel/homestead/issues/1707
sudo rm -rf /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
sudo update-ca-certificates
# sudo rm -rf /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
# sudo update-ca-certificates

0 comments on commit cb72238

Please sign in to comment.