virtual MODX development-environment cooked in Vagrant,
provisioned with Ansible, powered by Gitify
The workflow uses Gitify from modmore which is a CLI-App for transferring/migrating MODX DB-data.
Currently this server expects to be inside a Gitify project, like this:
Directory-Overview
/
:: Root / Configuration Files / Scripts/_backup
:: Gitify Backup Directory/_data
:: Gitify Object Directory/server
◀️ (you are here) :: Directory for MODX Local Development Server/www
:: Webroot / MODX Directory (only necessary files should get versioned/transferred)
This means it expects a valid
.gitify
configuration-file inside/www
What does it do?
- Creates a VM
- Vagrant box based on ubuntu-16.04
- Provisions VM
- Installs and configures:
- mysql
- apache
- php-fpm
- phpmyadmin (work-in-progress)
- composer
- git
- unzip
- Gitify
- Installs and configures:
- Download and install newest OpenSSL
- Creates self-signed certificate
- Upgrade Apache2 to newest version
- Enable Apache2-modules (headers-module, expires-module, ssl-module, http2-module)
- Creates MySQL database and user
- Installs MODX and Extras
- Builds MODX
_data
- Opens the browser when done
- VirtualBox
sudo apt install virtualbox
- Vagrant
sudo apt install vagrant
- Ansible
sudo apt update sudo apt install software-properties-common sudo apt-add-repository --yes --update ppa:ansible/ansible sudo apt install ansible
Add as sub-module to your project:
git submodule add https://github.com/xvanced/modx-server server
cd server
Initialize:
./init.sh
To manually start the vm or bring it back up:
./vm-start.sh
or vagrant up
Stop the machine:
./vm-halt.sh
or vagrant halt
Destroy the machine and delete MODX files:
./vm-halt.sh
Destroy only the machine:
vagrant destroy
Check status of machine:
vagrant status
Update the box of the vm:
vagrant box update
-
SSH into the local server:
vagrant ssh
-
Change into public directory:
cd /var/www/html
You should be inside your mapped web-root.
Inside the machine, if the setup fails, you might need one the following:
sudo -su www-data php -d date.timezone=Europe/Berlin ./index.php --installmode=new
sudo -su www-data php -d date.timezone=Europe/Berlin ./index.php --installmode=new --core_path=/path/to/core/ --config_key=config
sudo -su www-data php -d date.timezone=Europe/Berlin ./index.php --installmode=upgrade
mysqlshow --user=xvModxUser --password=xvModxPassword xvModxDatabase
Inside your public directory you can use Gitify for the follow tasks:
Get the latest MODX:
Gitify modx:install
Get a specified MODX:
Gitify modx:install 2.5.6-pl -vvv
Upgrade to a specified MODX:
Gitify modx:upgrade 2.6.0-pl
Note: Install MODX used in your project first and upgrade from there to every patch version until you reach the most current.
Install all packages specified in your .gitify
config:
Gitify package:install --all
Extract MODX Data:
Gitify extract
Build MODX Data:
Gitify build
Backup MODX Data:
Gitify backup filename
Restore MODX Data:
Gitify restore
One-Liner with options:
Gitify modx:install && Gitify package:install --all && Gitify build --no-backup --force
Written by Sebastian G. Marinescu