Skip to content

Commit

Permalink
feat!: Default to Node 14 for the build image (#536)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This updates the default builder image to use Node 14 instead of Node 10
  • Loading branch information
lholmquist committed Feb 1, 2021
1 parent dc77ebc commit 76b6420
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ flag to pass into the openshift rest client for logging in with a self signed ce

#### imageTag
Specify the tag of the docker image to use for the deployed application. defaults to latest.
These version tags correspond to the RHSCL tags of the [ubi8/nodejs s2i images](https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/nodejs-10)
These version tags correspond to the RHSCL tags of the [ubi8/nodejs s2i images](https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/nodejs-14)

#### dockerImage
Specify the s2i builder image of Node.js to use for the deployed applications. Defaults to [ubi8/nodejs s2i images](https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/nodejs-10)
Specify the s2i builder image of Node.js to use for the deployed applications. Defaults to [ubi8/nodejs s2i images](https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/nodejs-14)

#### web-app
Flag to automatically set the appropriate docker image for web app deployment. Defaults to false
Expand Down
2 changes: 1 addition & 1 deletion bin/nodeshift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ yargs
type: 'boolean'
})
.options('dockerImage', {
describe: 'the s2i image to use, defaults to registry.access.redhat.com/ubi8/nodejs-10',
describe: 'the s2i image to use, defaults to registry.access.redhat.com/ubi8/nodejs-14',
type: 'string'
})
.options('imageTag', {
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const cli = require('./bin/cli');
@param {boolean} [options.namespace.create] - flag to create the namespace if it does not exist. Only applicable for the build and deploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.resourceProfile] - Define a subdirectory below .nodeshift/ that indicates where Openshift resources are stored
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-10. Versions are ubi8/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-10
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-14. Versions are ubi8/nodejs-14 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-14
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down Expand Up @@ -64,7 +64,7 @@ function deploy (options = {}) {
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.resourceProfile] - Define a subdirectory below .nodeshift/ that indicates where Openshift resources are stored
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-10. Versions are ubi8/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-10
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-14. Versions are ubi8/nodejs-14 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-14
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down Expand Up @@ -99,7 +99,7 @@ function resource (options = {}) {
@param {boolean} [options.namespace.create] - flag to create the namespace if it does not exist. Only applicable for the build and deploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.resourceProfile] - Define a subdirectory below .nodeshift/ that indicates where Openshift resources are stored
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-10. Versions are ubi8/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-10
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-14. Versions are ubi8/nodejs-14 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-14
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down Expand Up @@ -136,7 +136,7 @@ function applyResource (options = {}) {
@param {boolean} [options.namespace.remove] - flag to remove the user created namespace. Only applicable for the undeploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.resourceProfile] - Define a subdirectory below .nodeshift/ that indicates where Openshift resources are stored
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-10. Versions are ubi8/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-10
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-14. Versions are ubi8/nodejs-14 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-14
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down Expand Up @@ -173,7 +173,7 @@ function undeploy (options = {}) {
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {boolean} [options.namespace.create] - flag to create the namespace if it does not exist. Only applicable for the build and deploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-10. Versions are ubi8/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-10
@param {string} [options.imageTag] - set the version to use for the ubi8/nodejs-14. Versions are ubi8/nodejs-14 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-14
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down
2 changes: 1 addition & 1 deletion lib/definitions/build-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
const logger = require('../common-log')();

// Perhaps we should define this in another location
const DEFAULT_DOCKER_IMAGE = 'registry.access.redhat.com/ubi8/nodejs-10';
const DEFAULT_DOCKER_IMAGE = 'registry.access.redhat.com/ubi8/nodejs-14';
const DEFAULT_DOCKER_TAG = 'latest';

// Default docker image for web-apps
Expand Down
10 changes: 5 additions & 5 deletions test/definitions-tests/build-strategy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ test('default strategy', (t) => {

t.equal(result.type, 'Source', 'default is Source type');
t.ok(result.sourceStrategy, 'Source strategy object');
t.equal(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-10:latest', 'docker image should be ubi8/nodejs-10:latest image');
t.equal(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-14:latest', 'docker image should be ubi8/nodejs-14:latest image');
t.equal(result.sourceStrategy.forcePull, undefined, 'no forcePull by default');

t.end();
});

test('strategy with changed dockerTag', (t) => {
const result = buildStrategy({ imageTag: '1-20', buildStrategy: 'Source' });
t.equal(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-10:1-20', 'docker image should be 1-20 ubi8/nodejs-10 image');
t.equal(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-14:1-20', 'docker image should be 1-20 ubi8/nodejs-14 image');
t.end();
});

Expand Down Expand Up @@ -67,17 +67,17 @@ test('strategy with env vars', (t) => {
t.end();
});

test('defaults to using latest ubi8/nodejs-10 s2i builder image', t => {
test('defaults to using latest ubi8/nodejs-14 s2i builder image', t => {
const result = buildStrategy({ buildStrategy: 'Source' });

t.equals(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-10:latest');
t.equals(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-14:latest');
t.end();
});

test('accepts a node version using imageTag option', t => {
const result = buildStrategy({ imageTag: '1-20', buildStrategy: 'Source' });

t.equals(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-10:1-20');
t.equals(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-14:1-20');
t.end();
});

Expand Down

0 comments on commit 76b6420

Please sign in to comment.