Recipes to deploy web2py apps on OpsWorks (EC2).
-
The git repository with your app must contain all web2py source code.
-
Because OpsWorks doesn't have web2py application type the application you want to deploy must contain "web2py" in name
-
Add these recipes in "Custom Chef Recipes" of your layer:
Stage | Recipies |
---|---|
Setup | nginx, uwsgi |
Deploy | deploy::web2py |
-
Set environment variable ADMIN_PASSWORD with password in OpsWorks admin interface
-
Create file before_symlink.rb in the deploy directory of your project with this content:
if new_resource.environment["ADMIN_PASSWORD"]
execute "Save web2py admin password" do
cwd release_path
command "sudo -u #{new_resource.user} python -c \"from gluon.main import save_password; save_password('#{new_resource.environment["ADMIN_PASSWORD"]}',443)\""
end
end