1.2.1 • Published 5 years ago

web-deploy-cli v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Build Status npm version

Web Deploy CLI

This package makes it easy to deploy static web applications. It does this by exposing a small set of easy-to-use CLI commands and arguments to quickly deploy your entire project.

Currently it supports the following cloud deployment service:

  • AWS S3 Static Website Hosting
  • Netlify

Table of Contents

  1. Dependencies
  2. Installation
  3. CLI Commands
  4. Release Notes
  5. Contribution
  6. More Information
  7. License

Dependencies

Node

This package requires Node >= 8.0**.

You can install Node.js via the package provided on their site. Installing node will also install the Node Package Manager (NPM) to download and install node modules.

Installation

Installing Build Tools as a global module will give you command-line access to all tasks available.

You can install globally by typing the following in your terminal:

npm install web-deploy-cli  -g

To verified that it is successfully installed, run this:

web-deploy --version

Deploy to AWS S3

You can use this command to deploy your static web application to AWS S3 bucket:

web-deploy --args=<values>

Arguments allowed are:

ArgumentTypeDescription
typeStringThe type of deployment, case-insensitive, value should be set to aws
bucketStringThe bucket name for AWS S3
profileString?The profile name for AWS credentials (if nothing is passed, profile will be set to default)
dirString?The absolute path to your project directory (if nothing is passed, it will use the current directory of the terminal process)
folderString?Specify the folder that contains the built static web application i.e. build

Example usage of arguments:

web-deploy --type=aws --bucket=john-doe-bucket --dir=/Users/johndoe/Projects/hello_world --folder=build

Deploy to Netlify

Prequisite

You will need to get an access token from your Netlify account. See here for more information.

Create a new file .netlify.wdc.yml under your project's root directory with this content:

accessToken: <enter_your_access_token_here>

You can use this command to deploy your static web application to Netlify:

web-deploy --args=<values>

Arguments allowed are:

ArgumentTypeDescription
typeStringThe type of deployment, case-insensitive, value should be set to netlify
siteIdStringThe site's ID (API ID, can be found under site settings in Netlify)
dirString?The absolute path to your project directory (if nothing is passed, it will use the current directory of the terminal process)
folderString?Specify the folder that contains the built static web application i.e. build

Example usage of arguments:

web-deploy --type=netlify --siteId=12345678 --dir=/Users/johndoe/Projects/hello_world --folder=build

Release Notes

Please refer to the Github releases section for the changelog

Contribution

Getting Started

Install dependencies:

yarn install

Run examples:

yarn start

Run unit tests:

yarn unit

Run integration tests:

yarn integration

Watch unit tests:

yarn test:unit

Watch unit integration:

yarn test:integration

Watch all tests:

yarn test

More Information

Small Print

Author: Jazz Peh <jazzpeh@gmail.com> © 2019

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

MIT License

Copyright (c) 2019 Jazz Peh (twitter: @jazzpeh) Licensed under the MIT license.