@whitespace/flightplan

2.16.5 • Public • Published

Whitespace Flightplan

Flightplan presets for Whitespace’s sites

Example usage

// flightplan.js

const plan = require("flightplan");
const { configure } = require("@whitespace/flightplan/municipio");

const config = {
  keepReleases: 5,
  dumpFolder: "~/dumps/",
  projectName: "eslov",
  themes: ["eslov-wp-theme"],
  filesAndFolders: [
    // Additional files to transfer
  ],
  ignoredFilesAndFolders: [
    // Files to NOT transfer
  ],
};

plan.target(
  "prod",
  {
    host: "eslov.se",
    username: "whitespace",
    agent: process.env.SSH_AUTH_SOCK,
  },
  {
    dir: "/srv/www/eslov.se",
    user: "web",
    domain: "https://eslov.se",
    phpVersion: "php7.4", // Providing this will reload the PHP service after deploy
  },
);

configure(plan, config);

Available setups

@whitespace/flightplan/bedrock

Use this for Wordpress sites that’s been set up using Roots Bedrock. These sites use a /.env file for config, vendor files are in the /vendor and /web/wp folders and site-specific code is in /web/app.

@whitespace/flightplan/municipio

Use this for Municipio Wordpress sites. These sites store config in the /config directory, vendor files in the /vendor and /wp folders and site-specific code is in /wp-content.

@whitespace/flightplan/matomo

Use this for Matomo sites. These sites store config in the /web/config/config.ini.php file.

Extending config

Here is an example, from mi.se, of how we extend one of the available setups:

plan.remote("deploy", function (remote) {
  let { dir, user } = plan.runtime.options;

  remote.sudo(`cd ${dir}/current/web && wp ws wp_groups_file --allow-root`, {
    user,
    failsafe: true,
  });
});
plan.remote("rollback", function (remote) {
  let { dir, user } = plan.runtime.options;

  remote.sudo(`cd ${dir}/current/web && wp ws wp_groups_file --allow-root`, {
    user,
    failsafe: true,
  });
});

Readme

Keywords

none

Package Sidebar

Install

npm i @whitespace/flightplan

Weekly Downloads

19

Version

2.16.5

License

None

Unpacked Size

73.3 kB

Total Files

20

Last publish

Collaborators

  • olofsandell
  • ynwuay
  • tsubarah
  • jeanfredrik
  • whitespace-se
  • pbrotherton
  • johan-westin
  • degeer