update to notice missing gitlab registry token
This commit is contained in:
parent
15714204a6
commit
f98f490956
2
dist/mod_docker/mod.builddocker.d.ts
vendored
2
dist/mod_docker/mod.builddocker.d.ts
vendored
@ -91,7 +91,7 @@ export declare let dockerBaseImage: (dockerfileContentArg: string) => string;
|
||||
/**
|
||||
* returns the docker tag
|
||||
*/
|
||||
export declare let dockerTag: (registryArg: string, repoArg: string, versionArg: string, suffixArg?: string) => string;
|
||||
export declare let getDockerTagString: (registryArg: string, repoArg: string, versionArg: string, suffixArg?: string) => string;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
17
dist/mod_docker/mod.builddocker.js
vendored
17
dist/mod_docker/mod.builddocker.js
vendored
File diff suppressed because one or more lines are too long
7
dist/mod_prepare/index.js
vendored
7
dist/mod_prepare/index.js
vendored
@ -62,7 +62,10 @@ let docker = () => __awaiter(this, void 0, void 0, function* () {
|
||||
* prepare docker for gitlab registry
|
||||
*/
|
||||
let dockerGitlab = () => __awaiter(this, void 0, void 0, function* () {
|
||||
// env.setDockerRegistry('registry.gitlab.com')
|
||||
if (!process.env.CI_BUILD_TOKEN || process.env.CI_BUILD_TOKEN === '') {
|
||||
plugins.beautylog.error('No registry token specified by gitlab!');
|
||||
process.exit(1);
|
||||
}
|
||||
yield npmci_bash_1.bash(`docker login -u gitlab-ci-token -p ${process.env.CI_BUILD_TOKEN} registry.gitlab.com`);
|
||||
plugins.beautylog.success(`docker authenticated for registry.gitlab.com!`);
|
||||
return;
|
||||
@ -92,4 +95,4 @@ exports.prepare = (serviceArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
break;
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfcHJlcGFyZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEseU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LLGVBQWU7WUFDbEIsTUFBTSxDQUFDLE1BQU0sWUFBWSxFQUFFLENBQUE7UUFDN0IsS0FBSyxLQUFLO1lBQ1IsTUFBTSxDQUFDLE1BQU0sR0FBRyxFQUFFLENBQUE7UUFDcEI7WUFDRSxLQUFLLENBQUE7SUFDVCxDQUFDO0FBQ0gsQ0FBQyxDQUFBLENBQUEifQ==
|
@ -111,7 +111,7 @@ export let buildDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
|
||||
export let pushDockerfiles = async (sortedArrayArg: Dockerfile[]) => {
|
||||
let stageArg = (function () {
|
||||
if (modArgvArg._ && modArgvArg._.length >= 3) {
|
||||
return modArgvArg._[2]
|
||||
return modArgvArg._[ 2 ]
|
||||
} else {
|
||||
return NpmciEnv.buildStage
|
||||
}
|
||||
@ -167,9 +167,12 @@ export class Dockerfile {
|
||||
this.version = dockerFileVersion(plugins.path.parse(options.filePath).base)
|
||||
this.cleanTag = this.repo + ':' + this.version
|
||||
this.buildTag = this.cleanTag
|
||||
this.gitlabTestTag = dockerTag('registry.gitlab.com', this.repo, this.version, 'test')
|
||||
this.gitlabReleaseTag = dockerTag('registry.gitlab.com', this.repo, this.version)
|
||||
this.releaseTag = dockerTag('docker.io', this.repo, this.version)
|
||||
this.gitlabTestTag = getDockerTagString('registry.gitlab.com', this.repo, this.version, 'test')
|
||||
this.gitlabReleaseTag = getDockerTagString('registry.gitlab.com', this.repo, this.version)
|
||||
|
||||
// the releaseTag determines where the image gets released
|
||||
this.releaseTag = getDockerTagString('docker.io', this.repo, this.version)
|
||||
|
||||
this.containerName = 'dockerfile-' + this.version
|
||||
if (options.filePath && options.read) {
|
||||
this.content = plugins.smartfile.fs.toStringSync(plugins.path.resolve(options.filePath))
|
||||
@ -253,7 +256,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'
|
||||
}
|
||||
@ -266,21 +269,19 @@ 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 ]
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the docker tag
|
||||
*/
|
||||
export let dockerTag = function (registryArg: string, repoArg: string, versionArg: string, suffixArg?: string): string {
|
||||
let tagString: string
|
||||
let registry = registryArg
|
||||
let repo = repoArg
|
||||
export let getDockerTagString = function (registryArg: string, repoArg: string, versionArg: string, suffixArg?: string): string {
|
||||
// determine wether the suffix is needed
|
||||
let version = versionArg
|
||||
if (suffixArg) {
|
||||
version = versionArg + '_' + suffixArg
|
||||
}
|
||||
tagString = registry + '/' + repo + ':' + version
|
||||
let tagString = `${registryArg}/${repoArg}:${version}`
|
||||
return tagString
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,10 @@ let docker = async () => {
|
||||
* prepare docker for gitlab registry
|
||||
*/
|
||||
let dockerGitlab = async () => {
|
||||
// env.setDockerRegistry('registry.gitlab.com')
|
||||
if (!process.env.CI_BUILD_TOKEN || process.env.CI_BUILD_TOKEN === '') {
|
||||
plugins.beautylog.error('No registry token specified by gitlab!')
|
||||
process.exit(1)
|
||||
}
|
||||
await bash(`docker login -u gitlab-ci-token -p ${process.env.CI_BUILD_TOKEN} registry.gitlab.com`)
|
||||
plugins.beautylog.success(`docker authenticated for registry.gitlab.com!`)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user