%header

%h1 Welcome to Staticd.
%h2 Learn how to get started.

%article

%h3 Staticdctl

%p
  To display help:
  %pre
    :preserve
      $ staticdctl --help
      NAME
          staticdctl - Staticd CLI client

      SYNOPSIS
          staticdctl [global options] command [command options] [arguments...]

      VERSION
          0.0.1

      GLOBAL OPTIONS
          -c, --config=Staticd configuration file - Staticd configuration file (default: ~/.staticdctl.yml)
          -d, --[no-]debug                        - Enable debugging (raise exception on error)
          -h, --host=Staticd API endpoint         - Staticd API endpoint (default: http://localhost/api/v1)
          --help                                  - Show this message
          -s, --site=Site name                    - Site name (default: vagrant)
          --version                               - Display the program version

      COMMANDS
          config         - Display current configuration
          config:rm      - Remove a configuration option
          config:set     - Set a configuration option
          domains        - List all domain attached to the current site
          domains:attach - Attach a domain name to a site
          domains:detach - Detach a domain name from a site
          help           - Shows a list of commands or help for one command
          push           - Push a new release for the current app
          releases       - List all releases of the current site
          sites          - List all sites
          sites:create   - Create a new site
          sites:destroy  - Destroy a site

%h3 Creating a site

%p
  Inside your project folder:
  %br
  %code= "$:website> staticdctl --host #{@staticd_url} sites:create"
  %br
  %code The vagrant site has been created.
  %br
  %code= "http://jtbghu.#{@staticd_host}"

%h3 Deploying a site

%p
  Inside your project folder, assuming source files are in the 'built' folder:
  %br
  %code= "$:website> staticdctl --host #{@staticd_url} push build/"
  %br
  %code Counting resources... done (2 resources).
  %br
  %code Asking host to identify new resources... done (2 new resources to upload).
  %br
  %code Building the archive... done (3KB).
  %br
  %code Uploading the archive... done (2.08s / 1.48kbps).
  %br
  %br
  %code The vagrant release (v1) has been created.
  %br
  %code= "http://jtbghu.#{@staticd_host}"

%h3 Adding custom domain names

%p
  %code= "$:website> staticdctl --host #{@staticd_url} domains:attach www.domain.tld"
  %br
  %code The www.domain.tld domain has been attached to the website site.

%p <i><b>Note</b>: If you use heroku to host the app, do not forget to also add your custom domain to the heroku app.</i>

%h3 Using an environment variable to specify the host flag

%p
  The <code>--host</code> flag can also be provided through the <code>STATICDCTL_ENDPOINT</code> environment variable.
  %br
  You can execute this kind of command to define a default Statidctl endpoint URL:
  %br
  %code= "echo 'export STATICDCTL_ENDPOINT=#{@staticd_url}' >> ~/.bashrc"