-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #441 from openeyes/release/v1.16
Release/v1.16
- Loading branch information
Showing
2,948 changed files
with
196,218 additions
and
146,161 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
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,68 +1,102 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
$puppet_install_script = <<SCRIPT | ||
apt-get install --yes lsb-release | ||
DISTRIB_CODENAME=$(lsb_release --codename --short) | ||
DEB="puppetlabs-release-${DISTRIB_CODENAME}.deb" | ||
DEB_PROVIDES="/etc/apt/sources.list.d/puppetlabs.list" | ||
if [ ! -e $DEB_PROVIDES ] | ||
then | ||
# Print statement useful for debugging, but automated runs of this will interpret any output as an error | ||
# print "Could not find $DEB_PROVIDES - fetching and installing $DEB" | ||
wget -q http://apt.puppetlabs.com/$DEB | ||
sudo dpkg -i $DEB | ||
fi | ||
sudo apt-get update | ||
sudo apt-get install --yes puppet=3.8.4-1puppetlabs1 | ||
SCRIPT | ||
|
||
# quick solution (hopefully) for installing the chromedriver for use with selenium | ||
$chromedriver_install_script = <<SCRIPT | ||
if [ ! -e "/usr/bin/chromedriver" ] | ||
then | ||
sudo apt-get install unzip | ||
wget -N http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip -P /tmp/ | ||
unzip -o /tmp/chromedriver_linux64.zip -d /tmp | ||
chmod a+x /tmp/chromedriver | ||
sudo mv /tmp/chromedriver /usr/local/share/chromedriver | ||
sudo ln -fs /usr/local/share/chromedriver /usr/bin/chromedriver | ||
fi | ||
SCRIPT | ||
Vagrant.require_version ">= 1.8.1" | ||
|
||
require 'getoptlong' | ||
|
||
opts = GetoptLong.new( | ||
[ '--hostname', GetoptLong::OPTIONAL_ARGUMENT ], | ||
[ '--servername', GetoptLong::OPTIONAL_ARGUMENT ] | ||
) | ||
|
||
hostname = 'openeyes.vm' | ||
servername = 'OpenEyes Dev Server' | ||
|
||
opts.each do |opt, arg| | ||
case opt | ||
when '--hostname' | ||
hostname = arg | ||
when '--servername' | ||
servername = arg | ||
end | ||
end | ||
|
||
PLUGINS = %w(vagrant-auto_network vagrant-hostsupdater vagrant-cachier) | ||
|
||
PLUGINS.reject! { |plugin| Vagrant.has_plugin? plugin } | ||
|
||
unless PLUGINS.empty? | ||
print "The following plugins will be installed: #{PLUGINS.join ", "} continue? [Y/n]: " | ||
unless ['no', 'n'].include? $stdin.gets.strip.downcase | ||
PLUGINS.each do |plugin| | ||
system("vagrant plugin install #{plugin}") | ||
puts | ||
end | ||
end | ||
puts "Please run again" | ||
exit 1 | ||
end | ||
|
||
# Check to determine whether we're on a windows or linux/os-x host, | ||
# http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps | ||
module OS | ||
def OS.windows? | ||
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil | ||
end | ||
end | ||
|
||
AutoNetwork.default_pool = "172.16.0.0/24" | ||
|
||
Vagrant.configure("2") do |config| | ||
|
||
vagrant_version = Vagrant::VERSION.sub(/^v/, '') | ||
if vagrant_version < "1.3.0" | ||
abort(sprintf("You need to have at least v1.3.0 of vagrant installed. You are currently using v%s", vagrant_version)); | ||
end | ||
config.vm.box = "ubuntu/trusty64" | ||
|
||
config.vm.box = "precise64" | ||
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | ||
config.vm.network "private_network", :auto_network => true | ||
|
||
config.vm.network :forwarded_port, host: 8888, guest: 80 | ||
config.vm.network :forwarded_port, host: 3333, guest: 3306 | ||
config.vm.network "private_network", ip: "192.168.0.100" | ||
config.vm.synced_folder "./", "/var/www/openeyes", id: "vagrant-root", | ||
owner: "vagrant", | ||
group: "www-data", | ||
mount_options: ["dmode=775,fmode=664"] | ||
|
||
config.vm.synced_folder "./", "/var/www", id: "vagrant-root" | ||
config.vm.hostname = hostname | ||
config.hostsupdater.remove_on_suspend = true | ||
|
||
# for display | ||
config.vm.network :forwarded_port, guest: 5900, host: 5900 | ||
# Prefer VMware Fusion before VirtualBox | ||
config.vm.provider "vmware_fusion" | ||
config.vm.provider "virtualbox" | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.customize ["modifyvm", :id, "--memory", 2024] | ||
# to enable selenium testing | ||
config.vm.provider(:virtualbox) do |v| | ||
v.customize [ | ||
"modifyvm", :id, | ||
"--name", servername, | ||
"--memory", 1024, | ||
"--natdnshostresolver1", "on", | ||
"--cpus", 2, | ||
] | ||
v.gui = true | ||
end | ||
|
||
config.vm.provision "shell", inline: $puppet_install_script | ||
config.vm.provision "shell", inline: $chromedriver_install_script | ||
# VMWare Fusion | ||
config.vm.provider(:vmware_fusion) do |v, override| | ||
override.vm.box = "puppetlabs/ubuntu-14.04-64-nocm" | ||
v.vmx["displayname"] = servername | ||
v.vmx["memsize"] = "1024" | ||
v.vmx["numvcpus"] = "2" | ||
# v.gui = true | ||
end | ||
|
||
config.vm.provision :puppet do |puppet| | ||
puppet.manifests_path = "puppet" | ||
puppet.manifest_file = "default.pp" | ||
puppet.module_path = "puppet/modules" | ||
puppet.facter = { 'mode' => "dev", 'runsubfolder' => false } | ||
# puppet.options = "--verbose --debug" | ||
end | ||
end | ||
if OS.windows? | ||
config.vm.provision :shell, path: "ansible/windows.sh", args: ["default"] | ||
else | ||
config.vm.provision "ansible_local" do |ansible| | ||
ansible.playbook = "ansible/playbook.yml" | ||
# ansible.verbose = "vvv" # Debug | ||
end | ||
end | ||
|
||
config.cache.synced_folder_opts = { | ||
mount_options: ["rw", "vers=3", "tcp", "nolock"] | ||
} | ||
|
||
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,6 @@ | ||
[ssh_connection] | ||
pipelining=True | ||
|
||
[galaxy] | ||
server=https://galaxy-qa.ansible.com | ||
ansible_roles=./roles |
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 @@ | ||
# install_roles.yml | ||
|
||
# From galaxy | ||
- src: geerlingguy.apache | ||
- src: geerlingguy.composer | ||
- src: geerlingguy.mysql | ||
- src: geerlingguy.nodejs | ||
- src: geerlingguy.php | ||
- src: pludoni.wkthmltox |
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 @@ | ||
[phansible-web] | ||
192.168.33.99 |
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 @@ | ||
default |
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,27 @@ | ||
--- | ||
- name: OpenEyes Development Server | ||
|
||
hosts: all | ||
|
||
become: true | ||
become_method: sudo | ||
|
||
vars_files: | ||
- vars/all.yml | ||
|
||
pre_tasks: | ||
- include: tasks/init-debian.yml | ||
when: ansible_os_family == 'Debian' | ||
- include: tasks/init-redhat.yml | ||
when: ansible_os_family == 'RedHat' | ||
|
||
roles: | ||
- server | ||
- vagrant_local | ||
- geerlingguy.apache | ||
- geerlingguy.mysql | ||
- geerlingguy.nodejs | ||
- geerlingguy.php | ||
- geerlingguy.composer | ||
- pludoni.wkthmltox | ||
- app |
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 @@ | ||
--- | ||
- name: restart apache | ||
service: name=apache2 enabled=yes state=restarted |
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,29 @@ | ||
--- | ||
- name: Install Apache | ||
become: true | ||
apt: pkg=apache2 state=latest | ||
|
||
- name: Install Apache Modules | ||
apache2_module: state=present name={{ item }} | ||
notify: restart apache | ||
with_items: | ||
- rewrite | ||
- vhost_alias | ||
- headers | ||
- expires | ||
- filter | ||
|
||
- shell: apache2 -v | ||
register: apache_version | ||
|
||
- name: Change default apache2.4 site | ||
become: true | ||
template: src=vhost24.conf.tpl dest=/etc/apache2/sites-available/000-default.conf | ||
notify: restart apache | ||
when: apache_version.stdout.find('Apache/2.4.') != -1 | ||
|
||
- name: Change default apache2.2 site | ||
become: true | ||
template: src=vhost22.conf.tpl dest=/etc/apache2/sites-available/default | ||
notify: restart apache | ||
when: apache_version.stdout.find('Apache/2.2.') != -1 |
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,14 @@ | ||
# Default Apache virtualhost template | ||
|
||
<VirtualHost *:80> | ||
ServerAdmin webmaster@localhost | ||
DocumentRoot {{ apache.docroot }} | ||
ServerName {{ apache.servername }} | ||
|
||
<Directory {{ apache.docroot }}> | ||
AllowOverride All | ||
Options -Indexes FollowSymLinks | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
</VirtualHost> |
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,13 @@ | ||
# Default Apache virtualhost template | ||
|
||
<VirtualHost *:80> | ||
ServerAdmin webmaster@localhost | ||
DocumentRoot {{ apache.docroot }} | ||
ServerName {{ apache.servername }} | ||
|
||
<Directory {{ apache.docroot }}> | ||
AllowOverride All | ||
Options -Indexes +FollowSymLinks | ||
Require all granted | ||
</Directory> | ||
</VirtualHost> |
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 @@ | ||
--- | ||
php_xdebug_remote_enable: "false" | ||
php_xdebug_remote_connect_back: "false" | ||
php_xdebug_remote_host: localhost | ||
php_xdebug_remote_port: "9000" | ||
php_xdebug_remote_log: /tmp/xdebug.log | ||
php_xdebug_remote_autostart: "false" | ||
php_xdebug_idekey: XDEBUG | ||
php_max_nesting_level: 200 |
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,5 @@ | ||
--- | ||
- name: restart apache | ||
service: | ||
name: "{{ apache_service }}" | ||
state: restarted |
Oops, something went wrong.