1.2.4 • Published 4 years ago

shipit-release v1.2.4

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

Shipit-Release

A minimal deployment Plugin for ShipitJS

Usage

To use shipit-release just require it in your shipit file and set the needed configuration variables:

module.exports = (shipit) => {
  require('shipit-release')(shipit)

  shipit.initConfig({
    default: {
      deployTo: '/*your-deploy-dir*',
      keepReleases: 5,
      dirToCopy: 'build',
      installCommand: 'npm install',
      buildCommand: 'npm run build',
    },
    *your-server-env-1*: {
      servers: [{
        user: '*your-staging-user*',
        host: '*your-staging-server*'
      ]
    },
    *your-server-env-2*: {
       servers: [{
        user: '*your-live-user*',
        host: '*your-live-server*'
      }],
    },
  })
}

Make sure you added at least one environment, for example staging to the configuration like:

  shipit.initConfig({
    ...
    staging: {
      servers: [{
        user: '*your-staging-user*',
        host: '*your-staging-server*'
      ]
    },
  })

As soon as you require the plugin you have the following tasks available:

Setup

Run: bashipit *your-server-env* setup to setup your deployment directories on the server. This will create your deployTo folder as well as a releases folder inside it.

Deploy

Run: bashipit *your-server-env* deploy to build and deploy your PWA to the given server environment. This will install the needed dependencies with the configured installCommand and afterwards build your PWA locally with the configured buildCommand. If the build succeeds the plugin will create a new release folder and sync your files located in the configured dirToCopy folder and symlink it to the current folder in your deployTo directory. To finish your deployment it will remove the oldest release to be in line with the configured keepReleases setting.

Rollback: shipit your-server-env rollback

Run: bashipit *your-server-env* rollback to rollback the latest release. This will also delete the release folder you are rolling back from.

Events

You can run tasks on specific steps of the deployment process:

StepDescription
installedwhen dependencies are installed.
builtwhen buildCommand has been executed.
uploadedwhen dirToCopy has been uploaded.
symlinkedafter the current symlink has been updated.
finishedafter the deploy is finished.

You can also run tasks once a rollback is finsihed:

StepDescription
finishedafter the rollback is finished.

Example

module.exports = (shipit) => {
  require('shipit-release')(shipit)

  shipit.initConfig({
    ...
  })

  shipit.on('installed', async () => {
    return shipit.start('doStuff')
  })

  shipit.blTask('doStuff', async () => {
    // ... do stuff :)
  })
}

Installation

Install the package with your favorite package manager:

npm install --save-dev shipit-release
yarn add --dev shipit-release

ToDos

  • Basic Test Setup
  • Basic Test Coverage
  • Setup Contribution Guidelines
  • Cleanup index.js

License

The gem is available as open source under the terms of the MIT License.

2.0.0-pre.22

4 years ago

2.0.0-pre.21

4 years ago

2.0.0-pre.20

4 years ago

2.0.0-pre.19

4 years ago

2.0.0-pre.18

5 years ago

2.0.0-pre.17

5 years ago

2.0.0-pre.16

5 years ago

2.0.0-pre.15

5 years ago

2.0.0-pre.14

5 years ago

2.0.0-pre.13

5 years ago

2.0.0-pre.12

5 years ago

2.0.0-pre.11

5 years ago

2.0.0-pre.10

5 years ago

2.0.0-pre.9

5 years ago

2.0.0-pre.8

5 years ago

2.0.0-pre.7

5 years ago

2.0.0-pre.2

5 years ago

2.0.0-pre1

5 years ago

1.2.4

5 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.1.4

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago