Installation & Upgrading

maxfierke edited this page Apr 14, 2013 · 13 revisions

Deployment on a Local, VPS, Cloud, or Dedicated host

Requirements

  1. Nginx, Apache, or another web server on *nix/BSD with rewrite functionality. May work on Windows and Mac, but has not been tested and is not supported.
    • Nginx users, see this wiki article for setup.
    • Apache users, point your document root to web/. The .htaccess should take care of everything.
  2. PHP 5.3.10+ (Tested on 5.3.10, 5.3.18, and 5.4.6)
  3. PDO-supported database. MySQL/MariaDB suggested.
  4. Composer for installing dependencies
  5. (optional) Memcached and PHP memcache extension.

Installation

  1. Run php app/check.php and resolve any errors before doing ANYTHING else.
  2. Run cp app/config/parameters.yml.dist app/config/parameters.yml
    • sender_email is the email address of the automated email account you want to use.
    • secret is used for CSRF validation. Set this to some random characters. An ideal value would be a random sha256 hash.
    • The rest of the settings should be pretty self-explanatory.
  3. Setup permissions. This will require ACL support of some kind on your file system. Replace www-data with your web server user.
    • If under a host that supports chmod +a (Mac OS X):
      $ rm -rf app/cache/*
      $ rm -rf app/logs/*
      $ sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
      $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
    • If under a host that does not (Linux, BSD, other *nix), enable ACL support on the file system and run the following:
      $ sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
      $ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
    • If none of the above are available options, add umask(0002); to the beginning of app/console, web/app.php, and web/app_dev.php
  4. Run php composer.phar install
  5. Run php app/console doctrine:database:create
  6. Run php app/console doctrine:schema:update --force
  7. Run php app/console doctrine:fixtures:load to bootstrap the application with some needed information (groups) and a default admin account with the username admin and the password admin.
  8. Run php app/console --env=prod cache:clear to clear and warmup the application's cache. prod should be replaced with dev if you're running in a development environment.
  9. Run php app/console --env=prod assetic:dump to dump assets. prod should be replaced with dev if you're running in a development environment.
  10. Navigate to the OpenSkedge installation in a browser, login as the bootstrapped admin and change the password.
  11. Add employees, areas, positions, and schedule periods and get to scheduling!

Upgrading

  1. Run git pull to fetch the latest changes to OpenSkedge. If you've made changes to OpenSkedge, you'll either want to stash them or commit them and use git pull --rebase.
  2. Run php composer.phar install
  3. Run by using php app/console doctrine:migrations:migrate. NOTE: Only supports MySQL. This should be pretty safe but if issues occur, you should be able to roll back by migrating down. That said, it's probably best to test the migration on your development server before pushing it to production. Read more about using migrations at the Doctrine project's docs.
    • If you're on a database other than MySQL such as PostgreSQL, you'll have to adapt the migrations yourself, or risk potential data loss and/or application breakage by running php app/console doctrine:schema:update --force.
  4. Run php app/console --env=prod cache:clear to clear and warmup the application's cache. prod should be replaced with dev if you're running in a development environment.
  5. Run php app/console --env=prod assetic:dump to dump assets. prod should be replaced with dev if you're running in a development environment.

Deploying OpenSkedge on Pagoda Box

Pagoda Box is a PaaS (Platform-as-a-Service) provider that allows the creation of scalable instances of web applications.

OpenSkedge supports the use of the PaaS provider Pagoda Box and I have included a Boxfile and a Boxfile.install for the creation of OpenSkedge instances. Pagoda Box has a lot of limitations compared to a tradition style deployment platform, so deploying to Pagoda Box can be considered beta and unstable. Deployment may break occasionally (either because I broke something, Pagoda Box broke something, you broke something, or composer failed to fetch a package). You should check for any changes to this before updating a Pagoda Box instance as manual intervention may be required to keep the instance functioning.

Due to Pagoda Box's read-only nature, there are few environmental variables that need to be set:

  • SYMFONY__SENDER__EMAIL should contain the email address of the no-reply email account from which automated emails should be sent. - (Default: "no-reply@yourdomain.com")
  • OPENSKEDGE_SECRET is set to an insecure secret by default. This needs to be changed. OPENSKEDGE_SECRET is used for CSRF validation. Set this to some random characters. An ideal value would be a random sha256 hash. - (Default: ThisIsASecretChangeIt)
  • SYMFONY__MEMCACHE__EXPIRE should contain the number of seconds a user session should last. - (Default: 3600)

Any changes to the above will take effect the next time you deploy. You can also force a redeploy of the current commit by clicking "Pick a Git Commit to Deploy" and clicking "Deploy" next to the commit that is already deployed.

One can also use the Pagoda Box quickstart I created.

Suggested Reading for more information: http://help.pagodabox.com/customer/portal/articles/175128-symfony2

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.