nodeshift
Advanced tools
Comparing version 8.5.0 to 8.6.0
@@ -5,2 +5,25 @@ # Changelog | ||
## [8.6.0](https://www.github.com/nodeshift/nodeshift/compare/v8.5.0...v8.6.0) (2021-10-18) | ||
### Features | ||
* docker-desktop kube option ([#601](https://www.github.com/nodeshift/nodeshift/issues/601)) ([ddd45e9](https://www.github.com/nodeshift/nodeshift/commit/ddd45e97dc2148fc8d7864ecc96d5b8758fa5877)) | ||
### Bug Fixes | ||
* package.json & package-lock.json to reduce vulnerabilities ([#592](https://www.github.com/nodeshift/nodeshift/issues/592)) ([cdd1ac8](https://www.github.com/nodeshift/nodeshift/commit/cdd1ac8eda6054b9cad4761e0d54855193ed4e95)) | ||
* package.json & package-lock.json to reduce vulnerabilities ([#594](https://www.github.com/nodeshift/nodeshift/issues/594)) ([32a36bb](https://www.github.com/nodeshift/nodeshift/commit/32a36bb2c7cbe26624131b2f79073e14d3ecc001)) | ||
* upgrade dockerode from 3.3.0 to 3.3.1 ([#599](https://www.github.com/nodeshift/nodeshift/issues/599)) ([82cd6b1](https://www.github.com/nodeshift/nodeshift/commit/82cd6b11f3d163b13e423a31beab530828f313f9)) | ||
* upgrade eslint from 7.16.0 to 7.32.0 ([#596](https://www.github.com/nodeshift/nodeshift/issues/596)) ([649d391](https://www.github.com/nodeshift/nodeshift/commit/649d391bdee6a4c7867d6705f031354f5607b6bb)) | ||
* upgrade eslint-plugin-import from 2.23.4 to 2.24.0 ([#590](https://www.github.com/nodeshift/nodeshift/issues/590)) ([63ce7fd](https://www.github.com/nodeshift/nodeshift/commit/63ce7fd33828fc001c4527805938204404404d0a)) | ||
* upgrade eslint-plugin-import from 2.24.0 to 2.24.1 ([#593](https://www.github.com/nodeshift/nodeshift/issues/593)) ([fe8d7c4](https://www.github.com/nodeshift/nodeshift/commit/fe8d7c45ae261c1b8e562417dd21fa1c1d8cb11e)) | ||
* upgrade eslint-plugin-import from 2.24.1 to 2.24.2 ([#598](https://www.github.com/nodeshift/nodeshift/issues/598)) ([0adf9cf](https://www.github.com/nodeshift/nodeshift/commit/0adf9cf968d9332ec5ddbbbc07aa6806d93047a2)) | ||
* upgrade tape from 5.2.2 to 5.3.1 ([#589](https://www.github.com/nodeshift/nodeshift/issues/589)) ([89533a8](https://www.github.com/nodeshift/nodeshift/commit/89533a852d4da80883dfe87c7543913e063ab9df)) | ||
* upgrade tar from 6.1.4 to 6.1.6 ([#587](https://www.github.com/nodeshift/nodeshift/issues/587)) ([f99fa8c](https://www.github.com/nodeshift/nodeshift/commit/f99fa8c9b9ef87415847af2654511c5cef152b32)) | ||
* upgrade tar from 6.1.9 to 6.1.11 ([#597](https://www.github.com/nodeshift/nodeshift/issues/597)) ([84ae60a](https://www.github.com/nodeshift/nodeshift/commit/84ae60aef0ee7afb91056a18ef2adedb15092741)) | ||
* upgrade typescript from 4.3.5 to 4.4.2 ([#595](https://www.github.com/nodeshift/nodeshift/issues/595)) ([aa81f2b](https://www.github.com/nodeshift/nodeshift/commit/aa81f2b0ceaee6e35f151d19e265968510d7a98c)) | ||
* upgrade typescript from 4.4.2 to 4.4.3 ([#600](https://www.github.com/nodeshift/nodeshift/issues/600)) ([3997b53](https://www.github.com/nodeshift/nodeshift/commit/3997b532998c065b9034c7dc4b12914cbcbdfb77)) | ||
## [8.5.0](https://www.github.com/nodeshift/nodeshift/compare/v8.4.0...v8.5.0) (2021-08-23) | ||
@@ -7,0 +30,0 @@ |
12
index.js
@@ -74,3 +74,3 @@ 'use strict'; | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@param {boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. At the moment only Minikube is supported. Defaults to false | ||
@param {string/boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. Defaults to false. options are 'minikube' or 'docker-desktop' | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -117,3 +117,3 @@ */ | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@param {boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. At the moment only Minikube is supported. Defaults to false | ||
@param {string/boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. Defaults to false. options are 'minikube' or 'docker-desktop' | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -155,3 +155,3 @@ */ | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@param {boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. At the moment only Minikube is supported. Defaults to false | ||
@param {string/boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. Defaults to false. options are 'minikube' or 'docker-desktop' | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -196,3 +196,3 @@ */ | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@param {boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. At the moment only Minikube is supported. Defaults to false | ||
@param {string/boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. Defaults to false. options are 'minikube' or 'docker-desktop' | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -236,3 +236,3 @@ */ | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@param {boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. At the moment only Minikube is supported. Defaults to false | ||
@param {string/boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. Defaults to false. options are 'minikube' or 'docker-desktop' | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -271,3 +271,3 @@ */ | ||
@param {array} [options.definedProperties] - Array of objects with the format { key: value }. Used for template substitution | ||
@param {boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. At the moment only Minikube is supported. Defaults to false | ||
@param {string/boolean} [options.kube] - Flag to deploy an application to a vanilla kubernetes cluster. Defaults to false. options are 'minikube' or 'docker-desktop' | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -274,0 +274,0 @@ */ |
@@ -7,12 +7,18 @@ 'use strict'; | ||
function dockerClientSetup (options = {}, kubeEnvVars) { | ||
const url = new URL(kubeEnvVars.DOCKER_HOST); | ||
let docker; | ||
const docker = new Docker({ | ||
host: url.hostname, | ||
port: url.port || 2375, | ||
ca: readFileSync(`${kubeEnvVars.DOCKER_CERT_PATH}/ca.pem`), | ||
cert: readFileSync(`${kubeEnvVars.DOCKER_CERT_PATH}/cert.pem`), | ||
key: readFileSync(`${kubeEnvVars.DOCKER_CERT_PATH}/key.pem`) | ||
}); | ||
if (options.kube === 'minikube') { | ||
const url = new URL(kubeEnvVars.DOCKER_HOST); | ||
docker = new Docker({ | ||
host: url.hostname, | ||
port: url.port || 2375, | ||
ca: readFileSync(`${kubeEnvVars.DOCKER_CERT_PATH}/ca.pem`), | ||
cert: readFileSync(`${kubeEnvVars.DOCKER_CERT_PATH}/cert.pem`), | ||
key: readFileSync(`${kubeEnvVars.DOCKER_CERT_PATH}/key.pem`) | ||
}); | ||
} else { | ||
docker = new Docker(); | ||
} | ||
return docker; | ||
@@ -19,0 +25,0 @@ } |
@@ -114,2 +114,4 @@ /* | ||
console.log(currentContext); | ||
const currentCluster = contexts.find(context => context.name === currentContext); | ||
@@ -140,7 +142,8 @@ const config = { | ||
if (options.kube) { | ||
logger.info('Using the kubernetes flag.'); | ||
logger.info(`Using the kubernetes flag. Using ${options.kube}`); | ||
// Assume minikube for now | ||
// TODO(lholmquist): other kube flavors | ||
const kubeEnvVars = await kubernetesConfig(); | ||
let kubeEnvVars; | ||
if (options.kube === 'minikube') { | ||
kubeEnvVars = await kubernetesConfig(); | ||
} | ||
// Pass these kube envs to the docker client setup thingy | ||
@@ -147,0 +150,0 @@ dockerClient = dockerConfig(options, kubeEnvVars); |
@@ -127,7 +127,9 @@ /* | ||
// Parse that into JSON | ||
const parsedChunk = JSON.parse(chunkAsString); | ||
// Depending on if we have verbose output on or off, the location of the sha is differnt | ||
// traverse the entries to find where the sha is, then split on : and take the last value | ||
imageId = findShaID(parsedChunk); | ||
let parsedChunk; | ||
try { | ||
parsedChunk = JSON.parse(chunkAsString); | ||
imageId = findShaID(parsedChunk); | ||
} catch (err) { | ||
imageId = findShaIDNonJSON(chunkAsString.split(':')); | ||
} | ||
} | ||
@@ -155,2 +157,10 @@ }); | ||
function findShaIDNonJSON (value) { | ||
for (let i = 0; i < value.length; i++) { | ||
if (value[i].includes('sha')) { | ||
return value[i + 1].replace('"}}', ''); | ||
} | ||
} | ||
} | ||
module.exports = exports = { | ||
@@ -157,0 +167,0 @@ archiveAndTar: archiveAndTar, |
{ | ||
"name": "nodeshift", | ||
"version": "8.5.0", | ||
"version": "8.6.0", | ||
"description": "Plugin for running openshift deployments", | ||
@@ -41,3 +41,3 @@ "bin": { | ||
"chalk": "^3.0.0", | ||
"dockerode": "~3.3.0", | ||
"dockerode": "~3.3.1", | ||
"git-repo-info": "^2.0.0", | ||
@@ -50,3 +50,3 @@ "js-yaml": "~3.14.1", | ||
"parse-gitignore": "^1.0.1", | ||
"tar": "~6.1.4", | ||
"tar": "~6.1.11", | ||
"yargs": "^16.2.0" | ||
@@ -58,6 +58,6 @@ }, | ||
"documentation": "~13.2.5", | ||
"eslint": "^6.0.1", | ||
"eslint": "^7.32.0", | ||
"eslint-config-semistandard": "^15.0.1", | ||
"eslint-config-standard": "^14.0.0", | ||
"eslint-plugin-import": "~2.23.4", | ||
"eslint-plugin-import": "~2.24.2", | ||
"eslint-plugin-node": "~11.1.0", | ||
@@ -73,6 +73,6 @@ "eslint-plugin-promise": "~4.3.1", | ||
"tap-spec": "^5.0.0", | ||
"tape": "~5.2.2", | ||
"typescript": "~4.3.5" | ||
"tape": "~5.3.1", | ||
"typescript": "~4.4.3" | ||
}, | ||
"support": true | ||
} |
@@ -202,10 +202,17 @@ # Nodeshift | ||
Nodeshift can deploy Node.js applications to a Kubernetes Cluster using the `--kube` flag. At the moment, there is only support for [minikube](https://minikube.sigs.k8s.io/docs/start/). | ||
Nodeshift can deploy Node.js applications to a Kubernetes Cluster using the `--kube` flag. | ||
Nodeshift expects that your code has a Dockerfile in its root directory. Then deploying to Minikube is as easy as running: | ||
There are 2 options that can be passed. `minikube` or `docker-desktop` . Passing just the `--kube` flag will default to minikube | ||
`npx nodeshift --kube` | ||
Nodeshift expects that your code has a Dockerfile in its root directory. Then deploying to kubernetes is as easy as running: | ||
This connect to Minikubes docker server, create a new container and then deploy and expose that container with a `Deployment` and `Service` | ||
`npx nodeshift --kube=minikube` | ||
Note on Minikube: This connects to Minikubes docker server, create a new container and then deploy and expose that container with a `Deployment` and `Service` | ||
To learn more about [minikube](https://minikube.sigs.k8s.io/docs/start/). | ||
To learn more about [docker-desktop](https://docs.docker.com/desktop/kubernetes/). | ||
#### Openshift Rest Client Configuration | ||
@@ -212,0 +219,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
258949
3860
421
Updateddockerode@~3.3.1
Updatedtar@~6.1.11