summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-05-23 12:26:46 -0400
committerMicah Anderson <micah@riseup.net>2013-05-23 12:26:46 -0400
commit8e1e75bafd5a9ae8dc67ee73eebbaafbf120d07e (patch)
treeb8c7b1fb15579460a12356ee2e095398007d3e47
parentb6f13776c45b826b42bb1297f2df8fac8cdad893 (diff)
parente0b591b063d3c49012a4266ee837737758f58dc2 (diff)
Merge branch 'feature/switch-webapp-location' into develop
Conflicts: puppet/modules/site_webapp/manifests/init.pp Resolved lint differences Change-Id: Ifbc535ec844222c9f6f0dd71ac12742230bb64ee
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/api.conf.erb2
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb2
-rw-r--r--puppet/modules/site_webapp/files/migrate_design_documents2
-rw-r--r--puppet/modules/site_webapp/manifests/couchdb.pp8
-rw-r--r--puppet/modules/site_webapp/manifests/init.pp36
5 files changed, 26 insertions, 24 deletions
diff --git a/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
index 20d3dc9a..ae894cd4 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
@@ -21,7 +21,7 @@ Listen 0.0.0.0:<%= api_port %>
RequestHeader set X_FORWARDED_PROTO 'https'
- DocumentRoot /srv/leap-webapp/public
+ DocumentRoot /srv/leap/webapp/public
# Check for maintenance file and redirect all requests
RewriteEngine On
diff --git a/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb
index 2ccc4418..3055a7bb 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb
@@ -21,7 +21,7 @@
RequestHeader set X_FORWARDED_PROTO 'https'
- DocumentRoot /srv/leap-webapp/public
+ DocumentRoot /srv/leap/webapp/public
RewriteEngine On
# Check for maintenance file and redirect all requests
diff --git a/puppet/modules/site_webapp/files/migrate_design_documents b/puppet/modules/site_webapp/files/migrate_design_documents
index 88eb2e25..6e24aa5b 100644
--- a/puppet/modules/site_webapp/files/migrate_design_documents
+++ b/puppet/modules/site_webapp/files/migrate_design_documents
@@ -1,6 +1,6 @@
#!/bin/sh
-cd /srv/leap-webapp
+cd /srv/leap/webapp
# use admin credentials
cp config/couchdb.yml.admin config/couchdb.yml
diff --git a/puppet/modules/site_webapp/manifests/couchdb.pp b/puppet/modules/site_webapp/manifests/couchdb.pp
index 7858dbfd..b4ef0980 100644
--- a/puppet/modules/site_webapp/manifests/couchdb.pp
+++ b/puppet/modules/site_webapp/manifests/couchdb.pp
@@ -25,21 +25,21 @@ class site_webapp::couchdb {
$key_path = "${x509::variables::keys}/${cert_name}.key"
file {
- '/srv/leap-webapp/config/couchdb.yml.admin':
+ '/srv/leap/webapp/config/couchdb.yml.admin':
content => template('site_webapp/couchdb.yml.admin.erb'),
owner => leap-webapp,
group => leap-webapp,
mode => '0600',
require => Vcsrepo['/srv/leap/webapp'];
- '/srv/leap-webapp/config/couchdb.yml.webapp':
+ '/srv/leap/webapp/config/couchdb.yml.webapp':
content => template('site_webapp/couchdb.yml.erb'),
owner => leap-webapp,
group => leap-webapp,
mode => '0600',
require => Vcsrepo['/srv/leap/webapp'];
- '/srv/leap-webapp/logs/production.log':
+ '/srv/leap/webapp/logs/production.log':
owner => leap-webapp,
group => leap-webapp,
mode => '0666',
@@ -61,7 +61,7 @@ class site_webapp::couchdb {
}
exec { 'migrate_design_documents':
- cwd => '/srv/leap-webapp',
+ cwd => '/srv/leap/webapp',
command => '/usr/local/sbin/migrate_design_documents',
require => Exec['bundler_update'],
notify => Service['apache'];
diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp
index 92cf4b25..1dfe6936 100644
--- a/puppet/modules/site_webapp/manifests/init.pp
+++ b/puppet/modules/site_webapp/manifests/init.pp
@@ -27,19 +27,20 @@ class site_webapp {
allowdupe => false,
gid => 'leap-webapp',
groups => 'ssl-cert',
- home => '/srv/leap-webapp',
+ home => '/srv/leap/webapp',
require => [ Group['leap-webapp'] ];
}
- file { '/srv/leap-webapp':
+ file { '/srv/leap/webapp':
ensure => directory,
owner => 'leap-webapp',
group => 'leap-webapp',
require => User['leap-webapp'];
}
- vcsrepo { '/srv/leap-webapp':
+ vcsrepo { '/srv/leap/webapp':
ensure => present,
+ force => true,
revision => 'origin/master',
provider => git,
source => 'git://code.leap.se/leap_web',
@@ -50,17 +51,17 @@ class site_webapp {
}
exec { 'bundler_update':
- cwd => '/srv/leap-webapp',
+ cwd => '/srv/leap/webapp',
command => '/bin/bash -c "/usr/bin/bundle check || /usr/bin/bundle install --path vendor/bundle"',
unless => '/usr/bin/bundle check',
user => 'leap-webapp',
timeout => 600,
- require => [ Class['bundler::install'], Vcsrepo['/srv/leap-webapp'] ],
+ require => [ Class['bundler::install'], Vcsrepo['/srv/leap/webapp'] ],
notify => Service['apache'];
}
exec { 'compile_assets':
- cwd => '/srv/leap-webapp',
+ cwd => '/srv/leap/webapp',
command => '/bin/bash -c "/usr/bin/bundle exec rake assets:precompile"',
user => 'leap-webapp',
require => Exec['bundler_update'],
@@ -68,46 +69,47 @@ class site_webapp {
}
file {
- '/srv/leap-webapp/public/provider.json':
+ '/srv/leap/webapp/public/provider.json':
content => $provider,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
- '/srv/leap-webapp/public/ca.crt':
+ '/srv/leap/webapp/public/ca.crt':
ensure => link,
require => Vcsrepo['/srv/leap/webapp'],
target => '/usr/local/share/ca-certificates/leap_api.crt';
- "/srv/leap-webapp/public/${api_version}":
+ "/srv/leap/webapp/public/${api_version}":
ensure => directory,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0755';
- "/srv/leap-webapp/public/${api_version}/config/":
+ "/srv/leap/webapp/public/${api_version}/config/":
ensure => directory,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0755';
- "/srv/leap-webapp/public/${api_version}/config/eip-service.json":
+ "/srv/leap/webapp/public/${api_version}/config/eip-service.json":
content => $eip_service,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
- "/srv/leap-webapp/public/${api_version}/config/soledad-service.json":
+ "/srv/leap/webapp/public/${api_version}/config/soledad-service.json":
content => $soledad_service,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
- "/srv/leap-webapp/public/${api_version}/config/smtp-service.json":
+ "/srv/leap/webapp/public/${api_version}/config/smtp-service.json":
content => $smtp_service,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
}
try::file {
- '/srv/leap-webapp/public/favicon.ico':
- ensure => 'link',
- target => $webapp['favicon'];
+ '/srv/leap/webapp/public/favicon.ico':
+ ensure => 'link',
+ require => Vcsrepo['/srv/leap/webapp'],
+ target => $webapp['favicon'];
'/srv/leap/webapp/app/assets/stylesheets/tail.scss':
ensure => 'link',
@@ -126,7 +128,7 @@ class site_webapp {
}
file {
- '/srv/leap-webapp/config/config.yml':
+ '/srv/leap/webapp/config/config.yml':
content => template('site_webapp/config.yml.erb'),
owner => leap-webapp,
group => leap-webapp,