update docs and comments, add servezone compatibility
This commit is contained in:
parent
66bef3cd60
commit
61ee70ea8d
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
node_modules/
|
||||
coverage/
|
||||
docs/
|
||||
pages/
|
||||
config.json
|
@ -4,6 +4,7 @@ stages:
|
||||
- test
|
||||
- release
|
||||
- trigger
|
||||
- page
|
||||
|
||||
|
||||
before_script:
|
||||
@ -54,4 +55,16 @@ trigger:
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- docker
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmpage
|
||||
stage: page
|
||||
script:
|
||||
- npmci command npmpage --host gitlab
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
|
@ -1,4 +1,4 @@
|
||||
docs/
|
||||
pages/
|
||||
coverage/
|
||||
test/
|
||||
node_modules/
|
||||
|
14
README.md
14
README.md
@ -1,8 +1,20 @@
|
||||
# NPMCI
|
||||
npmci is your friend when it comes to handling npm packages during CI builds. It is optimized for GitLab CI
|
||||
|
||||
## Status
|
||||
## Availabililty
|
||||
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmci)
|
||||
[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/npmci)
|
||||
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/npmci)
|
||||
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/npmci/docs)
|
||||
|
||||
## Status for master
|
||||
[![build status](https://gitlab.com/pushrocks/npmci/badges/master/build.svg)](https://gitlab.com/pushrocks/npmci/commits/master)
|
||||
[![coverage report](https://gitlab.com/pushrocks/npmci/badges/master/coverage.svg)](https://gitlab.com/pushrocks/npmci/commits/master)
|
||||
[![Dependency Status](https://david-dm.org/pushrocks/npmci.svg)](https://david-dm.org/pushrocks/npmci)
|
||||
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmci/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmci/master/dependencies/npm)
|
||||
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmci/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmci)
|
||||
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
|
||||
## Usage
|
||||
npmci is designed to work in docker CI environments. The following docker images come with npmci presinstalled:
|
||||
|
10
appveyor.yml
10
appveyor.yml
@ -1,10 +0,0 @@
|
||||
environment:
|
||||
nodejs_version: "4"
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
- npm install
|
||||
test_script:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm test
|
||||
build: off
|
4
dist/npmci.bash.js
vendored
4
dist/npmci.bash.js
vendored
@ -42,11 +42,11 @@ exports.bash = (commandArg, retryArg = 2, bareArg = false) => {
|
||||
}
|
||||
}
|
||||
else {
|
||||
plugins.beautylog.log("ShellExec would be: " + commandArg.blue);
|
||||
plugins.beautylog.log("ShellExec would be: " + commandArg);
|
||||
}
|
||||
return stdOut;
|
||||
};
|
||||
exports.bashBare = (commandArg, retryArg = 2) => {
|
||||
return exports.bash(commandArg, retryArg, true);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuYmFzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLmJhc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixNQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBRzNDLElBQUksZUFBZS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UFDLENBQUEifQ==
|
4
dist/npmci.install.js
vendored
4
dist/npmci.install.js
vendored
@ -5,7 +5,7 @@ const npmci_bash_1 = require("./npmci.bash");
|
||||
const npmci_bash_2 = require("./npmci.bash");
|
||||
exports.install = (versionArg) => {
|
||||
let done = plugins.q.defer();
|
||||
plugins.beautylog.log("now installing " + "node ".green + ("version " + versionArg).yellow);
|
||||
plugins.beautylog.log(`now installing node version ${versionArg}`);
|
||||
let version;
|
||||
if (versionArg == "stable") {
|
||||
version = "6.3.0";
|
||||
@ -33,4 +33,4 @@ exports.install = (versionArg) => {
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuaW5zdGFsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLmluc3RhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixNQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDZCQUFxQixjQUFjLENBQUMsQ0FBQTtBQUNwQyw2QkFBNkIsY0FFN0IsQ0FBQyxDQUYwQztBQUVoQyxlQUFPLEdBQUcsQ0FBQyxVQUFVO0lBQzVCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEdBQUcsT0FBTyxDQUFDLEtBQUssR0FBRyxDQUFDLFVBQVUsR0FBRyxVQUFVLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUM1RixJQUFJLE9BQWUsQ0FBQztJQUNwQixFQUFFLENBQUMsQ0FBQyxVQUFVLElBQUksUUFBUSxDQUFDLENBQUMsQ0FBQztRQUN6Qix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QUFBO1FBQzlELE9BQU8sQ0FBQyxTQUFTLENBQUMsT0FBTyxDQUFDLGdCQUFnQixPQUFPLDBCQUEwQixDQUFDLENBQUM7SUFDakYsQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ0osT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsdURBQXVELENBQUMsQ0FBQztJQUNwRixDQUFDO0lBQUEsQ0FBQztJQUNGLGlCQUFJLENBQUMsU0FBUyxDQUFDLENBQUM7SUFDaEIsaUJBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUNmLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNmLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQSJ9
|
1
dist/npmci.plugins.d.ts
vendored
1
dist/npmci.plugins.d.ts
vendored
@ -11,6 +11,7 @@ export import shelljs = require("shelljs");
|
||||
export import smartcli = require("smartcli");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartparam = require("smartparam");
|
||||
export import smartsocket = require("smartsocket");
|
||||
export import smartssh = require("smartssh");
|
||||
export import smartstring = require("smartstring");
|
||||
export declare let through2: any;
|
||||
|
3
dist/npmci.plugins.js
vendored
3
dist/npmci.plugins.js
vendored
@ -12,7 +12,8 @@ exports.shelljs = require("shelljs");
|
||||
exports.smartcli = require("smartcli");
|
||||
exports.smartfile = require("smartfile");
|
||||
exports.smartparam = require("smartparam");
|
||||
exports.smartsocket = require("smartsocket");
|
||||
exports.smartssh = require("smartssh");
|
||||
exports.smartstring = require("smartstring");
|
||||
exports.through2 = require("through2");
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQ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QUMsQ0FBQztBQUN2QixvQkFBWSxHQUFHLE9BQU8sQ0FBQyxlQUFlLENBQUMsQ0FBQztBQUN4QyxjQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBQ3hCLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixtQkFBVyxXQUFXLGFBQWEsQ0FBQyxDQUFDO0FBQ3JDLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQztBQUNwQixlQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQzFCLGVBQU8sV0FBVyxTQUFTLENBQUMsQ0FBQztBQUM3QixnQkFBUSxXQUFXLFVBQVUsQ0FBQyxDQUFDO0FBQy9CLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsa0JBQVUsV0FBVyxZQUFZLENBQUMsQ0FBQztBQUNuQyxtQkFBVyxXQUFXLGFBQWEsQ0FBQyxDQUFDO0FBQ3JDLGdCQUFRLFdBQVcsVUFBVSxDQUFDLENBQUM7QUFDL0IsbUJBQVcsV0FBVyxhQUFhLENBQUMsQ0FBQztBQUN4QyxnQkFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyJ9
|
10
dist/npmci.publish.d.ts
vendored
10
dist/npmci.publish.d.ts
vendored
@ -1,4 +1,12 @@
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
export declare let publish: (serviceArg?: string) => plugins.q.Promise<{}>;
|
||||
/**
|
||||
* type of supported services
|
||||
*/
|
||||
export declare type registryService = "npm" | "docker";
|
||||
/**
|
||||
* the main exported publish function.
|
||||
* @param registryServiceArg the serviceArg
|
||||
*/
|
||||
export declare let publish: (registryServiceArg?: registryService) => plugins.q.Promise<{}>;
|
||||
|
16
dist/npmci.publish.js
vendored
16
dist/npmci.publish.js
vendored
@ -4,14 +4,21 @@ const plugins = require("./npmci.plugins");
|
||||
const npmci_prepare_1 = require("./npmci.prepare");
|
||||
const npmci_bash_1 = require("./npmci.bash");
|
||||
const NpmciBuildDocker = require("./npmci.build.docker");
|
||||
exports.publish = (serviceArg = "npm") => {
|
||||
switch (serviceArg) {
|
||||
/**
|
||||
* the main exported publish function.
|
||||
* @param registryServiceArg the serviceArg
|
||||
*/
|
||||
exports.publish = (registryServiceArg = "npm") => {
|
||||
switch (registryServiceArg) {
|
||||
case "npm":
|
||||
return publishNpm();
|
||||
case "docker":
|
||||
return publishDocker();
|
||||
}
|
||||
};
|
||||
/**
|
||||
* tries to publish project at cwd to npm
|
||||
*/
|
||||
let publishNpm = function () {
|
||||
let done = plugins.q.defer();
|
||||
npmci_prepare_1.prepare("npm")
|
||||
@ -22,6 +29,9 @@ let publishNpm = function () {
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
/**
|
||||
* tries to pubish current cwd to Docker registry
|
||||
*/
|
||||
let publishDocker = function () {
|
||||
let done = plugins.q.defer();
|
||||
NpmciBuildDocker.readDockerfiles()
|
||||
@ -30,4 +40,4 @@ let publishDocker = function () {
|
||||
.then(done.resolve);
|
||||
return done.promise;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kucHVibGlzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixNQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLGdDQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDZCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUVsQyxNQUFZLGdCQUFnQixXQUFNLHNCQUVsQyxDQUFDLENBRnVEO0FBRTdDLGVBQU8sR0FBRyxDQUFDLFVBQV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yxDQUFBO0FBRUQ7O0dBRUc7QUFDSCxJQUFJLGFBQWEsR0FBRztJQUNoQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQ3pCLGdCQUFnQixDQUFDLGVBQWUsRUFBRTtTQUNqQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsb0JBQW9CLENBQUM7U0FDM0MsSUFBSSxDQUFDLGdCQUFnQixDQUFDLGVBQWUsQ0FBQztTQUN0QyxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3hCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9
|
4
dist/npmci.servezone.d.ts
vendored
Normal file
4
dist/npmci.servezone.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* the main run function to submit a service to a servezone
|
||||
*/
|
||||
export declare let run: (configArg: any) => void;
|
28
dist/npmci.servezone.js
vendored
Normal file
28
dist/npmci.servezone.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
const plugins = require("./npmci.plugins");
|
||||
/**
|
||||
* servezoneRegex is the regex that parses the servezone connection data
|
||||
* parses strings in the form of "servezone.example.com|3000|somepassword"
|
||||
*/
|
||||
let servezoneRegex = /^(.*)\|(.*)\|(.*)/;
|
||||
/**
|
||||
* holds the results of the parsed servezone env string
|
||||
*/
|
||||
let servezoneRegexResultArray = servezoneRegex.exec(process.env.NPMCI_SERVEZONE);
|
||||
/**
|
||||
* the data object that is used for the smartsocket client object
|
||||
*/
|
||||
let smartsocketClientConstructorOptions = {
|
||||
alias: "npmci",
|
||||
password: servezoneRegexResultArray[3],
|
||||
port: parseInt(servezoneRegexResultArray[2]),
|
||||
role: "ci",
|
||||
url: servezoneRegexResultArray[1]
|
||||
};
|
||||
/**
|
||||
* the main run function to submit a service to a servezone
|
||||
*/
|
||||
exports.run = (configArg) => {
|
||||
new plugins.smartsocket.SmartsocketClient(smartsocketClientConstructorOptions);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuc2VydmV6b25lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuc2VydmV6b25lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBRTNDOzs7R0FHRztBQUNILElBQUksY0FBYyxHQUFHLG1CQUFtQixDQUFDO0FBRXpDOztHQUVHO0FBQ0gsSUFBSSx5QkFBeUIsR0FBRyxjQUFjLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsZUFBZSxDQUFDLENBQUM7QUFFakY7O0dBRUc7QUFDSCxJQUFJLG1DQUFtQyxHQUFHO0lBQ3RDLEtBQUssRUFBRSxPQUFPO0lBQ2QsUUFBUSxFQUFFLHlCQUF5QixDQUFDLENBQUMsQ0FBQztJQUN0QyxJQUFJLEVBQUUsUUFBUSxDQUFDLHlCQUF5QixDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzVDLElBQUksRUFBRSxJQUFJO0lBQ1YsR0FBRyxFQUFFLHlCQUF5QixDQUFDLENBQUMsQ0FBQztDQUNwQyxDQUFDO0FBRUY7O0dBRUc7QUFDUSxXQUFHLEdBQUcsQ0FBQyxTQUFTO0lBQ3ZCLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxpQkFBaUIsQ0FDckMsbUNBQW1DLENBQ3RDLENBQUM7QUFDTixDQUFDLENBQUMifQ==
|
3
dist/npmci.ssh.d.ts
vendored
3
dist/npmci.ssh.d.ts
vendored
@ -1,4 +1,7 @@
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
/**
|
||||
* checks for ENV vars in form of NPMCI_SSHKEY_* and deploys any found ones
|
||||
*/
|
||||
export declare let ssh: () => plugins.q.Promise<{}>;
|
||||
|
13
dist/npmci.ssh.js
vendored
13
dist/npmci.ssh.js
vendored
@ -3,9 +3,12 @@ require("typings-global");
|
||||
const plugins = require("./npmci.plugins");
|
||||
let sshRegex = /^(.*)\|(.*)\|(.*)/;
|
||||
let sshInstance;
|
||||
/**
|
||||
* checks for ENV vars in form of NPMCI_SSHKEY_* and deploys any found ones
|
||||
*/
|
||||
exports.ssh = () => {
|
||||
let done = plugins.q.defer();
|
||||
sshInstance = new plugins.smartssh.SshInstance();
|
||||
sshInstance = new plugins.smartssh.SshInstance(); // init ssh instance
|
||||
plugins.smartparam.forEachMinimatch(process.env, "NPMCI_SSHKEY_*", evaluateSshEnv);
|
||||
if (!process.env.NPMTS_TEST) {
|
||||
sshInstance.writeToDisk();
|
||||
@ -17,6 +20,9 @@ exports.ssh = () => {
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
};
|
||||
/**
|
||||
* gets called for each found SSH ENV Var and deploys it
|
||||
*/
|
||||
let evaluateSshEnv = (sshkeyEnvVarArg) => {
|
||||
let resultArray = sshRegex.exec(sshkeyEnvVarArg);
|
||||
let sshKey = new plugins.smartssh.SshKey();
|
||||
@ -37,7 +43,10 @@ let evaluateSshEnv = (sshkeyEnvVarArg) => {
|
||||
;
|
||||
sshInstance.addKey(sshKey);
|
||||
};
|
||||
/**
|
||||
* checks if not undefined
|
||||
*/
|
||||
let notUndefined = (stringArg) => {
|
||||
return (stringArg && stringArg != "undefined" && stringArg != "##");
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuc3NoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuc3NoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDe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DQUFDLENBQUM7QUFFRjs7R0FFRztBQUNILElBQUksWUFBWSxHQUFHLENBQUMsU0FBZ0I7SUFDaEMsTUFBTSxDQUFDLENBQUMsU0FBUyxJQUFJLFNBQVMsSUFBSSxXQUFXLElBQUksU0FBUyxJQUFJLElBQUksQ0FBQyxDQUFDO0FBQ3hFLENBQUMsQ0FBQSJ9
|
15
docs/book.json
Normal file
15
docs/book.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"structure": {
|
||||
"readme": "index.md"
|
||||
},
|
||||
"plugins": [
|
||||
"tonic",
|
||||
"edit-link"
|
||||
],
|
||||
"pluginsConfig": {
|
||||
"edit-link": {
|
||||
"base": "https://gitlab.com/pushrocks/npmts/edit/master/docs/",
|
||||
"label": "Edit on GitLab"
|
||||
}
|
||||
}
|
||||
}
|
65
docs/index.md
Normal file
65
docs/index.md
Normal file
@ -0,0 +1,65 @@
|
||||
# NPMCI
|
||||
npmci is your friend when it comes to handling npm packages during CI builds. It is optimized for GitLab CI
|
||||
|
||||
## Availabililty
|
||||
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmci)
|
||||
[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/npmci)
|
||||
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/npmci)
|
||||
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/npmci/docs)
|
||||
|
||||
## Status for master
|
||||
[![build status](https://gitlab.com/pushrocks/npmci/badges/master/build.svg)](https://gitlab.com/pushrocks/npmci/commits/master)
|
||||
[![coverage report](https://gitlab.com/pushrocks/npmci/badges/master/coverage.svg)](https://gitlab.com/pushrocks/npmci/commits/master)
|
||||
[![Dependency Status](https://david-dm.org/pushrocks/npmci.svg)](https://david-dm.org/pushrocks/npmci)
|
||||
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmci/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmci/master/dependencies/npm)
|
||||
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmci/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmci)
|
||||
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
|
||||
## Usage
|
||||
npmci is designed to work in docker CI environments. The following docker images come with npmci presinstalled:
|
||||
|
||||
Docker Hub:
|
||||
|
||||
* [hosttoday/ht-docker-node:npmci](https://hub.docker.com/r/hosttoday/ht-docker-node/)
|
||||
has LTS node version and npmci preinstalled.
|
||||
* [hosttoday/ht-docker-dbase](https://hub.docker.com/r/hosttoday/ht-docker-dbase/)
|
||||
based on docker:git, can be used to build docker images in conjunction with docker:dind
|
||||
|
||||
npmci can be called from commandline:
|
||||
```shell
|
||||
# Install any node version:
|
||||
npmci install lts # will install latest LTS node version and update PATH for node and npm versions
|
||||
npmci install stable # will install latest stable node version and update PATH for node and npm
|
||||
npmci install legacy # will install latest legacy node version and update PATH for node and npm
|
||||
npmci install x.x.x # will install any specific node version.
|
||||
|
||||
# Install any node version, install dependencies and run test in cwd:
|
||||
npmci test lts # will install latest lts node version and run "npm install" and "npm test".
|
||||
npmci test stable # will install latest stable node version and run "npm install" and "npm test".
|
||||
npmci test legacy # will install latest legacy node version and run "npm install" and "npm test".
|
||||
npmci test x.x.x # will install any specific node version and run "npm install" and "npm test".
|
||||
npmci test docker # will test any build image with tests defined in ./npmci/dockertest_1.sh to ./npmci/dockertest_100.sh
|
||||
## npmci test docker will look at all Dockerfiles and look for according tags on GitLab container registry
|
||||
|
||||
|
||||
# prepare tools
|
||||
npmci prepare npm # will look for $NPMCI_TOKEN_NPM env var and create .npmrc, so npm is authenticated
|
||||
npmci prepare docker # will look for $NPMCI_LOGIN_DOCKER in form username|password and authenticate docker
|
||||
npmci prepare docker-gitlab # will authenticate docker for gitlab container registry
|
||||
|
||||
# build containers
|
||||
npmci build docker # will build containers
|
||||
## all Dockerfiles named DOckerfile* are picked up.
|
||||
## specify tags lake this Dockerfile_[tag]
|
||||
## uploads all built images as [username]/[reponame]:[tag]_test to GitLab
|
||||
## then test in next step with "npmci test docker"
|
||||
|
||||
# publish npm module
|
||||
npmci publish npm # will look vor $NPMCI_TOKEN_NPM env var and push any module in cwd to npm
|
||||
npmci publish docker
|
||||
|
||||
# trigger webhooks
|
||||
npmci trigger # will look for NPMCI_TRIGGER_1 to NPMCI_TRIGGER_100 in form domain|id|token|ref|name
|
||||
```
|
||||
|
@ -42,6 +42,7 @@
|
||||
"smartcli": "^1.0.4",
|
||||
"smartfile": "^4.0.12",
|
||||
"smartparam": "^0.1.1",
|
||||
"smartsocket": "^1.1.4",
|
||||
"smartssh": "^1.1.5",
|
||||
"smartstring": "^2.0.15",
|
||||
"through2": "^2.0.1",
|
||||
|
@ -40,7 +40,7 @@ export let bash = (commandArg: string, retryArg = 2, bareArg = false) => {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugins.beautylog.log("ShellExec would be: " + commandArg.blue)
|
||||
plugins.beautylog.log("ShellExec would be: " + commandArg)
|
||||
}
|
||||
return stdOut;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { nvmAvailable } from "./npmci.bash"
|
||||
|
||||
export let install = (versionArg) => {
|
||||
let done = plugins.q.defer();
|
||||
plugins.beautylog.log("now installing " + "node ".green + ("version " + versionArg).yellow);
|
||||
plugins.beautylog.log(`now installing node version ${versionArg}`);
|
||||
let version: string;
|
||||
if (versionArg == "stable") {
|
||||
version = "6.3.0";
|
||||
|
@ -11,6 +11,7 @@ export import shelljs = require("shelljs");
|
||||
export import smartcli = require("smartcli");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartparam = require("smartparam");
|
||||
export import smartsocket = require("smartsocket");
|
||||
export import smartssh = require("smartssh");
|
||||
export import smartstring = require("smartstring");
|
||||
export let through2 = require("through2");
|
@ -5,8 +5,17 @@ import {bash} from "./npmci.bash";
|
||||
import * as NpmciEnv from "./npmci.env";
|
||||
import * as NpmciBuildDocker from "./npmci.build.docker"
|
||||
|
||||
export let publish = (serviceArg:string = "npm") => {
|
||||
switch (serviceArg){
|
||||
/**
|
||||
* type of supported services
|
||||
*/
|
||||
export type registryService = "npm" | "docker";
|
||||
|
||||
/**
|
||||
* the main exported publish function.
|
||||
* @param registryServiceArg the serviceArg
|
||||
*/
|
||||
export let publish = (registryServiceArg:registryService = "npm") => {
|
||||
switch (registryServiceArg){
|
||||
case "npm":
|
||||
return publishNpm();
|
||||
case "docker":
|
||||
@ -14,6 +23,9 @@ export let publish = (serviceArg:string = "npm") => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* tries to publish project at cwd to npm
|
||||
*/
|
||||
let publishNpm = function(){
|
||||
let done = plugins.q.defer();
|
||||
prepare("npm")
|
||||
@ -25,6 +37,9 @@ let publishNpm = function(){
|
||||
return done.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* tries to pubish current cwd to Docker registry
|
||||
*/
|
||||
let publishDocker = function(){
|
||||
let done = plugins.q.defer();
|
||||
NpmciBuildDocker.readDockerfiles()
|
||||
|
32
ts/npmci.servezone.ts
Normal file
32
ts/npmci.servezone.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import * as plugins from "./npmci.plugins";
|
||||
|
||||
/**
|
||||
* servezoneRegex is the regex that parses the servezone connection data
|
||||
* parses strings in the form of "servezone.example.com|3000|somepassword"
|
||||
*/
|
||||
let servezoneRegex = /^(.*)\|(.*)\|(.*)/;
|
||||
|
||||
/**
|
||||
* holds the results of the parsed servezone env string
|
||||
*/
|
||||
let servezoneRegexResultArray = servezoneRegex.exec(process.env.NPMCI_SERVEZONE);
|
||||
|
||||
/**
|
||||
* the data object that is used for the smartsocket client object
|
||||
*/
|
||||
let smartsocketClientConstructorOptions = {
|
||||
alias: "npmci",
|
||||
password: servezoneRegexResultArray[3],
|
||||
port: parseInt(servezoneRegexResultArray[2]),
|
||||
role: "ci",
|
||||
url: servezoneRegexResultArray[1]
|
||||
};
|
||||
|
||||
/**
|
||||
* the main run function to submit a service to a servezone
|
||||
*/
|
||||
export let run = (configArg) => {
|
||||
new plugins.smartsocket.SmartsocketClient(
|
||||
smartsocketClientConstructorOptions
|
||||
);
|
||||
};
|
@ -4,12 +4,15 @@ import * as plugins from "./npmci.plugins";
|
||||
let sshRegex = /^(.*)\|(.*)\|(.*)/
|
||||
let sshInstance:plugins.smartssh.SshInstance;
|
||||
|
||||
/**
|
||||
* checks for ENV vars in form of NPMCI_SSHKEY_* and deploys any found ones
|
||||
*/
|
||||
export let ssh = () => {
|
||||
let done = plugins.q.defer();
|
||||
sshInstance = new plugins.smartssh.SshInstance();
|
||||
sshInstance = new plugins.smartssh.SshInstance(); // init ssh instance
|
||||
plugins.smartparam.forEachMinimatch(process.env,"NPMCI_SSHKEY_*",evaluateSshEnv);
|
||||
if(!process.env.NPMTS_TEST){
|
||||
sshInstance.writeToDisk()
|
||||
sshInstance.writeToDisk();
|
||||
} else {
|
||||
plugins.beautylog.log("In test mode, so not storing SSH keys to disk!");
|
||||
};
|
||||
@ -17,6 +20,9 @@ export let ssh = () => {
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* gets called for each found SSH ENV Var and deploys it
|
||||
*/
|
||||
let evaluateSshEnv = (sshkeyEnvVarArg) => {
|
||||
let resultArray = sshRegex.exec(sshkeyEnvVarArg);
|
||||
let sshKey = new plugins.smartssh.SshKey();
|
||||
@ -37,6 +43,9 @@ let evaluateSshEnv = (sshkeyEnvVarArg) => {
|
||||
sshInstance.addKey(sshKey);
|
||||
};
|
||||
|
||||
/**
|
||||
* checks if not undefined
|
||||
*/
|
||||
let notUndefined = (stringArg:string) => {
|
||||
return (stringArg && stringArg != "undefined" && stringArg != "##");
|
||||
}
|
Loading…
Reference in New Issue
Block a user