Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cypress/deploy-bits

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/deploy-bits

Reusable deployment utilities

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
Maintainers
5
Weekly downloads
 
Created
Source

@cypress/deploy-bits

Reusable deployment utilities

NPM

Build status semantic-release js-standard-style

Install

Requires Node version 6 or above.

npm install --save @cypress/deploy-bits

Use

Debugging

To debug functions from this module, run the program with DEBUG=deploy-bits environment variable.

isCI

Returns true if the code is running on a common continuous integration server. Uses is-ci.

const {isCI} = require(@cypress/deploy-bits)
if (isCI) {
  // we are on CI
}

warnIfNotCI

Prints a console warning if the code is not running on CI. Often we prefer deploying from CI rather than running the deploy command locally.

const {warnIfNotCI} = require(@cypress/deploy-bits)
warnIfNotCI()

getDeployEnvironment

Returns target deployment environment staging or production

const {getDeployEnvironment} = require(@cypress/deploy-bits)
getDeployEnvironment()
  .then(env => ...)

If the user specified environment using CLI --environment <name> option, it will be used. Otherwise, user will be prompted to select one.

? Which environment are you deploying? 
❯ Staging 
  Production

You can pass list of arguments for this function to parse (by default it uses process.argv)

getDeployEnvironment(['--environment', 'staging']) // yields "staging"

and you can even pass minimist parsing options

const options = {
  alias: {
    environment: 'e'
  }
}
getDeployEnvironment(['-e', 'staging']) // yields "staging"

checkBranchEnvFolder

Checks the branch to environment mapping. For some branches checks if the working directory is clean (no modified source files). Always returns input environment name. Curried.

const {checkBranchEnvFolder} = require(@cypress/deploy-bits)
checkBranchEnvFolder('master')('production')
// returns a promise resolved with "production"
// will throw an error if there are modified files

Small print

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

MIT License

Copyright (c) 2017 Cypress.io

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 25 Oct 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