# HG changeset patch # User ymh # Date 1399281468 -7200 # Node ID 4d1aa030e7464c9356895fbf652ddd97064a411d # Parent 5ab0dc95fddf8f612511a41502fae70616f1fd67 Correct some tests in test-suite diff -r 5ab0dc95fddf -r 4d1aa030e746 .hgignore --- a/.hgignore Wed Apr 30 16:19:21 2014 +0200 +++ b/.hgignore Mon May 05 11:17:48 2014 +0200 @@ -14,6 +14,7 @@ recreate .pydevproject settings_local.py +settings_dev.py urls_local.py dev/.vagrant dev/custom.yaml diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/Vagrantfile --- a/dev/Vagrantfile Wed Apr 30 16:19:21 2014 +0200 +++ b/dev/Vagrantfile Mon May 05 11:17:48 2014 +0200 @@ -91,7 +91,8 @@ puppet.manifests_path = "manifests" puppet.manifest_file = "site.pp" puppet.module_path = "modules" - puppet.options = "--hiera_config /vagrant/hiera.yaml " + #puppet.options = "--hiera_config /vagrant/hiera.yaml --graph --graphdir '/vagrant/graphs' --noop" + puppet.options = "--debug --verbose --hiera_config /vagrant/hiera.yaml" puppet.facter = { "vagrant_base_path" => File.dirname(__FILE__) } diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/manifests/site.pp --- a/dev/manifests/site.pp Wed Apr 30 16:19:21 2014 +0200 +++ b/dev/manifests/site.pp Mon May 05 11:17:48 2014 +0200 @@ -1,26 +1,36 @@ +exec { + 'apt_update_site': + command => '/usr/bin/apt-get update', + timeout => 2400, + returns => [ 0, 100 ]; +# refreshonly => true; +} + +Exec["apt_update_site"] -> Package <| |> + # upgrade system -class { 'sysconfig::sys_upgrade': } +class { 'sysconfig::sys_upgrade': }-> # install packages -class { 'sysconfig::packages': require => Class['sysconfig::sys_upgrade'] } +class { 'sysconfig::packages': }-> # install postgres -class { 'sysconfig::postgresql': require => Class['sysconfig::sys_upgrade'] } +class { 'sysconfig::postgresql': }-> # install nginx -class { 'sysconfig::nginx': require => Class['sysconfig::sys_upgrade'] } +class { 'sysconfig::nginx': }-> # create python -class { 'sysconfig::buildout': require => [Class['sysconfig::packages'], Class['sysconfig::postgresql']] } +class { 'sysconfig::buildout': }-> # write config -class { 'sysconfig::config': require => Class['sysconfig::buildout'] } +class { 'sysconfig::config': }-> # write django_init -class { 'sysconfig::django_init': require => Class['sysconfig::config'] } +class { 'sysconfig::django_init': }-> # config testserver_init -class { 'sysconfig::testserver_init': vagrant_base_path => $vagrant_base_path, require => Class['sysconfig::config'] } +class { 'sysconfig::testserver_init': vagrant_base_path => $vagrant_base_path }-> # deploy -class { 'sysconfig::deploy': require => [ Class['sysconfig::django_init'], Class['sysconfig::nginx'], Class['sysconfig::postgresql'] ] } +class { 'sysconfig::deploy': } diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/modules/sysconfig/manifests/config.pp --- a/dev/modules/sysconfig/manifests/config.pp Wed Apr 30 16:19:21 2014 +0200 +++ b/dev/modules/sysconfig/manifests/config.pp Mon May 05 11:17:48 2014 +0200 @@ -15,7 +15,7 @@ owner => 'vagrant', group => 'vagrant', mode => 644, - content => template('sysconfig/settings_local.erb'), + content => template('sysconfig/settings_local.py.erb'), } file { 'media-root': diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/modules/sysconfig/manifests/testserver_init.pp --- a/dev/modules/sysconfig/manifests/testserver_init.pp Wed Apr 30 16:19:21 2014 +0200 +++ b/dev/modules/sysconfig/manifests/testserver_init.pp Mon May 05 11:17:48 2014 +0200 @@ -74,4 +74,14 @@ content => template('sysconfig/start-testserver.sh.erb'), } + file { 'settings_dev' + ensure => 'present', + path => "/srv/comt/src/cm/settings_dev.py", + replace => 'no', + owner => 'vagrant', + group => 'vagrant', + mode => 755, + content => template('sysconfig/settings_dev.py.erb'), + } + } diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/modules/sysconfig/templates/settings_dev.py.erb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev/modules/sysconfig/templates/settings_dev.py.erb Mon May 05 11:17:48 2014 +0200 @@ -0,0 +1,6 @@ + +from settings import * + +DEBUG=True +SITE_URL = "http://<%= @ipaddress_eth1 %>:<%= @testserver_port %>" + diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/modules/sysconfig/templates/settings_local.erb --- a/dev/modules/sysconfig/templates/settings_local.erb Wed Apr 30 16:19:21 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -DEBUG = True -TEMPLATE_DEBUG = DEBUG -CLIENT_DEBUG = DEBUG - -YUI_DEBUG = DEBUG # use expanded yui version (i.e. not -min) -YUI_DISTANT = False - -DATABASES = { - 'default': { - 'ENGINE': 'postgresql_psycopg2', # YOUR_SETTINGS # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': '<%= @db_name %>', # YOUR_SETTINGS # Or path to database file if using sqlite3. - 'USER': '<%= @db_user %>', # YOUR_SETTINGS # Not used with sqlite3. - 'PASSWORD': '<%= @db_pw %>', # YOUR_SETTINGS # Not used with sqlite3. - 'HOST': '<%= @db_host %>', # YOUR_SETTINGS # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '<%= @db_port %>', # YOUR_SETTINGS # Set to empty string for default. Not used with sqlite3. - } -} - -SITE_URL = "http://<%= @ipaddress_eth1 %>/" # YOUR_SETTINGS - -DEFAULT_FROM_EMAIL = "me@example.com" # YOUR_SETTINGS - -# destination email for the contact page -CONTACT_DEST = DEFAULT_FROM_EMAIL - -# smtp host -EMAIL_HOST = "localhost" # YOUR_SETTINGS - -TEMPLATE_STRING_IF_INVALID = "NNNNNNNNNOOOOOOOOOOOOOOO" if DEBUG else '' - -# web server writable directory to store Comt uploaded content (text images etc.) -MEDIA_ROOT = '/srv/comt/web' # YOUR_SETTINGS - -# Insert some random text here, -# it will be used to add some randomness to every crypto operation Comt does -SECRET_KEY = '<%= Array.new(50){"abcdefghijklmnopqrstuvwxyz0123456789!@#\$%^&*(-_=+)".split("").sample}.join %>' # YOUR_SETTINGS - -MEDIA_URL = '/site_media/' - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'cm', -# 'django_extensions', - 'tagging', - 'south', -) - -CM_MEDIA_PREFIX = '/cmmedia/' - -ADMIN_MEDIA_PREFIX = '/media/' - -ADMINS = ( - ('Comt admin', CONTACT_DEST), -) - -MANAGERS = ADMINS -SEND_BROKEN_LINK_EMAILS = False - -SERVER_EMAIL = DEFAULT_FROM_EMAIL - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# If running in a Windows environment this must be set to the same as your -# system time zone. -DEFAULT_TIME_ZONE = "Europe/Paris" - -# Do not use name/email of co-ment users but rather -# those passed in the request. -# Set this parameter to True when using co-ment from -# a third-party CMS throuch co-ment API. -DECORATED_CREATORS = False - -# Set to TRUE to use Abiword for convertion form and to legacy formats. -# Set to False to use LibreOffice for convertion form and to legacy formats. -USE_ABI = True - -# Set to True if you don't want to appear in Sopinspace Piwik statistics -DISABLE_TRACKING = True - -#disable email reporting by piston -PISTON_EMAIL_ERRORS = False - diff -r 5ab0dc95fddf -r 4d1aa030e746 dev/modules/sysconfig/templates/settings_local.py.erb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev/modules/sysconfig/templates/settings_local.py.erb Mon May 05 11:17:48 2014 +0200 @@ -0,0 +1,87 @@ +DEBUG = True +TEMPLATE_DEBUG = DEBUG +CLIENT_DEBUG = DEBUG + +YUI_DEBUG = DEBUG # use expanded yui version (i.e. not -min) +YUI_DISTANT = False + +DATABASES = { + 'default': { + 'ENGINE': 'postgresql_psycopg2', # YOUR_SETTINGS # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': '<%= @db_name %>', # YOUR_SETTINGS # Or path to database file if using sqlite3. + 'USER': '<%= @db_user %>', # YOUR_SETTINGS # Not used with sqlite3. + 'PASSWORD': '<%= @db_pw %>', # YOUR_SETTINGS # Not used with sqlite3. + 'HOST': '<%= @db_host %>', # YOUR_SETTINGS # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '<%= @db_port %>', # YOUR_SETTINGS # Set to empty string for default. Not used with sqlite3. + } +} + +SITE_URL = "http://<%= @ipaddress_eth1 %>" # YOUR_SETTINGS + +DEFAULT_FROM_EMAIL = "me@example.com" # YOUR_SETTINGS + +# destination email for the contact page +CONTACT_DEST = DEFAULT_FROM_EMAIL + +# smtp host +EMAIL_HOST = "localhost" # YOUR_SETTINGS + +TEMPLATE_STRING_IF_INVALID = "NNNNNNNNNOOOOOOOOOOOOOOO" if DEBUG else '' + +# web server writable directory to store Comt uploaded content (text images etc.) +MEDIA_ROOT = '/srv/comt/web' # YOUR_SETTINGS + +# Insert some random text here, +# it will be used to add some randomness to every crypto operation Comt does +SECRET_KEY = '<%= Array.new(50){"abcdefghijklmnopqrstuvwxyz0123456789!@#\$%^&*(-_=+)".split("").sample}.join %>' # YOUR_SETTINGS + +MEDIA_URL = '/site_media/' + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'cm', +# 'django_extensions', + 'tagging', + 'south', +) + +CM_MEDIA_PREFIX = '/cmmedia/' + +ADMIN_MEDIA_PREFIX = '/media/' + +ADMINS = ( + ('Comt admin', CONTACT_DEST), +) + +MANAGERS = ADMINS +SEND_BROKEN_LINK_EMAILS = False + +SERVER_EMAIL = DEFAULT_FROM_EMAIL + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +DEFAULT_TIME_ZONE = "Europe/Paris" + +# Do not use name/email of co-ment users but rather +# those passed in the request. +# Set this parameter to True when using co-ment from +# a third-party CMS throuch co-ment API. +DECORATED_CREATORS = False + +# Set to TRUE to use Abiword for convertion form and to legacy formats. +# Set to False to use LibreOffice for convertion form and to legacy formats. +USE_ABI = True + +# Set to True if you don't want to appear in Sopinspace Piwik statistics +DISABLE_TRACKING = True + +#disable email reporting by piston +PISTON_EMAIL_ERRORS = False +