Compare commits

...

4 Commits

Author SHA1 Message Date
572738e88f 3.1.46 2019-08-30 10:40:38 +02:00
129ae93044 fix(core): update 2019-08-30 10:40:38 +02:00
e910892231 3.1.45 2019-08-30 10:38:48 +02:00
6d9cabf7ee fix(core): update 2019-08-30 10:38:47 +02:00
3 changed files with 32 additions and 26 deletions

26
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "@shipzone/npmci", "name": "@shipzone/npmci",
"version": "3.1.44", "version": "3.1.46",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -180,9 +180,9 @@
} }
}, },
"@pushrocks/qenv": { "@pushrocks/qenv": {
"version": "4.0.2", "version": "4.0.4",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fqenv/-/qenv-4.0.2.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fqenv/-/qenv-4.0.4.tgz",
"integrity": "sha512-ip/yN8etdy4lOTeNjU7dyKB8oN9eEZG3P/DhFYXDAgqEo0oDUUckEjGZadTLhjLw4wb/oQZqrZ/RjXwlCrBciQ==", "integrity": "sha512-nvgiY3u25mvi5wmVbEYfCDuBaz6pogwzKPxGaohMrIcNn/0MlXZ+JvkVHWK6CxExklSDbjSXsD7zfvme4GGA0g==",
"requires": { "requires": {
"@pushrocks/smartfile": "^7.0.4", "@pushrocks/smartfile": "^7.0.4",
"@pushrocks/smartlog": "^2.0.19" "@pushrocks/smartlog": "^2.0.19"
@@ -433,9 +433,9 @@
} }
}, },
"@pushrocks/smartshell": { "@pushrocks/smartshell": {
"version": "2.0.23", "version": "2.0.25",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartshell/-/smartshell-2.0.23.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartshell/-/smartshell-2.0.25.tgz",
"integrity": "sha512-+YXacX/sp4f+iBYm4vAoxrq/c8WCHnFhMaW66l3R08stl0eezW3SytoSlnr6R+JT1xqnBzIItDfCyyRC3uEVnw==", "integrity": "sha512-sYVHOhBRdr+CkjS+o1SDtB5058ZYxTPAYuexx2ydl2g+57KNdEcSRWN/2mOv5+NFH+tvvgtnUjC3AclC9CwJ4A==",
"requires": { "requires": {
"@pushrocks/smartdelay": "^2.0.3", "@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartexit": "^1.0.15", "@pushrocks/smartexit": "^1.0.15",
@@ -557,9 +557,9 @@
} }
}, },
"@servezone/servezone-interfaces": { "@servezone/servezone-interfaces": {
"version": "2.0.28", "version": "2.0.29",
"resolved": "https://verdaccio.lossless.one/@servezone%2fservezone-interfaces/-/servezone-interfaces-2.0.28.tgz", "resolved": "https://verdaccio.lossless.one/@servezone%2fservezone-interfaces/-/servezone-interfaces-2.0.29.tgz",
"integrity": "sha512-mlXiiLhA8PF+sXczLzuGJSz0iPxdEDkU+hiR/Tw/QfCniLeHdJFgRW8RIJYAV2jhy0JMpHINP5Nqke0tt1lK1Q==" "integrity": "sha512-alXB2SFD+3tVxfC0Kd8NrHlr4WyB1hSg60ydHUvzJB30fUMKMX71UlWrITxORg8UXQQy1Kw9rhFhCXnq31xxSA=="
}, },
"@types/body-parser": { "@types/body-parser": {
"version": "1.17.1", "version": "1.17.1",
@@ -707,9 +707,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
}, },
"@types/node": { "@types/node": {
"version": "12.7.2", "version": "12.7.3",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.2.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.3.tgz",
"integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==" "integrity": "sha512-3SiLAIBkDWDg6vFo0+5YJyHPWU9uwu40Qe+v+0MH8wRKYBimHvvAOyk3EzMrD/TrIlLYfXrqDqrg913PynrMJQ=="
}, },
"@types/nodegit": { "@types/nodegit": {
"version": "0.24.10", "version": "0.24.10",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@shipzone/npmci", "name": "@shipzone/npmci",
"version": "3.1.44", "version": "3.1.46",
"private": false, "private": false,
"description": "node and docker in gitlab ci on steroids", "description": "node and docker in gitlab ci on steroids",
"main": "dist/index.js", "main": "dist/index.js",
@@ -28,7 +28,7 @@
"@gitzone/tsrun": "^1.2.6", "@gitzone/tsrun": "^1.2.6",
"@gitzone/tstest": "^1.0.24", "@gitzone/tstest": "^1.0.24",
"@pushrocks/tapbundle": "^3.0.13", "@pushrocks/tapbundle": "^3.0.13",
"@types/node": "^12.7.2", "@types/node": "^12.7.3",
"tslint": "^5.19.0", "tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
@@ -37,7 +37,7 @@
"@pushrocks/lik": "^3.0.11", "@pushrocks/lik": "^3.0.11",
"@pushrocks/npmextra": "^3.0.5", "@pushrocks/npmextra": "^3.0.5",
"@pushrocks/projectinfo": "^4.0.2", "@pushrocks/projectinfo": "^4.0.2",
"@pushrocks/qenv": "^4.0.2", "@pushrocks/qenv": "^4.0.4",
"@pushrocks/smartanalytics": "^2.0.15", "@pushrocks/smartanalytics": "^2.0.15",
"@pushrocks/smartcli": "^3.0.7", "@pushrocks/smartcli": "^3.0.7",
"@pushrocks/smartdelay": "^2.0.3", "@pushrocks/smartdelay": "^2.0.3",
@@ -48,11 +48,11 @@
"@pushrocks/smartparam": "^1.0.4", "@pushrocks/smartparam": "^1.0.4",
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrequest": "^1.1.23", "@pushrocks/smartrequest": "^1.1.23",
"@pushrocks/smartshell": "^2.0.23", "@pushrocks/smartshell": "^2.0.25",
"@pushrocks/smartsocket": "^1.1.45", "@pushrocks/smartsocket": "^1.1.45",
"@pushrocks/smartssh": "^1.2.3", "@pushrocks/smartssh": "^1.2.3",
"@pushrocks/smartstring": "^3.0.10", "@pushrocks/smartstring": "^3.0.10",
"@servezone/servezone-interfaces": "^2.0.28", "@servezone/servezone-interfaces": "^2.0.29",
"@types/shelljs": "^0.8.5", "@types/shelljs": "^0.8.5",
"@types/through2": "^2.0.34", "@types/through2": "^2.0.34",
"through2": "^3.0.1" "through2": "^3.0.1"

View File

@@ -214,6 +214,7 @@ export class Dockerfile {
public version: string; public version: string;
public cleanTag: string; public cleanTag: string;
public buildTag: string; public buildTag: string;
public pushTag: string;
public containerName: string; public containerName: string;
public content: string; public content: string;
public baseImage: string; public baseImage: string;
@@ -248,7 +249,9 @@ export class Dockerfile {
public async build() { public async build() {
logger.log('info', 'now building Dockerfile for ' + this.cleanTag); logger.log('info', 'now building Dockerfile for ' + this.cleanTag);
const buildArgsString = await Dockerfile.getDockerBuildArgs(this.npmciDockerManagerRef); const buildArgsString = await Dockerfile.getDockerBuildArgs(this.npmciDockerManagerRef);
const buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`; const buildCommand = `docker build --label="version=${
this.npmciDockerManagerRef.npmciRef.npmciConfig.getConfig().projectInfo.npm.version
}" -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
await bash(buildCommand); await bash(buildCommand);
return; return;
} }
@@ -257,21 +260,24 @@ export class Dockerfile {
* pushes the Dockerfile to a registry * pushes the Dockerfile to a registry
*/ */
public async push(dockerRegistryArg: DockerRegistry, versionSuffix: string = null) { public async push(dockerRegistryArg: DockerRegistry, versionSuffix: string = null) {
const pushTag = Dockerfile.getDockerTagString( this.pushTag = Dockerfile.getDockerTagString(
this.npmciDockerManagerRef, this.npmciDockerManagerRef,
dockerRegistryArg.registryUrl, dockerRegistryArg.registryUrl,
this.repo, this.repo,
this.version, this.version,
versionSuffix versionSuffix
); );
await bash(`docker tag ${this.buildTag} ${pushTag}`); await bash(`docker tag ${this.buildTag} ${this.pushTag}`);
await bash(`docker push ${pushTag}`); await bash(`docker push ${this.pushTag}`);
const imageDigest = (await bash( console.log('you can get the digest using this command');
console.log(`docker inspect --format='{{index .RepoDigests 0}}' ${this.pushTag}`);
/* const imageDigest = (await bash(
`docker inspect --format='{{index .RepoDigests 0}}' ${pushTag}` `docker inspect --format='{{index .RepoDigests 0}}' ${pushTag}`
)).split('@')[1]; )).split('@')[1]; */
await this.npmciDockerManagerRef.npmciRef.cloudlyConnector.announceDockerContainer({ await this.npmciDockerManagerRef.npmciRef.cloudlyConnector.announceDockerContainer({
dockerImageUrl: pushTag, dockerImageUrl: this.pushTag,
dockerImageVersion: imageDigest dockerImageVersion: this.npmciDockerManagerRef.npmciRef.npmciConfig.getConfig().projectInfo
.npm.version
}); });
} }