update to support more detailed docker publishing
This commit is contained in:
parent
fdfb600bea
commit
66bb3a10b7
2
dist/mod_build/index.d.ts
vendored
2
dist/mod_build/index.d.ts
vendored
@ -5,4 +5,4 @@ export declare type TBuildService = 'docker';
|
||||
/**
|
||||
* builds for a specific service
|
||||
*/
|
||||
export declare let build: (commandArg: any) => Promise<void>;
|
||||
export declare let build: (argvArg: any) => Promise<void>;
|
||||
|
11
dist/mod_build/index.js
vendored
11
dist/mod_build/index.js
vendored
@ -13,16 +13,17 @@ const npmciMods = require("../npmci.mods");
|
||||
/**
|
||||
* builds for a specific service
|
||||
*/
|
||||
exports.build = (commandArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
switch (commandArg) {
|
||||
exports.build = (argvArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
let whatToPublish = argvArg._[1];
|
||||
switch (whatToPublish) {
|
||||
case 'docker':
|
||||
let modDocker = yield npmciMods.modDocker.load();
|
||||
yield modDocker.build();
|
||||
yield modDocker.build(argvArg);
|
||||
break;
|
||||
default:
|
||||
plugins.beautylog.log('build target ' + commandArg + ' not recognised!');
|
||||
plugins.beautylog.log('build target ' + whatToPublish + ' not recognised!');
|
||||
}
|
||||
;
|
||||
return;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfYnVpbGQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLHlDQUF3QztBQUd4QywyQ0FBMEM7QUFPMUM7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRyxDQUFPLFVBQVU7SUFDbEMsTUFBTSxDQUFDLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQztRQUNuQixLQUFLLFFBQVE7WUFDWCxJQUFJLFNBQVMsR0FBRyxNQUFNLFNBQVMsQ0FBQyxTQUFT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
2
dist/mod_docker/mod.builddocker.d.ts
vendored
2
dist/mod_docker/mod.builddocker.d.ts
vendored
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* builds a cwd of Dockerfiles by triggering a promisechain
|
||||
*/
|
||||
export declare let build: () => Promise<void>;
|
||||
export declare let build: (argvArg: any) => Promise<void>;
|
||||
/**
|
||||
* creates instance of class Dockerfile for all Dockerfiles in cwd
|
||||
* @returns Promise<Dockerfile[]>
|
||||
|
16
dist/mod_docker/mod.builddocker.js
vendored
16
dist/mod_docker/mod.builddocker.js
vendored
File diff suppressed because one or more lines are too long
22
dist/mod_prepare/index.js
vendored
22
dist/mod_prepare/index.js
vendored
@ -33,17 +33,21 @@ let npm = () => __awaiter(this, void 0, void 0, function* () {
|
||||
* logs in docker
|
||||
*/
|
||||
let docker = () => __awaiter(this, void 0, void 0, function* () {
|
||||
env.setDockerRegistry('docker.io');
|
||||
env.setDockerRegistry('docker.io'); // TODO: checkup why we set this here
|
||||
let dockerRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)/;
|
||||
// Login external reigstry
|
||||
if (!process.env.NPMCI_LOGIN_DOCKER) {
|
||||
plugins.beautylog.error('You have to specify Login Data to the Docker Registry');
|
||||
process.exit(1);
|
||||
plugins.beautylog.warn('You have to specify Login Data to an external Docker Registry');
|
||||
plugins.beautylog.warn('|- As a result only the gitlab registry is availble for this build.');
|
||||
}
|
||||
plugins.shelljs.exec('docker login -u gitlab-ci-token -p ' + process.env.CI_BUILD_TOKEN + ' ' + 'registry.gitlab.com'); // Always also login to GitLab Registry
|
||||
let dockerRegexResultArray = dockerRegex.exec(process.env.NPMCI_LOGIN_DOCKER);
|
||||
let username = dockerRegexResultArray[1];
|
||||
let password = dockerRegexResultArray[2];
|
||||
yield npmci_bash_1.bash('docker login -u ' + username + ' -p ' + password);
|
||||
else {
|
||||
let dockerRegexResultArray = dockerRegex.exec(process.env.NPMCI_LOGIN_DOCKER);
|
||||
let username = dockerRegexResultArray[1];
|
||||
let password = dockerRegexResultArray[2];
|
||||
yield npmci_bash_1.bash('docker login -u ' + username + ' -p ' + password);
|
||||
}
|
||||
// Always login to GitLab Registry
|
||||
plugins.shelljs.exec('docker login -u gitlab-ci-token -p ' + process.env.CI_BUILD_TOKEN + ' ' + 'registry.gitlab.com');
|
||||
return;
|
||||
});
|
||||
/**
|
||||
@ -79,4 +83,4 @@ exports.prepare = (serviceArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
break;
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfcHJlcGFyZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEseUNBQXdDO0FBQ3hDLDhDQUFvQztBQUNwQyxvQ0FBbUM7QUFDbkMsMkNBQTBDO0FBUzFDOztHQUVHO0FBQ0gsSUFBSSxHQUFHLEdBQUc7SUFDUixJQUFJLFdBQVcsR0FBVyxtQ0FBbUMsQ0FBQTtJQUM3RCxJQUFJLFFBQVEsR0FBVyxPQUFPLENBQUMsR0FBRyxDQUFDLGVBQWUsQ0FBQTtJQUNsRCxJQUFJLGVBQWUsR0FBVyxXQUFXLEdBQUcsUUFBUSxDQUFBO0lBQ3BELEVBQUUsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUM7UUFDYixPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxDQUFBO0lBQzlDLENBQUM7SUFBQyxJQUFJLENBQUMsQ0FBQztRQUNOLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLGlDQUFpQyxDQUFDLENBQUE7UUFDMUQsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQTtJQUNqQixDQUFDO0lBQ0Qs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ENBQUE7QUFFRDs7R0FFRztBQUNILElBQUksR0FBRyxHQUFHO0lBQ1IsSUFBSSxTQUFTLEdBQUcsTUFBTSxTQUFTLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxDQUFBO0lBQzdDLE1BQU0sU0FBUyxDQUFDLEdBQUcsRUFBRSxDQUFBO0FBQ3ZCLENBQUMsQ0FBQSxDQUFBO0FBRUQ7OztHQUdHO0FBQ1EsUUFBQSxPQUFPLEdBQUcsQ0FBTyxVQUF3QjtJQUNsRCxNQUFNLENBQUMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1FBQ25CLEtBQUssS0FBSztZQUNSLE1BQU0sQ0FBQyxNQUFNLEdBQUcsRUFBRSxDQUFBO1FBQ3BCLEtBQUssUUFBUTtZQUNYLE1BQU0sQ0FBQyxNQUFNLE1BQU0sRUFBRSxDQUFBO1FBQ3ZCLEtBQUssZUFBZTtZQUNsQixNQUFNLENBQUMsTUFBTSxZQUFZLEVBQUUsQ0FBQTtRQUM3QixLQUFLLEtBQUs7WUFDUixNQUFNLENBQUMsTUFBTSxHQUFHLEVBQUUsQ0FBQTtRQUNwQjtZQUNFLEtBQUssQ0FBQTtJQUNULENBQUM7QUFDSCxDQUFDLENBQUEsQ0FBQSJ9
|
6
dist/npmci.cli.js
vendored
6
dist/npmci.cli.js
vendored
@ -76,9 +76,9 @@ smartcli.addCommand('prepare')
|
||||
});
|
||||
// publish
|
||||
smartcli.addCommand('publish')
|
||||
.then((argv) => __awaiter(this, void 0, void 0, function* () {
|
||||
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
let modPublish = yield npmciMods.modPublish.load();
|
||||
yield modPublish.publish(argv._[1]);
|
||||
yield modPublish.publish(argvArg);
|
||||
yield NpmciEnv.configStore();
|
||||
})).catch(err => {
|
||||
console.log(err);
|
||||
@ -105,4 +105,4 @@ smartcli.addCommand('trigger')
|
||||
process.exit(1);
|
||||
});
|
||||
smartcli.startParse();
|
||||
//# sourceMapp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UE7QUFDakIsQ0FBQyxDQUFDLENBQUE7QUFFSixVQUFVO0FBQ1YsUUFBUSxDQUFDLFVBQVUsQ0FBQyxTQUFTLENBQUM7S0FDM0IsSUFBSSxDQUFDLENBQU8sSUFBSTtJQUNmLElBQUksVUFBVSxHQUFHLE1BQU0sU0FBUyxDQUFDLFVBQVUsQ0FBQyxJQUFJLEVBQUUsQ0FBQTtJQUNsRCxNQUFNLFVBQVUsQ0FBQyxPQUFPLEVBQUUsQ0FBQTtJQUMxQixNQUFNLFFBQVEsQ0FBQyxXQUFXLEVBQUUsQ0FBQTtBQUM5QixDQUFDLENBQUEsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHO0lBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQTtJQUNoQixPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFBO0FBQ2pCLENBQUMsQ0FBQyxDQUFBO0FBRUosUUFBUSxDQUFDLFVBQVUsRUFBRSxDQUFBIn0=
|
12
dist/npmci.env.d.ts
vendored
12
dist/npmci.env.d.ts
vendored
@ -1,15 +1,27 @@
|
||||
import { GitRepo } from 'smartstring';
|
||||
import { Dockerfile } from './mod_docker/index';
|
||||
/**
|
||||
* a info instance about the git respoitory at cwd :)
|
||||
*/
|
||||
export declare let repo: GitRepo;
|
||||
/**
|
||||
* the build stage
|
||||
*/
|
||||
export declare let buildStage: string;
|
||||
export declare let dockerRegistry: string;
|
||||
export declare let setDockerRegistry: (dockerRegistryArg: string) => void;
|
||||
export declare let dockerFilesBuilt: Dockerfile[];
|
||||
export declare let dockerFiles: Dockerfile[];
|
||||
/**
|
||||
* the config
|
||||
*/
|
||||
export declare let config: {
|
||||
dockerRegistry: any;
|
||||
dockerFilesBuilt: Dockerfile[];
|
||||
dockerFiles: Dockerfile[];
|
||||
project: any;
|
||||
};
|
||||
/**
|
||||
* the configuration store
|
||||
*/
|
||||
export declare let configStore: () => Promise<void>;
|
||||
|
14
dist/npmci.env.js
vendored
14
dist/npmci.env.js
vendored
@ -14,22 +14,34 @@ const smartstring_1 = require("smartstring");
|
||||
if (process.env.CI_REPOSITORY_URL) {
|
||||
exports.repo = new smartstring_1.GitRepo(process.env.CI_REPOSITORY_URL);
|
||||
}
|
||||
/**
|
||||
* the build stage
|
||||
*/
|
||||
exports.buildStage = process.env.CI_BUILD_STAGE;
|
||||
exports.setDockerRegistry = (dockerRegistryArg) => {
|
||||
exports.dockerRegistry = dockerRegistryArg;
|
||||
};
|
||||
exports.dockerFilesBuilt = [];
|
||||
exports.dockerFiles = [];
|
||||
/**
|
||||
* the config
|
||||
*/
|
||||
exports.config = {
|
||||
dockerRegistry: undefined,
|
||||
dockerFilesBuilt: exports.dockerFilesBuilt,
|
||||
dockerFiles: exports.dockerFiles,
|
||||
project: undefined
|
||||
};
|
||||
/**
|
||||
* the configuration store
|
||||
*/
|
||||
exports.configStore = () => __awaiter(this, void 0, void 0, function* () {
|
||||
exports.config.dockerRegistry = exports.dockerRegistry;
|
||||
plugins.smartfile.memory.toFsSync(JSON.stringify(exports.config), paths.NpmciPackageConfig);
|
||||
});
|
||||
/**
|
||||
* load the config in case a previous run has stored it
|
||||
*/
|
||||
let configLoad = () => {
|
||||
// internal config to transfer information in between npmci shell calls
|
||||
try {
|
||||
@ -54,4 +66,4 @@ let configLoad = () => {
|
||||
exports.config.dockerFilesBuilt ? exports.dockerFilesBuilt = exports.config.dockerFilesBuilt : void (0);
|
||||
};
|
||||
configLoad();
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuZW52LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSwyQ0FBMEM7QUFDMUMsdUNBQXNDO0FBQ3RDLDZDQUFxQztBQUlyQyxFQUFFLENBQUM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xDQUFDLGdFQUFnRSxDQUFDLENBQUE7SUFDekYsQ0FBQztJQUVELGNBQU0sQ0FBQyxjQUFjLEdBQUcsc0JBQWMsR0FBRyxjQUFNLENBQUMsY0FBYyxHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtJQUN6RSxjQUFNLENBQUMsZ0JBQWdCLEdBQUcsd0JBQWdCLEdBQUcsY0FBTSxDQUFDLGdCQUFnQixHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUNqRixDQUFDLENBQUE7QUFDRCxVQUFVLEVBQUUsQ0FBQSJ9
|
@ -45,7 +45,7 @@ tap.test('should sort an array of Dockerfiles', async () => {
|
||||
})
|
||||
|
||||
tap.test('should correctly chain Dockerfile handling', async () => {
|
||||
return NpmciBuildDocker.build()
|
||||
return NpmciBuildDocker.build({})
|
||||
})
|
||||
|
||||
tap.test('should publish all built Dockerfiles', async () => {
|
||||
|
@ -11,14 +11,15 @@ export type TBuildService = 'docker'
|
||||
/**
|
||||
* builds for a specific service
|
||||
*/
|
||||
export let build = async (commandArg): Promise<void> => {
|
||||
switch (commandArg) {
|
||||
export let build = async (argvArg): Promise<void> => {
|
||||
let whatToPublish: string = argvArg._[1]
|
||||
switch (whatToPublish) {
|
||||
case 'docker':
|
||||
let modDocker = await npmciMods.modDocker.load()
|
||||
await modDocker.build()
|
||||
await modDocker.build(argvArg)
|
||||
break
|
||||
default:
|
||||
plugins.beautylog.log('build target ' + commandArg + ' not recognised!')
|
||||
plugins.beautylog.log('build target ' + whatToPublish + ' not recognised!')
|
||||
};
|
||||
return
|
||||
}
|
||||
|
@ -3,10 +3,13 @@ import * as paths from '../npmci.paths'
|
||||
import * as NpmciEnv from '../npmci.env'
|
||||
import { bash } from '../npmci.bash'
|
||||
|
||||
let modArgvArg // will be set through the build command
|
||||
|
||||
/**
|
||||
* builds a cwd of Dockerfiles by triggering a promisechain
|
||||
*/
|
||||
export let build = async () => {
|
||||
export let build = async (argvArg: any) => {
|
||||
modArgvArg = argvArg
|
||||
plugins.beautylog.log('now building Dockerfiles...')
|
||||
await readDockerfiles()
|
||||
.then(sortDockerfiles)
|
||||
@ -105,8 +108,15 @@ export let buildDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
|
||||
* pushes the real Dockerfile images to a Docker registry
|
||||
*/
|
||||
export let pushDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
|
||||
let stageArg = (function () {
|
||||
if (modArgvArg._ && modArgvArg._.length >= 3) {
|
||||
return modArgvArg._[2]
|
||||
} else {
|
||||
return NpmciEnv.buildStage
|
||||
}
|
||||
})()
|
||||
for (let dockerfileArg of sortedArrayArg) {
|
||||
await dockerfileArg.push(NpmciEnv.buildStage)
|
||||
await dockerfileArg.push(stageArg)
|
||||
}
|
||||
return sortedArrayArg
|
||||
}
|
||||
@ -150,7 +160,7 @@ export class Dockerfile {
|
||||
baseImage: string
|
||||
localBaseImageDependent: boolean
|
||||
localBaseDockerfile: Dockerfile
|
||||
constructor (options: { filePath?: string, fileContents?: string | Buffer, read?: boolean }) {
|
||||
constructor(options: { filePath?: string, fileContents?: string | Buffer, read?: boolean }) {
|
||||
this.filePath = options.filePath
|
||||
this.repo = NpmciEnv.repo.user + '/' + NpmciEnv.repo.repo
|
||||
this.version = dockerFileVersion(plugins.path.parse(options.filePath).base)
|
||||
@ -181,7 +191,7 @@ export class Dockerfile {
|
||||
/**
|
||||
* pushes the Dockerfile to a registry
|
||||
*/
|
||||
async push(stageArg) {
|
||||
async push (stageArg) {
|
||||
switch (stageArg) {
|
||||
case 'release':
|
||||
await bash(`docker tag ${this.buildTag} ${this.releaseTag}`)
|
||||
@ -204,7 +214,7 @@ export class Dockerfile {
|
||||
/**
|
||||
* pulls the Dockerfile from a registry
|
||||
*/
|
||||
async pull(registryArg: string) {
|
||||
async pull (registryArg: string) {
|
||||
let pullTag = this.gitlabTestTag
|
||||
await bash('docker pull ' + pullTag)
|
||||
await bash('docker tag ' + pullTag + ' ' + this.buildTag)
|
||||
@ -213,7 +223,7 @@ export class Dockerfile {
|
||||
/**
|
||||
* tests the Dockerfile;
|
||||
*/
|
||||
async test() {
|
||||
async test () {
|
||||
let testFile: string = plugins.path.join(paths.NpmciTestDir, 'test_' + this.version + '.sh')
|
||||
let testFileExists: boolean = plugins.smartfile.fs.fileExistsSync(testFile)
|
||||
if (testFileExists) {
|
||||
@ -232,7 +242,7 @@ export class Dockerfile {
|
||||
/**
|
||||
* gets the id of a Dockerfile
|
||||
*/
|
||||
async getId() {
|
||||
async getId () {
|
||||
let containerId = await bash('docker inspect --type=image --format=\"{{.Id}}\" ' + this.buildTag)
|
||||
return containerId
|
||||
};
|
||||
@ -247,7 +257,7 @@ export let dockerFileVersion = (dockerfileNameArg: string): string => {
|
||||
let versionRegex = /Dockerfile_([a-zA-Z0-9\.]*)$/
|
||||
let regexResultArray = versionRegex.exec(dockerfileNameArg)
|
||||
if (regexResultArray && regexResultArray.length === 2) {
|
||||
versionString = regexResultArray[ 1 ]
|
||||
versionString = regexResultArray[1]
|
||||
} else {
|
||||
versionString = 'latest'
|
||||
}
|
||||
@ -260,7 +270,7 @@ export let dockerFileVersion = (dockerfileNameArg: string): string => {
|
||||
export let dockerBaseImage = function (dockerfileContentArg: string) {
|
||||
let baseImageRegex = /FROM\s([a-zA-z0-9\/\-\:]*)\n?/
|
||||
let regexResultArray = baseImageRegex.exec(dockerfileContentArg)
|
||||
return regexResultArray[ 1 ]
|
||||
return regexResultArray[1]
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,17 +31,22 @@ let npm = async () => {
|
||||
* logs in docker
|
||||
*/
|
||||
let docker = async () => {
|
||||
env.setDockerRegistry('docker.io')
|
||||
env.setDockerRegistry('docker.io') // TODO: checkup why we set this here
|
||||
let dockerRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)/
|
||||
|
||||
// Login external reigstry
|
||||
if (!process.env.NPMCI_LOGIN_DOCKER) {
|
||||
plugins.beautylog.error('You have to specify Login Data to the Docker Registry')
|
||||
process.exit(1)
|
||||
plugins.beautylog.warn('You have to specify Login Data to an external Docker Registry')
|
||||
plugins.beautylog.warn('|- As a result only the gitlab registry is availble for this build.')
|
||||
} else {
|
||||
let dockerRegexResultArray = dockerRegex.exec(process.env.NPMCI_LOGIN_DOCKER)
|
||||
let username = dockerRegexResultArray[1]
|
||||
let password = dockerRegexResultArray[2]
|
||||
await bash('docker login -u ' + username + ' -p ' + password)
|
||||
}
|
||||
plugins.shelljs.exec('docker login -u gitlab-ci-token -p ' + process.env.CI_BUILD_TOKEN + ' ' + 'registry.gitlab.com') // Always also login to GitLab Registry
|
||||
let dockerRegexResultArray = dockerRegex.exec(process.env.NPMCI_LOGIN_DOCKER)
|
||||
let username = dockerRegexResultArray[1]
|
||||
let password = dockerRegexResultArray[2]
|
||||
await bash('docker login -u ' + username + ' -p ' + password)
|
||||
|
||||
// Always login to GitLab Registry
|
||||
plugins.shelljs.exec('docker login -u gitlab-ci-token -p ' + process.env.CI_BUILD_TOKEN + ' ' + 'registry.gitlab.com')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -76,9 +76,9 @@ smartcli.addCommand('prepare')
|
||||
|
||||
// publish
|
||||
smartcli.addCommand('publish')
|
||||
.then(async (argv) => {
|
||||
.then(async (argvArg) => {
|
||||
let modPublish = await npmciMods.modPublish.load()
|
||||
await modPublish.publish(argv._[1])
|
||||
await modPublish.publish(argvArg)
|
||||
await NpmciEnv.configStore()
|
||||
|
||||
}).catch(err => {
|
||||
|
@ -3,6 +3,9 @@ import * as paths from './npmci.paths'
|
||||
import { GitRepo } from 'smartstring'
|
||||
import { Dockerfile } from './mod_docker/index'
|
||||
|
||||
/**
|
||||
* a info instance about the git respoitory at cwd :)
|
||||
*/
|
||||
export let repo: GitRepo
|
||||
if (process.env.CI_REPOSITORY_URL) {
|
||||
repo = new GitRepo(process.env.CI_REPOSITORY_URL)
|
||||
@ -31,6 +34,9 @@ export let config = {
|
||||
project: undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* the configuration store
|
||||
*/
|
||||
export let configStore = async () => {
|
||||
config.dockerRegistry = dockerRegistry
|
||||
plugins.smartfile.memory.toFsSync(
|
||||
@ -39,6 +45,9 @@ export let configStore = async () => {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* load the config in case a previous run has stored it
|
||||
*/
|
||||
let configLoad = () => {
|
||||
// internal config to transfer information in between npmci shell calls
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user