I've been trying to create my own custom install script to create a Laravel 4 application quickly and easily. The problem is, it always seems to fail - no actual explanation is given short of "There was an error creating the app with the custom script." (which in itself is a useless error description...)
The script seems to complete up to about line 30. Anything after that point isn't ran. If anybody has any ideas about why this may be happening, I'd love to hear them. Here's the script:
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/usr/local/bin/python2.4
"""
Laravel Installer
This installer installs a basic setup of the current Laravel stable release using Composer so you can get your development started right away.
2 Applications will be created - one given the name you specify, and the other the name appended with "_symlink". This latter application will point to the public directory and is the one you should point your website entry at.
"autostart": not applicable
"extra info":
"""
import sys
import xmlrpclib
def create(account, app_name, autostart, extra_info, password, server, session_id, username):
app = server.create_app(session_id, app_name, 'static_php54', False, '')
# Grab composer.phar, grab the composer.json file from the repo
cmd = ''
cmd += 'rm index.html;'
cmd += 'curl -sS https://getcomposer.org/installer | php54;'
cmd += 'wget https://github.com/laravel/laravel/archive/master.zip --output-document=laravel.zip > /dev/null 2>&1;'
cmd += 'unzip laravel.zip > /dev/null 2>&1;'
cmd += 'rm laravel.zip;'
cmd += 'mv laravel-master/* .;'
cmd += 'rm -Rf laravel-master;'
server.system(session_id, cmd)
# Replace the app name in the composer.json file
composer_json_path = '/home/%s/webapps/%s/composer.json' % (username, app_name)
server.replace_in_file(session_id, composer_json_path, ('php', 'php54'))
# Run composer install
cmd = ''
cms += 'php54 composer.phar install --prefer-dist --no-progress;'
server.system(session_id, cmd)
# Create a symlink application to the /public/ directory
symlink_app_name = "%s_symlink" % (app_name)
symlink_app_path = "/home/%s/webapps/%s/public" % (username, app_name)
symlink_app = server.create_app(session_id, symlink_app_name, 'symlink54', False, symlink_app_path)
print app['id']
def delete(account, app_name, autostart, extra_info, password, server, session_id, username):
server.delete_app(session_id, app_name)
server.delete_app(session_id, "%s_symlink" % (app_name))
if __name__ == '__main__':
action, username, password, machine, app_name, autostart, extra_info = sys.argv[1:]
server = xmlrpclib.Server('https://api.webfaction.com/')
session_id, account = server.login(username, password, machine)
locals()[action](account, app_name, autostart, extra_info, password, server, session_id, username)
-----END WEBFACTION INSTALL SCRIPT-----