-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
181 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.* | ||
/examples/ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
|
||
[*.{json,yml,yaml,js}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Vagrantfile] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/vendor | ||
/.vagrant | ||
/composer.lock | ||
/node_modules | ||
/composer.lock | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Layout/AlignParameters: | ||
EnforcedStyle: with_fixed_indentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: ruby | ||
|
||
install: | ||
- bundle install | ||
|
||
script: | ||
- bash -c 'shopt -s globstar; shellcheck **/*.sh' | ||
- rubocop | ||
|
||
notifications: | ||
email: false | ||
|
||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rubocop' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
projectPath = ENV["PWD"] | ||
localPath = File.dirname(__FILE__) | ||
project_path = ENV['PWD'] | ||
local_path = File.dirname(__FILE__) | ||
|
||
Vagrant.configure(2) do |config| | ||
|
||
config.vm.box = "ubuntu/xenial64" | ||
config.vm.network "private_network", type: "dhcp" | ||
config.vm.synced_folder projectPath, "/vagrant" | ||
config.vm.box = 'ubuntu/xenial64' | ||
config.vm.network 'private_network', type: 'dhcp' | ||
config.vm.synced_folder project_path, '/vagrant' | ||
|
||
# Rename ubuntu-xenial-16.04-cloudimg-console.log to console.log | ||
config.vm.provider "virtualbox" do |vb| | ||
vb.customize ["modifyvm", :id, "--uartmode1", "file", "console.log"] | ||
config.vm.provider 'virtualbox' do |vb| | ||
vb.customize ['modifyvm', :id, '--uartmode1', 'file', 'console.log'] | ||
end | ||
|
||
config.vm.provision :shell, | ||
path: File.join(localPath, 'scripts/vagrant/provision.sh') | ||
|
||
config.vm.provision :shell, | ||
path: File.join(localPath, 'scripts/vagrant/up.sh'), | ||
run: "always" | ||
config.vm.provision 'shell', | ||
path: File.join(local_path, 'scripts/vagrant/provision.sh') | ||
|
||
config.vm.provision 'shell', | ||
path: File.join(local_path, 'scripts/vagrant/up.sh'), | ||
run: 'always' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
/.vagrant/ | ||
/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Configure the hostname. | ||
Vagrant.configure(2) do |config| | ||
config.vm.hostname = 'wpsh-local' | ||
end | ||
|
||
load File.join( | ||
File.dirname(__FILE__), | ||
'vendor/wpsh/local/Vagrantfile' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"require": {}, | ||
"require-dev": { | ||
"wpsh/local": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: '3' | ||
|
||
services: | ||
|
||
mysql: | ||
image: mysql:5 | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
restart: always | ||
environment: | ||
MYSQL_DATABASE: wordpress | ||
MYSQL_USER: wordpress | ||
MYSQL_PASSWORD: password | ||
MYSQL_ROOT_PASSWORD: password | ||
|
||
wordpress: | ||
image: wordpress:latest | ||
links: | ||
- mysql:mysql | ||
depends_on: | ||
- mysql | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- wp_data:/var/www/html | ||
- "./plugin:/var/www/html/wp-content/plugins/plugin:ro" # Without "ro" flags it can't access the directory. | ||
restart: always | ||
environment: | ||
WORDPRESS_DEBUG: 1 | ||
WORDPRESS_DB_USER: wordpress | ||
WORDPRESS_DB_PASSWORD: password | ||
|
||
wpcli: | ||
image: wordpress:cli | ||
depends_on: | ||
- mysql | ||
- wordpress | ||
volumes: | ||
- wp_data:/var/www/html | ||
|
||
volumes: | ||
db_data: {} | ||
wp_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Demo Plugin Red | ||
* Version: 0.0.1 | ||
*/ | ||
|
||
add_action( 'wp_footer', function() { | ||
?> | ||
<style type="text/css">body { background-color: red; }</style> | ||
<?php | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# WordPress Development Environment | ||
|
||
An example of a WordPress development environment created using Docker running inside Vagrant. | ||
|
||
- `Vagrantfile` loads the Vagrant virtual environment defined in `vendor/wpsh/local/Vagrantfile`. | ||
|
||
- `docker-compose.yaml` defines the development environment -- mounts the `plugin` directory to `/var/www/html/wp-content/plugins/plugin` inside the Docker container. | ||
|
||
Use `vagrant up` to start the environment which will be available at `wpsh-local.local`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd /vagrant | ||
# See https://github.com/koalaman/shellcheck/wiki/SC2164 for why the exit. | ||
cd /vagrant || exit | ||
|
||
docker-compose up --detach --remove-orphans | ||
|
||
echo "Done! Please wait a few seconds before the containers are up." | ||
echo "Hostname: $HOSTNAME" | ||
echo "Hostname: $HOSTNAME" |