Vvv: wpconfig_constants are not set when using the custom-site-template

Created on 14 Dec 2019  ยท  13Comments  ยท  Source: Varying-Vagrant-Vagrants/VVV




It's not possible to add an issue @ Varying-Vagrant-Vagrants/custom-site-template so I hope it's okay to open it here.

Expected Behavior



When using the custom site template each constant added to wpconfig_constants should be added to the wp-config.php.

Current Behavior



The constants don't get added to the wp-config.php.

Possible Solution


Steps to Reproduce (for bugs)



Example config/config.yaml

````yaml

sites:
my-site:
repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template
hosts:
- my-site.test
custom:
wpconfig_constants:
TEST: true
````

Logs


๐Ÿคœ vagrant reload --provision
__ __ __ __
\ V\ V\ V / Varying Vagrant Vagrants
 \_/\_/\_/  v3.2.0-git::master

Platform: platform-darwin13.4.0 shell:/bin/zsh vagrant-hostsupdater shared_db_folder_disabled , VVV Path: "/Users/simon/Dropbox/vvv"
Vagrant: v2.2.6, VirtualBox: vN/A

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Running Custom Vagrant file with additional vagrant configs at /Users/simon/Dropbox/vvv/Customfile

Finished running Custom Vagrant file with additional vagrant configs, resuming normal vagrantfile execution

==> default: Running action triggers before reload ...
==> default: Running trigger: VVV Pre-Reload...
    default: Running: inline script
    default: Performing Database Backups
    default: Backing up Database foundationpress...
    default: Database foundationpress backed up...
    default: Backing up Database my-site...
    default: Database my-site backed up...
    default: Backing up Database mybodydna...
    default: Database mybodydna backed up...
==> default: [vagrant-hostsupdater] Removing hosts
Password:
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'ubuntu/bionic64' version '20191121.0.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.2.8_KernelUbuntu r120774
    default: VirtualBox Version: 6.0
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] Writing the following entries to (/etc/hosts)
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv  # VAGRANT: 147f6dc8fd6b5c13047ff212ec766c35 (default) / 8699c278-95de-4835-876f-98ce0728567d
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv.test  # VAGRANT: 147f6dc8fd6b5c13047ff212ec766c35 (default) / 8699c278-95de-4835-876f-98ce0728567d
==> default: [vagrant-hostsupdater]   192.168.50.4  my-site.test  # VAGRANT: 147f6dc8fd6b5c13047ff212ec766c35 (default) / 8699c278-95de-4835-876f-98ce0728567d
==> default: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /srv/www => /Users/simon/Dropbox/vvv/www
    default: /srv/config => /Users/simon/Dropbox/vvv/config
    default: /var/log/php => /Users/simon/Dropbox/vvv/log/php
    default: /srv/database => /Users/simon/Dropbox/vvv/database/sql
    default: /var/log/nginx => /Users/simon/Dropbox/vvv/log/nginx
    default: /srv/provision => /Users/simon/Dropbox/vvv/provision
    default: /srv/certificates => /Users/simon/Dropbox/vvv/certificates
    default: /var/log/memcached => /Users/simon/Dropbox/vvv/log/memcached
    default: /var/log/provisioners => /Users/simon/Dropbox/vvv/log/provisioners
    default: /srv/www/foundationpress/public_html/wp-content/themes/FoundationPress => /Users/simon/Dropbox/Repos/FoundationPress
==> default: Running provisioner: file...
    default: /Users/simon/Dropbox/vvv/version => /home/vagrant/version
==> default: Running provisioner: default (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-16jnm0m.sh
    default:  * Beginning Main VVV Provisioner, if this is the first provision this may take a few minutes
    default:  * Testing network connection
    default:  * Succesful Network connection to ppa.launchpad.net detected...
    default: Bash profile setup and directories.
    default:  * Setting ownership of files in /home/vagrant to vagrant
    default:  * Copying /srv/config/bash_profile                      to /home/vagrant/.bash_profile
    default:  * Copying /srv/config/bash_aliases                      to /home/vagrant/.bash_aliases
    default:  * Copying /srv/config/vimrc                             to /home/vagrant/.vimrc
    default:  * Copying /srv/config/subversion-servers                to /home/vagrant/.subversion/servers
    default:  * Copying /srv/config/subversion-config                 to /home/vagrant/.subversion/config
    default:  * Copying /srv/config/ssh_known_hosts to /etc/ssh/ssh_known_hosts
    default:  * Copying /srv/config/sshd_config to /etc/ssh/sshd_config
    default:  * Reloading SSH Daemon
    default:  * Testing network connection
    default:  * Succesful Network connection to ppa.launchpad.net detected...
    default:
    default:  * Main packages check and install.
    default:  * git-core/ppa already present, skipping
    default:
    default:  * Setting up MySQL configuration file links...
    default:  * mysql group exists
    default:  * mysql user present and has uid 9001
    default: uid=9001(mysql) gid=9001(mysql) groups=9001(mysql),115(vboxsf)
    default:  * Copying /srv/config/mysql-config/vvv-core.cnf to /etc/mysql/conf.d/vvv-core.cnf
    default:  * Copying custom apt sources
    default:  * Checking Apt Keys
    default:  * Running apt-get update...
    default: Hit:1 https://deb.nodesource.com/node_10.x bionic InRelease
    default: Hit:2 http://mirrors.coreix.net/mariadb/repo/10.3/ubuntu bionic InRelease
    default: Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
    default: Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
    default: Hit:5 http://nginx.org/packages/mainline/ubuntu bionic InRelease
    default: Hit:6 http://archive.ubuntu.com/ubuntu bionic InRelease
    default: Hit:7 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
    default: Hit:8 http://ppa.launchpad.net/varying-vagrant-vagrants/php/ubuntu bionic InRelease
    default: Hit:9 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
    default: Hit:10 https://packagecloud.io/github/git-lfs/ubuntu bionic InRelease
    default: Reading package lists...
    default:  * Installing apt-get packages...
    default: Reading package lists...
    default: Building dependency tree...
    default: Reading state information...
    default: make is already the newest version (4.1-9.1ubuntu1).
    default: unzip is already the newest version (6.0-21ubuntu1).
    default: zip is already the newest version (3.0-11build1).
    default: colordiff is already the newest version (1.0.18-1).
    default: dos2unix is already the newest version (7.3.4-3).
    default: graphviz is already the newest version (2.40.1-2).
    default: ngrep is already the newest version (1.47+ds1-1).
    default: subversion is already the newest version (1.9.7-4ubuntu1).
    default: curl is already the newest version (7.58.0-2ubuntu3.8).
    default: g++ is already the newest version (4:7.4.0-1ubuntu2.3).
    default: gettext is already the newest version (0.19.8.1-6ubuntu0.3).
    default: git is already the newest version (1:2.17.1-1ubuntu0.5).
    default: imagemagick is already the newest version (8:6.9.7.4+dfsg-16ubuntu6.8).
    default: memcached is already the newest version (1.5.6-0ubuntu1.2).
    default: postfix is already the newest version (3.3.0-1ubuntu0.2).
    default: software-properties-common is already the newest version (0.96.24.32.11).
    default: vim is already the newest version (2:8.0.1453-1ubuntu1.1).
    default: git-svn is already the newest version (1:2.17.1-1ubuntu0.5).
    default: ntp is already the newest version (1:4.2.8p10+dfsg-5ubuntu7.1).
    default: python-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
    default: nginx is already the newest version (1.17.6-1~bionic).
    default: php-imagick is already the newest version (3.4.4-1+ubuntu18.04.1+deb.sury.org+20191129).
    default: php-memcache is already the newest version (3.0.9~20170802.e702b5f-3+ubuntu18.04.1+deb.sury.org+20191129).
    default: php-memcached is already the newest version (3.1.4+2.2.0-1+ubuntu18.04.1+deb.sury.org+20191129).
    default: php-pear is already the newest version (1:1.10.8+submodules+notgz-1+ubuntu18.04.1+deb.sury.org+1).
    default: php-ssh2 is already the newest version (1.1.2+0.13-5+ubuntu18.04.1+deb.sury.org+20191129).
    default: php-xdebug is already the newest version (2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1).
    default: php-yaml is already the newest version (2.0.4+1.3.2-1+ubuntu18.04.1+deb.sury.org+20191129).
    default: php7.2-bcmath is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-cli is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-common is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-curl is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-dev is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-fpm is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-gd is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-imap is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-json is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-mbstring is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-mysql is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-soap is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-xml is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: php7.2-zip is already the newest version (7.2.25-1+ubuntu18.04.1+deb.sury.org+1).
    default: mariadb-server is already the newest version (1:10.3.21+maria~bionic).
    default: nodejs is already the newest version (10.17.0-1nodesource1).
    default: git-lfs is already the newest version (2.9.2).
    default: 0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
    default:  * Removing unnecessary packages...
    default: Reading package lists...
    default: Building dependency tree...
    default: Reading state information...
    default: 0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
    default:  * Cleaning apt caches...
    default:  * Running tools_install
    default: Disabling XDebug if it's present
    default: Enabling tideways_xhprof and xhgui if installed
    default: WARNING: Module tideways_xhprof ini file doesn't exist under /etc/php/7.3/mods-available
    default: WARNING: Module tideways_xhprof ini file doesn't exist under /etc/php/7.3/mods-available
    default: WARNING: Module tideways_xhprof ini file doesn't exist under /etc/php/7.2/mods-available
    default: WARNING: Module tideways_xhprof ini file doesn't exist under /etc/php/7.2/mods-available
    default: WARNING: Module xhgui ini file doesn't exist under /etc/php/7.3/mods-available
    default: WARNING: Module xhgui ini file doesn't exist under /etc/php/7.3/mods-available
    default: WARNING: Module xhgui ini file doesn't exist under /etc/php/7.2/mods-available
    default: WARNING: Module xhgui ini file doesn't exist under /etc/php/7.2/mods-available
    default: Restarting PHP FPM's
    default: XDebug is turned off
    default:  * Checking for NVM
    default:  * Installing/updating npm...
    default: /usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
    default: /usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
    default: + [email protected]
    default: updated 1 package in 6.219s
    default:  * Installing/updating npm-check-updates...
    default: /usr/bin/npm-check-updates -> /usr/lib/node_modules/npm-check-updates/bin/npm-check-updates
    default: /usr/bin/ncu -> /usr/lib/node_modules/npm-check-updates/bin/ncu
    default: + [email protected]
    default: updated 1 package in 8.185s
    default:  * ack-grep already installed
    default:  * Making sure the composer cache is not owned by root
    default:  * Checking for Composer
    default:  * Updating Composer...
    default: Changed current directory to /usr/local/src/composer
    default: You are already using composer version 1.9.1 (stable channel).
    default: Changed current directory to /usr/local/src/composer
    default: ./composer.json has been updated
    default: Changed current directory to /usr/local/src/composer
    default: Loading composer repositories with package information
    default: Updating dependencies (including require-dev)
    default: Nothing to install or update
    default: Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
    default: Generating autoload files
    default:  * Updating Grunt CLI
    default:  * Updated Grunt CLI
    default:  * Adding graphviz symlink for Webgrind...
    default:  * Installing Shyaml for bash provisioning..
    default: Requirement already satisfied: shyaml in /usr/local/lib/python2.7/dist-packages
    default: Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/dist-packages (from shyaml)
    default:
    default:  * Setup configuration files...
    default:  * Copying /srv/config/init/vvv-start.conf               to /etc/init/vvv-start.conf
    default:  * Copying /srv/config/nginx-config/nginx.conf           to /etc/nginx/nginx.conf
    default:  * Copying /srv/config/nginx-config/nginx-wp-common.conf to /etc/nginx/nginx-wp-common.conf
    default:  * Copying /srv/config/nginx-config/php7.2-upstream.conf to /etc/nginx/upstreams/php72.conf
    default:  * Rsync'ing /srv/config/nginx-config/sites/             to /etc/nginx/custom-sites
    default: sending incremental file list
    default: deleting vvv-auto-mybodydna-provision-beed77dc08b88dc30f644ce83b33b007.conf
    default: deleting vvv-auto-my-site-provision-47852a458794de4e6c6d62088d153e8c.conf
    default: deleting vvv-auto-foundationpress-provision-28dea2d0d63652f116a48f09fafb2186.conf
    default: default.conf
    default: local-nginx-example.conf-sample
    default: sent 1.90K bytes  received 268 bytes  4.34K bytes/sec
    default: total size is 4.08K  speedup is 1.88
    default:  * Making sure the Nginx log files and folder exist
    default:  * Starting MailHog
    default:  * Copying /srv/config/php-config/php7.2-fpm.conf   to /etc/php/7.2/fpm/php-fpm.conf
    default:  * Copying /srv/config/php-config/php7.2-www.conf   to /etc/php/7.2/fpm/pool.d/www.conf
    default:  * Copying /srv/config/php-config/php7.2-custom.ini to /etc/php/7.2/fpm/conf.d/php-custom.ini
    default:  * Copying /srv/config/php-config/opcache.ini       to /etc/php/7.2/fpm/conf.d/opcache.ini
    default:  * Copying /srv/config/php-config/xdebug.ini        to /etc/php/7.2/mods-available/xdebug.ini
    default:  * Copying /srv/config/php-config/mailhog.ini       to /etc/php/7.2/mods-available/mailhog.ini
    default:  * Copying /srv/config/memcached-config/memcached.conf to /etc/memcached.conf and /etc/memcached_default.conf
    default:
    default:  * Restarting services...
    default:
    default:  * Setup MySQL configuration file links...
    default:  * Copied /srv/config/mysql-config/my.cnf               to /etc/mysql/my.cnf
    default:  * Copied /srv/config/mysql-config/root-my.cnf          to /home/vagrant/.my.cnf
    default:  * service mysql restart
    default:
    default:  * No custom MySQL scripting found in database/init-custom.sql, skipping...
    default:  * Initial MySQL prep...
    default:
    default: Starting MariaDB Database Import
    default:  * Creating the foundationpress table if it doesn't already exist, and granting the wp user access
    default:   * Skipped import of foundationpress - tables exist
    default:  * Creating the my-site table if it doesn't already exist, and granting the wp user access
    default:   * Skipped import of my-site - tables exist
    default:  * Creating the mybodydna table if it doesn't already exist, and granting the wp user access
    default:   * Skipped import of mybodydna - tables exist
    default: Databases imported
    default:  * Testing network connection
    default:  * Succesful Network connection to ppa.launchpad.net detected...
    default:
    default:  * Installing/updating wp-cli and debugging tools
    default:
    default:  * Updating wp-cli...
    default: Downloading from https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar...
    default: md5 hash verified: 2a9834f6bba6341eb0db4f95aa8b9ede
    default: New version works. Proceeding to replace.
    default: Success: Updated WP-CLI to the latest nightly release.
    default:
    default:  * Install/Update PHP_CodeSniffer (phpcs), see https://github.com/squizlabs/PHP_CodeSniffer
    default:
    default:  * Install/Update WordPress-Coding-Standards, sniffs for PHP_CodeSniffer, see https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
    default: Loading composer repositories with package information
    default:
    default:
    default:
    default: Updating dependencies (including require-dev)
    default: Nothing to install or update
    default: Using config file: /srv/www/phpcs/CodeSniffer.conf
    default:
    default: Config value "installed_paths" updated successfully; old value was "./CodeSniffer/Standards/WordPress/,./CodeSniffer/Standards/VIP-Coding-Standards/,./CodeSniffer/Standards/PHPCompatibility/,./CodeSniffer/Standards/PHPCompatibilityParagonie/,./CodeSniffer/Standards/PHPCompatibilityWP/"
    default: Using config file: /srv/www/phpcs/CodeSniffer.conf
    default:
    default: Config value "default_standard" updated successfully; old value was "WordPress-Core"
    default: The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1, PSR12, WordPress, WordPress-Extra, WordPress-Docs, WordPress-Core, WordPressVIPMinimum, WordPress-VIP-Go, PHPCompatibility, PHPCompatibilityParagonieRandomCompat, PHPCompatibilityParagonieSodiumCompat and PHPCompatibilityWP
    default:  * Testing network connection
    default:  * Succesful Network connection to ppa.launchpad.net detected...
    default:
    default:  * Searching for SVN repositories that need upgrading
    default:
    default:  * Cleaning up Nginx configs
    default:  * Cleaning the virtual machine's /etc/hosts file...
    default:  -----------------------------
    default:  * Provisioning complete in 48 seconds
    default:  * For further setup instructions, visit http://vvv.test
==> default: Running provisioner: dashboard (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-6n1n6j.sh
    default:
    default: Updating dashboard on the master branch...
==> default: Running provisioner: utility-source-core (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-192wwmn.sh
    default:  * Updating the "core" utility on the "master" branch...
==> default: Running provisioner: utility-core-memcached-admin (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-hanidv.sh
    default:  * Running utility provisioner for 'core/memcached-admin'
    default:  * The 'core/memcached-admin' provisioner completed in 0 seconds
==> default: Running provisioner: utility-core-opcache-status (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-oq7khz.sh
    default:  * Running utility provisioner for 'core/opcache-status'
    default: From https://github.com/rlerdorf/opcache-status
    default:  * branch            master     -> FETCH_HEAD
    default:  * The 'core/opcache-status' provisioner completed in 1 seconds
==> default: Running provisioner: utility-core-phpmyadmin (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-wox25z.sh
    default:  * Running utility provisioner for 'core/phpmyadmin'
    default:  * The 'core/phpmyadmin' provisioner completed in 0 seconds
==> default: Running provisioner: utility-core-webgrind (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-1bbfn7q.sh
    default:  * Running utility provisioner for 'core/webgrind'
    default: Loading composer repositories with package information
    default: Updating dependencies (including require-dev)
    default: Nothing to install or update
    default:  * The 'core/webgrind' provisioner completed in 1 seconds
==> default: Running provisioner: utility-core-trusted-hosts (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-wzoaev.sh
    default:  * Running utility provisioner for 'core/trusted-hosts'
    default:  * The 'core/trusted-hosts' provisioner completed in 0 seconds
==> default: Running provisioner: utility-core-tls-ca (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-1xaxp1d.sh
    default:  * Running utility provisioner for 'core/tls-ca'
    default:  * The 'core/tls-ca' provisioner completed in 1 seconds
==> default: Running provisioner: utility-core-php72 (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-150rbii.sh
    default:  * Running utility provisioner for 'core/php72'
    default:  * The 'core/php72' provisioner completed in 3 seconds
==> default: Running provisioner: utility-core-php73 (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-1q8ypx6.sh
    default:  * Running utility provisioner for 'core/php73'
    default:  * The 'core/php73' provisioner completed in 4 seconds
==> default: Running provisioner: site-my-site (shell)...
    default: Running: /var/folders/96/z72j0_5n4r54_4p625zg2cbr0000gn/T/vagrant-shell20191214-58404-149lmd6.sh
    default:  * Running provisioner for site my-site
    default:  * Updating my-site in /srv/www/my-site...
    default:  * Searching for a site template provisioner, vvv-init.sh
    default:  * Found vvv-init.sh at /srv/www/my-site/provision/vvv-init.sh
    default:  * Script output will be logged to: log/provisioners/20191214-153513/provisioner-site-my-site.log
    default:  * Site provisioner script finished successfully
    default:  * Adding domains to the virtual machine's /etc/hosts file...
    default:  * Adding hosts from the VVV config entry
    default:    - Added my-site.test from /vagrant/config.yml
    default:  * Reloading Nginx
    default:  * my-site provisioning finished in 4 seconds
==> default: Running action triggers after reload ...
==> default: Running trigger: VVV Post-Reload...
    default: Running: inline script
    default: Post Vagrant up script
    default: Restarting Nginx and MySQL
    default:
    default:          yay
    default:    โ–„โ–€โ–€โ–€โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–€โ–€โ–€โ–„                __ __ __ __
    default:    โ–ˆโ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–ˆ    Thanks for  \ V\ V\ V /
    default:     โ–ˆโ–‘โ–‘โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–‘โ–‘โ–ˆ     using        \_/\_/\_/
    default:  โ–„โ–„  โ–ˆโ–‘โ–‘โ–‘โ–€โ–ˆโ–€โ–‘โ–‘โ–‘โ–ˆ  โ–„โ–„
    default: โ–ˆโ–‘โ–‘โ–ˆ โ–€โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–€ โ–ˆโ–‘โ–‘โ–ˆ Vagrant Up has finished! Visit http://vvv.test
    default:

bug

Most helpful comment

PR got merged, closing

All 13 comments

@SimonMayerhofer can you get me a look at log/provisioners/20191214-153513/provisioner-site-my-site.log?

It's not possible to add a issue @ Varying-Vagrant-Vagrants/custom-site-template so I hope it's okay to open it here.

That's intended, all issues for the entire org go in here!

As an aside, when you added the config options, was the site already provisioned? Or is this a first provision of a brand new site?

Sure, here you go:

````
 * Running provisioner for site my-site

  • Updating my-site in /srv/www/my-site...
  • Searching for a site template provisioner, vvv-init.sh
  • Found vvv-init.sh at /srv/www/my-site/provision/vvv-init.sh
  • Script output will be logged to: log/provisioners/20191214-153513/provisioner-site-my-site.log
  • Custom site template provisioner - downloads and installs a copy of WP stable for testing, building client sites, etc
  • Creating database 'my-site' (if it's not already there)
  • Granting the wp user priviledges to the 'my-site' database
  • DB operations done.
  • Setting up the log subfolder for Nginx logs
  • Creating public_html folder if it doesn't exist already
    Updating WordPress Stable...
    Success: WordPress is up to date.
    Copying the sites Nginx config template
    Using the default vvv-nginx-default.conf, to customize, create a vvv-nginx-custom.conf
  • Site Template provisioner script completed
     * Site provisioner script finished successfully
  • Adding domains to the virtual machine's /etc/hosts file...
  • Adding hosts from the VVV config entry

    • Added my-site.test from /vagrant/config.yml

  • Reloading Nginx
     * my-site provisioning finished in 4 seconds

````

As an aside, when you added the config options, was the site already provisioned? Or is this a first provision of a brand new site?

I added them before the first provision. But also on following provisions the constants won't be added.

The code is at https://github.com/Varying-Vagrant-Vagrants/custom-site-template/blob/master/provision/vvv-init.sh#L154
Maybe we can add more verbosity in those loop to see what is happening.

GitHub
For when you just need a simple dev site. Contribute to Varying-Vagrant-Vagrants/custom-site-template development by creating an account on GitHub.

I saw you added more verbosity. This is the log now:

````
 * Running provisioner for site my-site

Downloading my-site, git cloning from https://github.com/Varying-Vagrant-Vagrants/custom-site-template into /srv/www/my-site
my-site Site Template clone succesful

  • Searching for a site template provisioner, vvv-init.sh
  • Found vvv-init.sh at /srv/www/my-site/provision/vvv-init.sh
  • Script output will be logged to: log/provisioners/20191227-142640/provisioner-site-my-site.log
  • Custom site template provisioner my-site - downloads and installs a copy of WP stable for testing, building client sites, etc
  • Creating database 'my-site' (if it's not already there)
  • Granting the wp user priviledges to the 'my-site' database
  • DB operations done.
  • Setting up the log subfolder for Nginx logs
  • Creating public_html folder if it doesn't exist already
  • Install type is 'single'
  • Downloading WordPress version 'latest' locale: 'en_US'
    Downloading WordPress 5.3.2 (en_US)...
    Using cached file '/home/vagrant/.wp-cli/cache/core/wordpress-5.3.2-en_US.tar.gz'...
    Success: WordPress downloaded.
  • Setting up wp-config.php
    Success: Generated 'wp-config.php' file.
  • Updating WordPress 'latest'
    Success: WordPress is up to date.
  • Copying the sites Nginx config template
  • Using the default vvv-nginx-default.conf, to customize, create a vvv-nginx-custom.conf
  • Site Template provisioner script completed for my-site
     * Site provisioner script finished successfully
  • Adding domains to the virtual machine's /etc/hosts file...
  • Adding hosts from the VVV config entry

    • Added my-site.test from /vagrant/config.yml

  • Reloading Nginx
     * my-site provisioning finished in 14 seconds

````

Seems like it doesn't reach the code for adding the constants. Have you tried the functionality on your machine and is it working there?

Tested and fixed the issue :-)
You can test it on your config.yaml adding a new value branch:Mte90/fix-2031 with a new provision.

It works, thank you ๐Ÿ‘ only improvement I want to suggest is to add numeric values with the --raw flag as well.

Good idea, I can do another check for those!

Added can you test it again?
We need more testers for VVV stuff, any help is very valuable for the project :-)

Thanks for expanding it! Unfortunately it didn't work. This was in my config:

````
my-site:
#repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template
hosts:
- my-site.test
custom:
wpconfig_constants:
TEST: true
TEST2: true
TEST3: 3
TESTD: 3.2
TESTF: 3.0
TESTFD: 12313.0
TESTFA: 0.92929929929929
TSDF: "asdasdasd"
ADASLKD: asdlkasdnalsdknar

````

This got printed to the wp-config:

define( 'TEST', True ); define( 'TEST2', True ); define( 'TEST3', '3' ); define( 'TESTD', '3.2' ); define( 'TESTF', '3.0' ); define( 'TESTFD', '12313.0' ); define( 'TESTFA', '0.929299299299' ); define( 'TSDF', 'asdasdasd' ); define( 'ADASLKD', 'asdlkasdnalsdknar' );

Relevant Logs:

default: The site: 'my-site' does not have a site template, assuming custom provision/vvv-init.sh and provision/vvv-nginx.conf default: * Searching for a site template provisioner, vvv-init.sh default: * Found vvv-init.sh at /srv/www/my-site/provision/vvv-init.sh default: * Script output will be logged to: log/provisioners/20200104-233119/provisioner-site-my-site.log default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: vvv-init.sh: line 167: [: =~: binary operator expected default: * Site provisioner script finished successfully

Thanks for the examples, I tested and fixed it.
You can do a new test? So we can approve the pr and close the ticket :-)

Thanks for fixing it! It worked ๐Ÿฅณ

PR got merged, closing

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings