From 67ab8ae4adc94ba2a5bb3fab303b5f84b6e601c0 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jun 13 2016 09:35:54 +0000 Subject: Added a Vagrantfile to help test the theme --- diff --git a/.gitattributes b/.gitattributes index 5163ba8..74b71ec 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ README.rst export-ignore .gitattributes export-ignore +Vagrantfile export-ignore diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..37ee4a4 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,40 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +PORT = 5055 + +Vagrant.configure(2) do |config| + config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-libvirt.box" + config.vm.box = "f23-cloud-libvirt" + config.vm.network "forwarded_port", guest: 80, host: PORT + config.vm.synced_folder ".", "/vagrant", type: "sshfs" + + config.vm.provision "shell", inline: "dnf -y install mysql wget mysql-server mariadb-devel php rpl php-mysql" + config.vm.provision "shell", inline: "systemctl enable mariadb.service" + config.vm.provision "shell", inline: "systemctl start mariadb.service" + config.vm.provision "shell", inline: "pushd /tmp/; wget http://wordpress.org/latest.tar.gz; tar -xvzf latest.tar.gz -C /var/www/html; popd;" + + config.vm.provision "shell", inline: "mysql -h localhost -u root -e \"CREATE USER wordpress@localhost IDENTIFIED BY 'some_good_password_for_wordpress';\"" + config.vm.provision "shell", inline: "mysql -h localhost -u root -e \"CREATE DATABASE wordpress_blog;\"" + config.vm.provision "shell", inline: "mysql -h localhost -u root -e \"GRANT ALL ON wordpress_blog.* TO wordpress@localhost;\"" + config.vm.provision "shell", inline: "mysql -h localhost -u root -e \"FLUSH PRIVILEGES;\"" + + config.vm.provision "shell", inline: "rpl -e 'DocumentRoot \"/var/www/html\"' 'DocumentRoot \"/var/www/html/wordpress\"' /etc/httpd/conf/httpd.conf" + + config.vm.provision "shell", inline: "cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php" + config.vm.provision "shell", inline: "rpl -e \"define('DB_NAME', 'database_name_here');\" \"define('DB_NAME', 'wordpress_blog');\" /var/www/html/wordpress/wp-config.php" + config.vm.provision "shell", inline: "rpl -e \"define('DB_USER', 'username_here');\" \"define('DB_USER', 'wordpress');\" /var/www/html/wordpress/wp-config.php" + config.vm.provision "shell", inline: "rpl -e \"define('DB_PASSWORD', 'password_here');\" \"define('DB_PASSWORD', 'some_good_password_for_wordpress');\" /var/www/html/wordpress/wp-config.php" + + config.vm.provision "shell", inline: "systemctl enable httpd" + config.vm.provision "shell", inline: "systemctl start httpd" + + config.vm.provision "shell", inline: "pushd /tmp/; wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; chmod +x wp-cli.phar; mv wp-cli.phar /usr/bin/wp; popd;" + config.vm.provision "shell", inline: "pushd /var/www/html/wordpress/; wp core install --url='localhost:"+PORT.to_s+"' --title='pants' --admin_user='admin' --admin_password='password' --admin_email='null@fedoraproject.org'; popd;" + config.vm.provision "shell", inline: "pushd /var/www/html/wordpress/wp-content/themes/; ln -s /vagrant/fedoramagazine/ .; popd;" + config.vm.provision "shell", inline: "pushd /var/www/html/wordpress/; wp theme activate fedoramagazine; popd;" + config.vm.provision "shell", inline: "pushd /var/www/html/wordpress/; wp plugin install yet-another-related-posts-plugin --activate; popd;" + config.vm.provision "shell", inline: "pushd /var/www/html/wordpress/; wp plugin install co-authors-plus --activate; popd;" + config.vm.provision "shell", inline: "setenforce 0" + +end