Any thoughts on a data uploading method.
Robert Steckroth
robertsteckroth at gmail.com
Thu May 31 16:36:48 UTC 2012
Hey gang, I have developed a awesome new Django charm which uses a
very generic mating charm
for project deployment. Basically the only thing the user needs to
copy and edit the project charms config.yaml file (below).
There needs to be a charm for every django project one wants to
deploy. Also, the Django project must be hosted
on the internet with a repository (Only supports mercurial and
Bitbucket right now). Here is the config.yaml
As you can see I wan't to make deploying Django projects as simple as
possible. The only problem
that remains is in the virtual host upload. Is there a way to natively
get this virtual host information
onto the primary charms unit? If not, is puppet the only other way.
The below method
works except the --> config-get project_apache2_vhost <-- will store
the string into one line. Then Apache2
complains about it not having newlines.
options:
project_repo_type:
description: |
This is the brand of repository versioning the project uses.
E.g. hg git svn bzr etc...
type: string
default: 'hg'
project_repo_url:
description: |
The url of the project repository.
E.g. https://bitbucket.org/ubernostrum/django-registration
ssh://user@your-site.com/project
type: string
default: 'https://surgemcgee@bitbucket.org/surgemcgee/mmrn_site'
project_repo_username:
description: |
The password of the project repository.
type: string
default: 'surgemcgee'
project_repo_password:
description: |
The password of the project repository.
type: string
default: 'n0nsense'
project_apache2_vhost:
description: |
The entire virtual host for this django project.
type: string
default: '
<VirtualHost *:80>
# ServerAdmin bob at localhost
DocumentRoot /home/sites/
ServerName www.budtvnetwork.com
# ServerAlias www.budtv1.com budtv1.com *.budtv1.com
budtvnetwork.com *.budtvnetwork.com
# DirectoryIndex index.html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/sites/mmrn/serve/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
Alias /static "/home/sites/mmrn/serve"
<Location "/static">
SetHandler None
</Location>
<Location "/source">
SetHandler None
</Location>
WSGIDaemonProcess mmrn processes=4 threads=15 display-name=%{GROUP}
WSGIProcessGroup mmrn
WSGIScriptAlias / /home/sites/mmrn_wsgi.py
</VirtualHost>'
P.S.
If you are interested:
The primary charm will parse the Django settings.py file and automatically
set the Database credentials and sync your app.
--
Bust0ut, Surgemcgee: Systems Engineer ---
PBDefence.com
BudTVNetwork.com
RadioWeedShow.com
"Bringing entertainment to Unix"
More information about the Juju
mailing list