Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| efdf789575 | |||
| 6ef6446022 | |||
| ef7d85e7c4 | |||
| 93b5d9869b | |||
| 2a0cfeffe9 | |||
| 909aafbd5f | |||
| 91288e2d74 | |||
| 25709b1f9a | |||
| 8a03d9aa94 | |||
| bbe1cf770a | |||
| ac8190282f | |||
| 446d140e32 | |||
| 726948651e | |||
| dd0a7bb782 | |||
| fca00ffcf8 | |||
| 13f6334ae5 | |||
| 7275a858d6 | |||
| 5a3befe5af | |||
| 385a93a05e | |||
| b4d444ff05 | |||
| 487bcb9a70 | |||
| aaf11b66d7 | |||
| 83d7d46896 | |||
| 693bda6a49 | |||
| bfe3e266ee | |||
| 5f33ebd8a7 | |||
| f78c80e100 | |||
| f4d8656831 | |||
| 2290081ef0 | |||
| 189d02a16f | |||
| 55aee04334 | |||
| 0e407b9b9d | |||
| 24095bbd40 | |||
| f97ee94b5a | |||
| 4cf7aea374 | |||
| 6ab5e9cb30 | |||
| 95c1145bf5 | |||
| ea04a1b788 | |||
| 3bc2499d09 | |||
| 1f5967ac45 | |||
| fd952f086b | |||
| 79500cb2c2 |
1241
package-lock.json
generated
1241
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shipzone/npmci",
|
||||
"version": "3.1.52",
|
||||
"version": "3.1.74",
|
||||
"private": false,
|
||||
"description": "node and docker in gitlab ci on steroids",
|
||||
"main": "dist/index.js",
|
||||
@@ -26,34 +26,32 @@
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.17",
|
||||
"@gitzone/tsrun": "^1.2.6",
|
||||
"@gitzone/tstest": "^1.0.24",
|
||||
"@pushrocks/tapbundle": "^3.0.13",
|
||||
"@types/node": "^12.7.3",
|
||||
"tslint": "^5.19.0",
|
||||
"@gitzone/tstest": "^1.0.28",
|
||||
"@pushrocks/tapbundle": "^3.2.0",
|
||||
"@types/node": "^12.12.12",
|
||||
"tslint": "^5.20.1",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.17",
|
||||
"@apiglobal/typedrequest": "^1.0.24",
|
||||
"@pushrocks/lik": "^3.0.11",
|
||||
"@pushrocks/npmextra": "^3.0.5",
|
||||
"@pushrocks/npmextra": "^3.0.7",
|
||||
"@pushrocks/projectinfo": "^4.0.2",
|
||||
"@pushrocks/qenv": "^4.0.4",
|
||||
"@pushrocks/qenv": "^4.0.6",
|
||||
"@pushrocks/smartanalytics": "^2.0.15",
|
||||
"@pushrocks/smartcli": "^3.0.7",
|
||||
"@pushrocks/smartdelay": "^2.0.3",
|
||||
"@pushrocks/smartfile": "^7.0.2",
|
||||
"@pushrocks/smartgit": "^1.0.13",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartdelay": "^2.0.6",
|
||||
"@pushrocks/smartfile": "^7.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.21",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
||||
"@pushrocks/smartparam": "^1.0.4",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartrequest": "^1.1.23",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartrequest": "^1.1.43",
|
||||
"@pushrocks/smartshell": "^2.0.25",
|
||||
"@pushrocks/smartsocket": "^1.1.45",
|
||||
"@pushrocks/smartsocket": "^1.1.58",
|
||||
"@pushrocks/smartssh": "^1.2.3",
|
||||
"@pushrocks/smartstring": "^3.0.10",
|
||||
"@servezone/servezone-interfaces": "^2.0.29",
|
||||
"@types/shelljs": "^0.8.5",
|
||||
"@pushrocks/smartstring": "^3.0.17",
|
||||
"@servezone/servezone-interfaces": "^2.0.51",
|
||||
"@types/through2": "^2.0.34",
|
||||
"through2": "^3.0.1"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as plugins from '../npmci.plugins';
|
||||
|
||||
import {Npmci} from '../npmci.classes.npmci';
|
||||
import { Npmci } from '../npmci.classes.npmci';
|
||||
import { logger } from '../npmci.logging';
|
||||
|
||||
/**
|
||||
@@ -13,18 +13,20 @@ export class CloudlyConnector {
|
||||
this.npmciRef = npmciRefArg;
|
||||
}
|
||||
|
||||
|
||||
public async announceDockerContainer(optionsArg: plugins.servezoneInterfaces.IVersionData) {
|
||||
public async announceDockerContainer(optionsArg: plugins.servezoneInterfaces.version.IVersionData) {
|
||||
const cloudlyUrl = this.npmciRef.npmciConfig.getConfig().urlCloudly;
|
||||
if (!cloudlyUrl) {
|
||||
logger.log('warn', 'no cloudly url provided. Thus we cannot announce the newly built Dockerimage!');
|
||||
logger.log(
|
||||
'warn',
|
||||
'no cloudly url provided. Thus we cannot announce the newly built Dockerimage!'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const typedrequest = new plugins.typedrequest.TypedRequest<
|
||||
plugins.servezoneInterfaces.IRequest_Any_Cloudly_VersionManager_Update
|
||||
plugins.servezoneInterfaces.request.version.IRequest_Any_Cloudly_VersionManager_Update
|
||||
>(`https://${cloudlyUrl}/versionmanager`, 'update');
|
||||
|
||||
const response = (await typedrequest.fire(optionsArg));
|
||||
const response = await typedrequest.fire(optionsArg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export class NpmciDockerManager {
|
||||
`>>npmci docker ...<< cli arguments invalid... Please read the documentation.`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* builds a cwd of Dockerfiles by triggering a promisechain
|
||||
@@ -62,7 +62,7 @@ export class NpmciDockerManager {
|
||||
.then(Dockerfile.sortDockerfiles)
|
||||
.then(Dockerfile.mapDockerfiles)
|
||||
.then(Dockerfile.buildDockerfiles);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* login to the DockerRegistries
|
||||
@@ -70,7 +70,7 @@ export class NpmciDockerManager {
|
||||
public login = async () => {
|
||||
await this.prepare();
|
||||
await this.npmciRegistryStorage.loginAll();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* logs in docker
|
||||
@@ -98,7 +98,7 @@ export class NpmciDockerManager {
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* pushes an image towards a registry
|
||||
@@ -146,7 +146,7 @@ export class NpmciDockerManager {
|
||||
await dockerfile.push(dockerRegistryToPushTo, suffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* pulls an image
|
||||
@@ -165,7 +165,7 @@ export class NpmciDockerManager {
|
||||
for (const dockerfile of dockerfileArray) {
|
||||
await dockerfile.pull(localDockerRegistry, suffix);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* tests docker files
|
||||
@@ -173,5 +173,5 @@ export class NpmciDockerManager {
|
||||
public test = async () => {
|
||||
await this.prepare();
|
||||
return await Dockerfile.readDockerfiles(this).then(Dockerfile.testDockerfiles);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { logger } from '../npmci.logging';
|
||||
import * as plugins from './mod.plugins';
|
||||
import { bash } from '../npmci.bash';
|
||||
import { bash, bashNoError } from '../npmci.bash';
|
||||
import { Npmci } from '../npmci.classes.npmci';
|
||||
|
||||
export class NpmciGitManager {
|
||||
@@ -32,7 +32,7 @@ export class NpmciGitManager {
|
||||
public mirror = async () => {
|
||||
const githubToken = process.env.NPMCI_GIT_GITHUBTOKEN;
|
||||
const githubUser = process.env.NPMCI_GIT_GITHUBGROUP || this.npmciRef.npmciEnv.repo.user;
|
||||
const githubRepo = process.env.NPMCI_GIT_GITHUB || this.npmciRef.npmciEnv.repo;
|
||||
const githubRepo = process.env.NPMCI_GIT_GITHUB || this.npmciRef.npmciEnv.repo.repo;
|
||||
if (
|
||||
this.npmciRef.npmciConfig.getConfig().projectInfo.npm.packageJson.private === true ||
|
||||
this.npmciRef.npmciConfig.getConfig().npmAccessLevel === 'private'
|
||||
@@ -47,17 +47,22 @@ export class NpmciGitManager {
|
||||
logger.log('info', 'found github token.');
|
||||
logger.log('info', 'attempting the mirror the repository to GitHub');
|
||||
|
||||
// plugins.smartgit.GitRepo;
|
||||
// remove old mirrors
|
||||
await bashNoError('git remote rm mirror');
|
||||
|
||||
await bash(`git fetch`);
|
||||
// add the mirror
|
||||
console.log(`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`);
|
||||
await bash(
|
||||
await bashNoError(
|
||||
`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`
|
||||
);
|
||||
await bash(`git push mirror --all`);
|
||||
await bashNoError(`git push mirror --all`);
|
||||
await bashNoError(`git checkout origin/master`);
|
||||
await bashNoError(`git push mirror master`);
|
||||
logger.log('ok', 'pushed all branches to mirror!');
|
||||
await bash(`git push mirror --tags`);
|
||||
await bashNoError(`git push mirror --tags`);
|
||||
logger.log('ok', 'pushed all tags to mirror!');
|
||||
// remove old mirrors
|
||||
await bashNoError('git remote rm mirror');
|
||||
} else {
|
||||
logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`);
|
||||
process.exit(1);
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
export * from '../npmci.plugins';
|
||||
|
||||
import * as smartgit from '@pushrocks/smartgit';
|
||||
|
||||
export { smartgit };
|
||||
|
||||
@@ -62,7 +62,6 @@ export class NpmciNodeJsManager {
|
||||
await bash('npm install -g npm');
|
||||
await bash('node -v');
|
||||
await bash('npm -v');
|
||||
await bash(`npm config set cache ${paths.NpmciCacheDir} --global `);
|
||||
|
||||
// lets look for further config
|
||||
const config = await this.npmciRef.npmciConfig.getConfig();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as plugins from './mod.plugins';
|
||||
import * as paths from '../npmci.paths';
|
||||
|
||||
import { logger } from '../npmci.logging';
|
||||
import { bash, bashNoError, nvmAvailable } from '../npmci.bash';
|
||||
@@ -22,6 +23,9 @@ export class NpmciNpmManager {
|
||||
case 'install':
|
||||
await this.install();
|
||||
break;
|
||||
case 'build':
|
||||
await this.build();
|
||||
break;
|
||||
case 'prepare':
|
||||
await this.prepare();
|
||||
break;
|
||||
@@ -70,6 +74,10 @@ export class NpmciNpmManager {
|
||||
|
||||
// lets save it to disk
|
||||
plugins.smartfile.memory.toFsSync(npmrcFileString, '/root/.npmrc');
|
||||
|
||||
// lets set the cache directory
|
||||
await bash(`npm config set cache ${paths.NpmciCacheDir} --global `);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,8 +141,8 @@ export class NpmciNpmManager {
|
||||
await bash(`npm -v`);
|
||||
|
||||
// -> build it
|
||||
await bash(`npm install`);
|
||||
await bash(`npm run build`);
|
||||
await this.install();
|
||||
await this.build();
|
||||
|
||||
logger.log('success', `Nice!!! The build for the publication was successfull!`);
|
||||
logger.log('info', `Lets clean up so we don't publish any packages that don't belong to us:`);
|
||||
@@ -152,7 +160,12 @@ export class NpmciNpmManager {
|
||||
|
||||
public async install(): Promise<void> {
|
||||
logger.log('info', 'now installing dependencies:');
|
||||
await bash('npm install');
|
||||
await bash('npm ci');
|
||||
}
|
||||
|
||||
public async build(): Promise<void> {
|
||||
logger.log('info', 'now building the project:');
|
||||
await bash('npm run build');
|
||||
}
|
||||
|
||||
public async test(): Promise<void> {
|
||||
|
||||
@@ -6,9 +6,7 @@ export { path };
|
||||
// @apiglobal
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
|
||||
export {
|
||||
typedrequest
|
||||
};
|
||||
export { typedrequest };
|
||||
|
||||
// @servezone
|
||||
import * as servezoneInterfaces from '@servezone/servezone-interfaces';
|
||||
|
||||
Reference in New Issue
Block a user