Socket
Socket
Sign inDemoInstall

@emartech/client-publish

Package Overview
Dependencies
Maintainers
32
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emartech/client-publish

Deployer for client side projects.


Version published
Maintainers
32
Created
Source

client-publish

Dependency Status devDependency Status

Uploads the bundled client application to Amazon S3 and sets up redirection to that bucket.

Install

npm install @emartech/client-publish --save-dev

Configuration

  • LOCAL_DIRECTORY: place of the bundled application, defaults to 'dist'
  • PROJECT_NAME: name of the project, will be the subdirectory in the S3 bucket, required
  • PROJECT_HAS_CUSTOM_NAME: directory names not containing PROJECT_NAME are not allowed by default, you can enable them with it
  • S3_BUCKET: the S3 bucket where the application will be uploaded to, required
  • S3_ACL: S3 buckets ACL setting, defaults to 'public-read'
  • S3_CACHE_CONTROL: S3 buckets cache control, defaults to 'max-age=315360000, no-transform, public'
  • AWS_REGION: AWS region, defaults to 'eu-west-1'
  • AWS_ACCESS_KEY_ID: AWS access key, required
  • AWS_SECRET_ACCESS_KEY: AWS secret for access key, required
  • REDIRECTOR_URL: URL of the redirector service, required
  • REDIRECTOR_TARGET: the domain where the redirector should point, required
  • REDIRECTOR_API_SECRET: secret of the redirector service, required
  • DEPLOY_ENV: deployment environment, provides default values for S3_BUCKET, REDIRECTOR_URL, REDIRECTOR_TARGET, can be 'staging' or 'production', defaults to 'staging'

Usage

Deploy scripts work from current branch. Master branch stands for staging, production branch stands for production. Merge only to production when you want deployment there. Merge can be run from local machine, deploys from CI server.

{
  "scripts": {
    "deploy-staging": "client-deploy-staging",
    "deploy-production": "client-deploy-production",
    "merge-production": "client-merge"
  }
}
  • client-deploy: deploy application
  • client-deploy-staging: sets defaults for staging and deploy application
  • client-deploy-production: sets defaults for production and deploy application
  • client-merge: merge and push to production from master

Usage with Codeship

Set the following environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REDIRECTOR_API_SECRET_STAGING, REDIRECTOR_API_SECRET_PRODUCTION, PROJECT_NAME.

Create npm scripts:

{
  "deploy-staging": "REDIRECTOR_API_SECRET=$REDIRECTOR_API_SECRET_STAGING client-deploy-staging",
  "deploy-production": "REDIRECTOR_API_SECRET=$REDIRECTOR_API_SECRET_PRODUCTION client-deploy-production",
  "merge-production": "client-merge"
}

Then setup deployment for master and production branch.

# master branch
npm run build
npm run deploy-staging

# production branch
npm run build
npm run deploy-production

FAQs

Package last updated on 07 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc