Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Configuration

Charlie Rosenbury edited this page Jan 11, 2015 · 9 revisions

Configuration Properties

Configuration Files

There are 4 configuration files extended into one giant config JSON object. The files in order of precedence (i.e. earlier files' settings will override latter ones):

  1. helperpress.local.json
  2. helperpress.json
  3. ~/.helperpress
  4. package.json ("config" property)

For example, this means that if "uploads_sync" is defined in your global config file (~/.helperpress) and not defined in the project's config file, it will use the setting from the global config file. However, if it is set in both places, the project's setting will override the global setting.

To what should the setting apply?

                                       | This Project              | All Projects

-------------------------------------------|---------------------------|------------------- This Environment | helperpress.local.json | ~/.helperpress All Environments | helperpress.json | package.json

  • package.json "config" object is useful if you have a boilerplate theme you always fork from for new projects.
  • If the configuration is exclusive to this project, it should go in helperpress.json or helperpress.local.json
  • Only keep sensitive credentials in helperpress.local.json & ~/.helperpress so it won't be committed to source control.
  • If a setting gets reused across multiple sites, such as your local environment setup or development environment creds, it should go in ~/.helperpress

Example Config Files

The following are examples of each type of file and what kind of properties might go therein.

helperpress.json

{
  "theme_path": "./dist/theme",
  "css_path": "./src/theme/sass/style.scss",
  "build_cmd": "gulp build",
  "build_cmd_dir": "./src",
  "build_dir": "www",
  "wp": {
    "version": "4.1",
    "theme": {
      "slug": "super-brochure-site",
      "name": "Super Brochure Site",
      "desc": "A custom theme for a company that will sell you all kinds of wonderful things."
    },
    "plugins": [
      "wordpress-seo",
      "relevanssi",
      "http://thebyob.com/downloads/gravity-forms-auto-placeholders/gravity-forms-auto-placeholders.zip",
      "post-types-order",
      "regenerate-thumbnails",
      "wordpress-seo",
      "wp-pagenavi"
    ]
  },
  "environments": {
    "development": {
      "db": {
        "database": "super-broch"
      },
      "home_url": "sbs.dev-server.coolwebsites.net",
      "wp_path": "/vhosts/sbs/www"
    },
    "staging": {
      "db": {
        "database": "wp_super_broch"
      },
      "ssh": {
        "host": "super-broch.wpengine.com"
      },
      "home_url": "super-broch.wpengine.com",
      "wp_path": "/nas/wp/www/cluster-10499/super-broch",
      "ftp_wp_path": ".",
      "deploy_method": "wpe",
      "remote": "git@git.wpengine.com:production/super-broch.git",
      "migrate_uploads_method": "sftp",
      "migrate_db_method": "plugin"
    }
  },
  "db_master" : "development"
}

helperpress.local.json

{
  "environments": {
    "local": {
      "db": {
        "database": "super-brochure-site"
      },
      "wp_path": "/Users/chuckmo/git-projects/super-brochure-site/www",
      "home_url": "super-brochure-site.lh"
    }
  },

  "uploads_sync": "copy"
}

~/.helperpress

{
  "environments": {
    "local": {
      "title": "Local",
      "deploy": "none",
      "db": {
        "host": "127.0.0.1",
        "user": "root",
        "pass": "mysupersecurerootpass"
      }
    },
    "development": {
      "title": "Dev01",
      "db": {
        "host": "127.0.0.1",
        "pass": "8jkhd89nfgks",
        "user": "dev-db-user"
      },
      "ssh": {
        "host": "dev-server.coolwebsites.net",
        "user": "chuckmo",
        "keyfile": "/Users/chuckmo/.ssh/id_rsa"
      },
      "deploy_method": "none",
      "migrate_uploads_method": "rsync",
      "migrate_db_method": "ssh"
    }
  },

  "apache": {
    "scheme": "vhost",
    "vhost_dir": "/etc/apache2/extra/vhosts",
    "logs_dir": "/Users/chuckmo/Sites/-logs",
    "url_scheme": "*.lh"
  },

  "uploads_sync": "rewrite"
}