preaction / Statocles

Static website CMS
http://preaction.me/statocles
Other
84 stars 33 forks source link

Multiple named deploy configurations #533

Open preaction opened 7 years ago

preaction commented 7 years ago

A site should be able to have multiple, named deploy configurations. This would allow a site to have a "preview" or "staging" server along with a "production" server, each with different configurations. This can help with approval workflows.

To configure named deploys, the configuration file should accept a hash of deploys in addition to a single deploy:

site:
    $class: Statocles::Site
    deploy:
        preview:
            $class: Statocles::Deploy::Git
            branch: staging
            remote: staging
        prod:
            $class: Statocles::Deploy::Git
            branch: gh-pages
            remote: github

With this configuration, you could run statocles deploy preview to deploy to the preview server, or statocles deploy prod to deploy to production. A special deploy named "default" would be used when one simply does statocles deploy.

When only one deploy exists, that deploy should be the "default" deploy.