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

nodeshift

Package Overview
Dependencies
Maintainers
4
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeshift - npm Package Compare versions

Comparing version 6.1.0-alpha.0 to 6.1.0

29

CHANGELOG.md

@@ -5,2 +5,31 @@ # Changelog

## [6.1.0](https://github.com/nodeshift/nodeshift/compare/v6.0.2...v6.1.0) (2020-05-13)
### Features
* **build-strategy:** Add Docker build strategy ([#442](https://github.com/nodeshift/nodeshift/issues/442)) ([384690f](https://github.com/nodeshift/nodeshift/commit/384690f1c6395b27dbfb131f2841c3c418848881))
### Bug Fixes
* upgrade documentation from 12.1.4 to 12.2.0 ([#438](https://github.com/nodeshift/nodeshift/issues/438)) ([a6820a1](https://github.com/nodeshift/nodeshift/commit/a6820a1e529e9e88549379ec0f59dddfa03107d9))
* upgrade eslint-plugin-node from 11.0.0 to 11.1.0 ([#437](https://github.com/nodeshift/nodeshift/issues/437)) ([591646e](https://github.com/nodeshift/nodeshift/commit/591646e1ce170ca0c630c832c9e57abdb6289d67))
### [6.0.2](https://github.com/nodeshift/nodeshift/compare/v6.0.1...v6.0.2) (2020-04-13)
### Features
* Replacing rimraf with custom module ([#413](https://github.com/nodeshift/nodeshift/issues/413)) ([9351d45](https://github.com/nodeshift/nodeshift/commit/9351d4527cd1688ef5b349ca711425c37f0e0cce))
### Bug Fixes
* update and pin the openshift-rest-client version to 4.0.1 ([#435](https://github.com/nodeshift/nodeshift/issues/435)) ([e09d2be](https://github.com/nodeshift/nodeshift/commit/e09d2be07c6a7cf97d4fcf9eb4a9682ec7a8d9e7))
* upgrade cross-env from 7.0.0 to 7.0.1 ([#428](https://github.com/nodeshift/nodeshift/issues/428)) ([56de6c6](https://github.com/nodeshift/nodeshift/commit/56de6c65c3dc1d5c143fbf5c763a29b99148e6a8))
* upgrade nock from 12.0.0 to 12.0.2 ([#427](https://github.com/nodeshift/nodeshift/issues/427)) ([8097b9d](https://github.com/nodeshift/nodeshift/commit/8097b9d38141898f046e655e1746c383c902992f))
* upgrade tape from 4.13.0 to 4.13.2 ([#429](https://github.com/nodeshift/nodeshift/issues/429)) ([f064833](https://github.com/nodeshift/nodeshift/commit/f064833f04fb2efb37b1fb49714a214a3db82e04))
* upgrade yargs from 15.1.0 to 15.2.0 ([#426](https://github.com/nodeshift/nodeshift/issues/426)) ([fefb21e](https://github.com/nodeshift/nodeshift/commit/fefb21eacfd012d0babee1e16b56447b5fe0e1be))
### [6.0.1](https://github.com/nodeshift/nodeshift/compare/v6.0.0...v6.0.1) (2020-02-19)

@@ -7,0 +36,0 @@

2

index.js

@@ -28,2 +28,3 @@ 'use strict';

@param {object} [options.build] -
@param {string} [options.build.strategy] - flag to change the build strategy used. Values can be Docker or Source. Defaults to Source
@param {string/boolean} [options.build.recreate] - flag to recreate a buildConfig or Imagestream. values are "buildConfig", "imageStream", true, false. Defaults to false

@@ -135,2 +136,3 @@ @param {boolean} [options.build.forcePull] - flag to make your BuildConfig always pull a new image from dockerhub or not. Defaults to false

@param {object} [options.build] -
@param {string} [options.build.strategy] - flag to change the build strategy used. Values can be Docker or Source. Defaults to Source
@param {string/boolean} [options.build.recreate] - flag to recreate a buildConfig or Imagestream. values are "buildConfig", "imageStream", true, false. Defaults to false

@@ -137,0 +139,0 @@ @param {boolean} [options.build.forcePull] - flag to make your BuildConfig always pull a new image from dockerhub or not. Defaults to false

6

lib/build-config.js

@@ -102,3 +102,4 @@ /*

buildEnv: config.build.env,
webApp: config.webApp
webApp: config.webApp,
buildStrategy: config.build.strategy
});

@@ -121,3 +122,4 @@ return config.openshiftRestClient.apis.build.v1.ns(config.namespace.name).buildconfigs.post({ body: newBuildConfig });

buildEnv: config.build.env,
webApp: config.webApp
webApp: config.webApp,
buildStrategy: config.build.strategy
});

@@ -124,0 +126,0 @@ return config.openshiftRestClient.apis.build.v1.ns(config.namespace.name).buildconfigs.post({ body: newBuildConfig });

@@ -29,18 +29,33 @@ /*

const DEFAULT_WEB_APP_DOCKER_IMAGE = 'nodeshift/ubi8-s2i-web-app';
// Adding in the DOCKER build strategy
// TODO: Create a basic Dockerfile for the user if there isn't one in their repo
// How is this really different from using s2i?
// I guess it allows the user to specify a different Node image to use that isn't a s2i image
// We could re-use the `dockerImage` and `dockerTag` flags
// And default the node image to be the community image and the tag to be lts?
// TODO: Add "replace Dockerfile FROM image"
// Add custom Dockerfile path
// Add custom Docker build arguements
// https://docs.openshift.com/container-platform/4.4/builds/build-strategies.html#builds-strategy-docker-build_build-strategies
// https://docs.openshift.com/online/rest_api/openshift_v1.html#v1-buildstrategy
module.exports = (options = {}) => {
// Setting appropriate docker image if web-app flag is set
options.dockerImage = options.webApp ? DEFAULT_WEB_APP_DOCKER_IMAGE : options.dockerImage;
module.exports = (options) => {
logger.info(`Using the ${options.buildStrategy} Build Strategy`);
// Just doing the source strategy
const dockerImage = options.dockerImage ? options.dockerImage : DEFAULT_DOCKER_IMAGE;
const dockerTag = options.imageTag ? options.imageTag : DEFAULT_DOCKER_TAG;
logger.info(`Using s2i image ${dockerImage} with tag ${dockerTag}`);
const dockerImageName = `${dockerImage}:${dockerTag}`;
const env = options.buildEnv || [];
return {
type: 'Source',
sourceStrategy: {
const strategy = {};
strategy.type = options.buildStrategy;
if (options.buildStrategy === 'Source') {
// Setting appropriate docker image if web-app flag is set
options.dockerImage = options.webApp ? DEFAULT_WEB_APP_DOCKER_IMAGE : options.dockerImage;
// Just doing the source strategy
const dockerImage = options.dockerImage ? options.dockerImage : DEFAULT_DOCKER_IMAGE;
const dockerTag = options.imageTag ? options.imageTag : DEFAULT_DOCKER_TAG;
logger.info(`Using s2i image ${dockerImage} with tag ${dockerTag}`);
const dockerImageName = `${dockerImage}:${dockerTag}`;
strategy.sourceStrategy = {
env: env,

@@ -53,4 +68,12 @@ from: {

forcePull: options.forcePull
}
};
};
} else {
// This is the Docker build strategy
strategy.dockerStrategy = {
dockerfilePath: 'Dockerfile',
env: env
};
}
return strategy;
};

@@ -26,2 +26,3 @@ /*

const readFile = promisify(fs.readFile);
const _ = require('lodash');

@@ -71,2 +72,18 @@ async function setup (options = {}) {

options.outputImageStreamTag = options.outputImageStreamTag || 'latest';
// TODO: do build strategy here
// TODO: update buildName based on source or docker strat
options.build = options.build || {};
// default to the Source(s2i) build strategy
// values should be either DOCKER or SOURCE
options.build.strategy = options.build.strategy || 'Source';
// Make sure the first letter is upperCase
options.build.strategy = _.upperFirst(options.build.strategy.toLowerCase());
// We only support these 2 strategies, so convert to Source if it is an unknown strat.
if (options.build.strategy !== 'Docker' && options.build.strategy !== 'Source') {
logger.warning(`An unknow build strategy, ${options.build.strategy}, was specified, using the Source strategy instead`);
options.build.strategy = 'Source';
}
// Return a new object with the config, the rest client and other data.

@@ -81,3 +98,3 @@ return Object.assign({}, config, {

// Since we are only doing s2i builds(atm), append the s2i bit to the end
buildName: `${projectPackage.name}-s2i`,
buildName: `${projectPackage.name}-s2i`, // TODO(lholmquist): this should probabl change?
// Load an instance of the Openshift Rest Client, https://www.npmjs.com/package/openshift-rest-client

@@ -84,0 +101,0 @@ openshiftRestClient: restClient

{
"name": "nodeshift",
"version": "6.1.0-alpha.0",
"version": "6.1.0",
"description": "Plugin for running openshift deployments",

@@ -59,3 +59,3 @@ "bin": {

"mkdirp": "^1.0.3",
"openshift-rest-client": "~4.1.0-alpha.0",
"openshift-rest-client": "4.0.1",
"tar": "~6.0.1",

@@ -65,5 +65,5 @@ "yargs": "^15.2.0"

"devDependencies": {
"coveralls": "~3.0.6",
"coveralls": "~3.0.13",
"cross-env": "^7.0.1",
"documentation": "~12.1.0",
"documentation": "~12.3.0",
"eslint": "^6.0.1",

@@ -73,3 +73,3 @@ "eslint-config-semistandard": "^15.0.0",

"eslint-plugin-import": "~2.20.1",
"eslint-plugin-node": "~11.0.0",
"eslint-plugin-node": "~11.1.0",
"eslint-plugin-promise": "~4.2.1",

@@ -82,3 +82,3 @@ "eslint-plugin-standard": "^4.0.0",

"sinon": "~9.0.0",
"standard-version": "^7.0.0",
"standard-version": "^8.0.0",
"tap-spec": "^5.0.0",

@@ -85,0 +85,0 @@ "tape": "~4.13.2"

@@ -195,2 +195,5 @@ # Nodeshift [![CircleCI](https://circleci.com/gh/nodeshift/nodeshift.svg?style=svg)](https://circleci.com/gh/nodeshift/nodeshift)

#### build.strategy
Flag to change the build strategy used. Values can be Docker or Source. Defaults to Source
#### help

@@ -248,2 +251,4 @@ Shows the below help

[boolean] [choices: true, false] [default: false]
--build.strategy flag to change the build strategy. Defaults to Source
[choices: "Source", "Docker"]
--metadata.out determines what should be done with the response

@@ -250,0 +255,0 @@ metadata from OpenShift

Sorry, the diff of this file is not supported yet

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