Skip to content

look at env var FORCE_DEPLOY #1985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion cy_scripts/should-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ const Promise = require('bluebird')

const docsChanged = complement(isEmpty)

const isForced = process.argv.some(equals('--force'))
/**
* Checks if a given environment variable is present
* and has a string value that can be considered truthy, like
* "true", "TRUE", "on", "1", "yes"
*
* @param {string} name of the environment variable to check
* @returns boolean
*/
const isEnvVariableOn = (name) => {
const value = process.env[name]

if (!value) {
return false
}

return value === 'true'
|| value === 'TRUE'
|| value === 'on'
|| value === '1'
|| value === 'yes'
}
const isForced = process.argv.some(equals('--force')) || isEnvVariableOn('FORCE_DEPLOY')

const isValidEnvironment = is.oneOf(['staging', 'production'])

Expand Down