Files
cypress/scripts/test-unique-npm-and-binary.js
T
Gleb Bahmutov 4672b569f1 Upload tar and zip (#536)
* run linter an all

* add NPM package CI job

* more steps for NPM package

* start upload NPM package

* more work on NPM package upload

* testing upload

* move purge cache to utils

* add unique binary build and upload from CI

* pass saved urls to test-binary job

* allow CYPRESS_BINARY_VERSION to be an url right away

* put uploaded urls into /tmp folder

* use explicit json filenames

* paths instead of path

* testing cypress npm and binary

* use NPM folder beta to store temp binary and package

* refactor utils

* set env vars and trigger other test projects

* only test NPM and binary on develop branch

* enable all jobs again
2017-10-01 17:01:19 -04:00

31 lines
767 B
JavaScript

const minimist = require('minimist')
const options = minimist(process.argv)
const la = require('lazy-ass')
const is = require('check-more-types')
const execa = require('execa')
const { getNameAndBinary } = require('./utils')
/* eslint-disable no-console */
const { npmUrl, binaryUrl } = getNameAndBinary(process.argv)
la(is.unemptyString(npmUrl), 'missing npm url')
la(is.unemptyString(binaryUrl), 'missing binary url')
console.log('testing NPM from', npmUrl)
console.log('and binary from', binaryUrl)
const cwd = options.cwd || process.cwd()
console.log('in', cwd)
execa.shell(`npm install ${npmUrl}`, {
cwd,
stdio: 'inherit',
env: {
CYPRESS_BINARY_VERSION: binaryUrl,
},
})
.then(console.log)
.catch((e) => {
console.error(e)
process.exit(1)
})