Compare commits

...

7 Commits

Author SHA1 Message Date
a30a4ccd69 switch to new org scheme 2023-07-10 02:42:38 +02:00
1ae39d6536 1.0.4 2018-02-26 20:03:22 +01:00
f09785f41f update ci 2018-02-26 20:03:18 +01:00
6234d5660a 1.0.3 2018-02-26 20:02:14 +01:00
ede088f589 update 2018-02-26 20:02:11 +01:00
dad521ac04 1.0.2 2016-07-28 01:32:56 +02:00
c54a3b7d3a fix test 2016-07-28 01:32:53 +02:00
13 changed files with 126 additions and 87 deletions

View File

@ -1,36 +1,96 @@
image: hosttoday/ht-docker-node:npmts # gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages: stages:
- mirror
- security
- test - test
- release - release
- trigger
- pages
mirror:
stage: mirror
script:
- npmci git mirror
tags:
- docker
security:
stage: security
script:
- npmci command yarn global add snyk
- npmci command yarn install --ignore-scripts
- npmci command snyk test
tags:
- docker
testLEGACY: testLEGACY:
stage: test stage: test
script: script:
- npmci test legacy - npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
allow_failure: true
testLTS: testLTS:
stage: test stage: test
script: script:
- npmci test lts - npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci test stable - npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
release: release:
stage: release stage: release
environment: npmjs-com_registry
script: script:
- npmci publish - npmci npm prepare
- npmci npm publish
only:
- tags
tags:
- docker
trigger:
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- docker
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command yarn global add npmpage
- npmci command npmpage
tags:
- docker
only: only:
- tags - tags
tags: artifacts:
- docker expire_in: 1 week
paths:
- public

View File

@ -1,13 +1,16 @@
# smartci # smartci
store things about your environment and let them travel across modules. store things about your environment and let them travel across modules.
## Status ## Status
[![Build Status](https://travis-ci.org/pushrocks/smartci.svg?branch=release)](https://travis-ci.org/pushrocks/smartci) [![Build Status](https://travis-ci.org/pushrocks/smartci.svg?branch=release)](https://travis-ci.org/pushrocks/smartci)
[![Dependency Status](https://david-dm.org/pushrocks/smartci.svg)](https://david-dm.org/pushrocks/smartci) [![Dependency Status](https://david-dm.org/pushrocks/smartci.svg)](https://david-dm.org/pushrocks/smartci)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartci/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartci/master/dependencies/npm) [![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartci/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartci/master/dependencies/npm)
[![bitHound Overalll Score](https://www.bithound.io/github/pushrocks/smartci/badges/score.svg)](https://www.bithound.io/github/pushrocks/smartci) [![bitHound Overalll Score](https://www.bithound.io/github/pushrocks/smartci/badges/score.svg)](https://www.bithound.io/github/pushrocks/smartci)
## Install ## Install
Install the package through npm Install the package through npm
``` ```
@ -17,5 +20,4 @@ npm install smartci
## Usage ## Usage
```javascript ```javascript
```
```

7
dist/index.js vendored
View File

@ -1,6 +1,7 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCi = function () { exports.isCi = function () {
if (process.env.CI == "true") { if (process.env.CI == 'true') {
return true; return true;
} }
else { else {
@ -8,6 +9,6 @@ exports.isCi = function () {
} }
}; };
exports.isTaggedCommit = () => { exports.isTaggedCommit = () => {
return typeof process.env.CI_BUILD_TAG != "undefined"; return typeof process.env.CI_BUILD_TAG != 'undefined';
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBR1csWUFBSSxHQUFHO0lBQ2QsRUFBRSxDQUFBLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLElBQUksTUFBTSxDQUFDLENBQUEsQ0FBQztRQUN6QixNQUFNLENBQUMsSUFBSSxDQUFDO0lBQ2hCLENBQUM7SUFBQyxJQUFJLENBQUMsQ0FBQztRQUNKLE1BQU0sQ0FBQyxLQUFLLENBQUM7SUFDakIsQ0FBQztBQUNMLENBQUMsQ0FBQztBQUVTLHNCQUFjLEdBQUc7SUFDeEIsTUFBTSxDQUFDLE9BQU8sT0FBTyxDQUFDLEdBQUcsQ0FBQyxZQUFZLElBQUksV0FBVyxDQUFDO0FBQzFELENBQUMsQ0FBQSJ9 //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVXLFFBQUEsSUFBSSxHQUFHO0lBQ2hCLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxJQUFJLE1BQU0sQ0FBQyxDQUFDLENBQUM7UUFDN0IsTUFBTSxDQUFDLElBQUksQ0FBQztJQUNkLENBQUM7SUFBQyxJQUFJLENBQUMsQ0FBQztRQUNOLE1BQU0sQ0FBQyxLQUFLLENBQUM7SUFDZixDQUFDO0FBQ0gsQ0FBQyxDQUFDO0FBRVMsUUFBQSxjQUFjLEdBQUcsR0FBRyxFQUFFO0lBQy9CLE1BQU0sQ0FBQyxPQUFPLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxJQUFJLFdBQVcsQ0FBQztBQUN4RCxDQUFDLENBQUMifQ==

View File

@ -1,2 +1,2 @@
import "typings-global"; import * as path from 'path';
export declare let path: any; export { path };

View File

@ -1,4 +1,5 @@
"use strict"; "use strict";
require("typings-global"); Object.defineProperty(exports, "__esModule", { value: true });
exports.path = require("path"); const path = require("path");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRjaS5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRjaS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDYixZQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDIn0= exports.path = path;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRjaS5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRjaS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNkJBQTZCO0FBRXBCLG9CQUFJIn0=

7
npmextra.json Normal file
View File

@ -0,0 +1,7 @@
{
"npmci": {
"npmGlobalTools": [
"npmts"
]
}
}

View File

@ -1,6 +1,6 @@
{ {
"name": "smartci", "name": "smartci",
"version": "1.0.1", "version": "1.0.4",
"description": "makes it easy to automate tasks with Continuous Integration", "description": "makes it easy to automate tasks with Continuous Integration",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
@ -21,12 +21,10 @@
}, },
"homepage": "https://github.com/pushrocks/smartci", "homepage": "https://github.com/pushrocks/smartci",
"dependencies": { "dependencies": {
"beautylog": "^5.0.18", "beautylog": "^6.1.10"
"typings-global": "^1.0.6"
}, },
"devDependencies": { "devDependencies": {
"npmts-g": "^5.2.8", "@types/node": "^9.4.6",
"should": "^10.0.0", "tapbundle": "^1.1.8"
"typings-test": "^1.0.1"
} }
} }

1
test/test.d.ts vendored
View File

@ -1 +0,0 @@
import "typings-test";

View File

@ -1,25 +0,0 @@
"use strict";
require("typings-test");
var smartci = require("../dist/index.js");
var should = require("should");
process.env.TRAVIS_JOB_NUMBER = "180.3";
process.env.CI = "true";
describe("smartci", function () {
describe("check", function () {
describe(".isCi", function () {
it("should state if we are in a CI environment", function () {
smartci.isCi().should.be.true();
process.env.CI = "false";
smartci.isCi().should.be.false();
});
});
describe(".isTaggedCommit", function () {
it("should state if we are dealing with a tagged commit", function () {
smartci.isTaggedCommit().should.be.false();
process.env.CI_BUILD_TAG = "3.1.2";
smartci.isTaggedCommit().should.be.true();
});
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLGtCQUFrQixDQUFDLENBQUM7QUFDMUMsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBRS9CLE9BQU8sQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEdBQUcsT0FBTyxDQUFDO0FBQ3hDLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLE1BQU0sQ0FBQztBQUV4QixRQUFRLENBQUMsU0FBUyxFQUFDO0lBQ2YsUUFBUSxDQUFDLE9BQU8sRUFBQztRQUNiLFFBQVEsQ0FBQyxPQUFPLEVBQUM7WUFDYixFQUFFLENBQUMsNENBQTRDLEVBQUM7Z0JBQzVDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLElBQUksRUFBRSxDQUFDO2dCQUNoQyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxPQUFPLENBQUM7Z0JBQ3pCLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQyx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CAAC"}

View File

@ -1,25 +1,22 @@
import "typings-test"; import { tap, expect } from 'tapbundle';
var smartci = require("../dist/index.js");
var should = require("should"); import * as smartci from "../ts/index";
process.env.TRAVIS_JOB_NUMBER = "180.3"; process.env.TRAVIS_JOB_NUMBER = "180.3";
process.env.CI = "true"; process.env.CI = "true";
describe("smartci",function(){
describe("check",function(){ tap.test("should state if we are in a CI environment", async () => {
describe(".isCi",function(){ expect(smartci.isCi()).to.be.true();
it("should state if we are in a CI environment",function(){ process.env.CI = "false";
smartci.isCi().should.be.true(); expect(smartci.isCi()).to.be.false();
process.env.CI = "false"; });
smartci.isCi().should.be.false();
}); tap.test("should state if we are dealing with a tagged commit", async () => {
}); delete process.env[ "CI_BUILD_TAG" ];
describe(".isTaggedCommit",function(){ expect(smartci.isTaggedCommit()).to.be.false();
it("should state if we are dealing with a tagged commit",function(){ process.env.CI_BUILD_TAG = "3.1.2";
smartci.isTaggedCommit().should.be.false(); expect(smartci.isTaggedCommit()).to.be.true();
process.env.CI_BUILD_TAG = "3.1.2"; })
smartci.isTaggedCommit().should.be.true();
}) tap.start()
});
});
});

View File

@ -1,14 +1,13 @@
import plugins = require("./smartci.plugins"); import plugins = require('./smartci.plugins');
import SmartCiGet = require("./smartci.get");
export let isCi = function():boolean { export let isCi = function(): boolean {
if(process.env.CI == "true"){ if (process.env.CI == 'true') {
return true; return true;
} else { } else {
return false; return false;
} }
}; };
export let isTaggedCommit = () => { export let isTaggedCommit = () => {
return typeof process.env.CI_BUILD_TAG != "undefined"; return typeof process.env.CI_BUILD_TAG != 'undefined';
} };

View File

@ -1,2 +1,3 @@
import "typings-global"; import * as path from 'path';
export let path = require("path");
export { path };