diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 694f93e..77d706f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,9 +10,11 @@ stages: - security - test - release -- trigger -- pages +- metadata +# ==================== +# security stage +# ==================== mirror: stage: security script: @@ -31,25 +33,9 @@ snyk: - docker - notpriv -codequality: - stage: security - image: docker:stable - allow_failure: true - services: - - docker:stable-dind - script: - - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - - docker run - --env SOURCE_CODE="$PWD" - --volume "$PWD":/code - --volume /var/run/docker.sock:/var/run/docker.sock - "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code - artifacts: - paths: [codeclimate.json] - tags: - - docker - - priv - +# ==================== +# test stage +# ==================== testLEGACY: stage: test script: @@ -88,7 +74,6 @@ release: stage: release script: - npmci node install stable - - npmci npm prepare - npmci npm publish only: - tags @@ -96,8 +81,30 @@ release: - docker - notpriv +# ==================== +# metadata stage +# ==================== +codequality: + stage: metadata + image: docker:stable + allow_failure: true + services: + - docker:stable-dind + script: + - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') + - docker run + --env SOURCE_CODE="$PWD" + --volume "$PWD":/code + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code + artifacts: + paths: [codeclimate.json] + tags: + - docker + - priv + trigger: - stage: trigger + stage: metadata script: - npmci trigger only: @@ -108,7 +115,7 @@ trigger: pages: image: hosttoday/ht-docker-node:npmci - stage: pages + stage: metadata script: - npmci command yarn global add npmpage - npmci command npmpage diff --git a/ts/npmci.cli.ts b/ts/npmci.cli.ts index 980b3e1..4cb4a92 100644 --- a/ts/npmci.cli.ts +++ b/ts/npmci.cli.ts @@ -15,100 +15,109 @@ const npmciSmartcli = new plugins.smartcli.Smartcli(); npmciSmartcli.addVersion(npmciInfo.version); // clean -npmciSmartcli - .addCommand('clean') - .subscribe(async argv => { +npmciSmartcli.addCommand('clean').subscribe( + async argv => { let modClean = await npmciMods.modClean.load(); await modClean.clean(); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); // cloudflare -npmciSmartcli - .addCommand('cloudflare') - .subscribe(async argvArg => { +npmciSmartcli.addCommand('cloudflare').subscribe( + async argvArg => { let modPurge = await npmciMods.modCloudflare.load(); await modPurge.handleCli(argvArg); - }, err => { + }, + err => { console.log(err); - }); + } +); // command -npmciSmartcli - .addCommand('command') - .subscribe(async argv => { +npmciSmartcli.addCommand('command').subscribe( + async argv => { let modCommand = await npmciMods.modCommand.load(); await modCommand.command(); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); // command -npmciSmartcli - .addCommand('git') - .subscribe(async argvArg => { +npmciSmartcli.addCommand('git').subscribe( + async argvArg => { let modGit = await npmciMods.modGit.load(); await modGit.handleCli(argvArg); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); // build -npmciSmartcli - .addCommand('docker') - .subscribe(async argvArg => { +npmciSmartcli.addCommand('docker').subscribe( + async argvArg => { let modDocker = await npmciMods.modDocker.load(); await modDocker.handleCli(argvArg); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); // node -npmciSmartcli - .addCommand('node') - .subscribe(async argvArg => { +npmciSmartcli.addCommand('node').subscribe( + async argvArg => { let modNode = await npmciMods.modNode.load(); await modNode.handleCli(argvArg); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); // npm -npmciSmartcli - .addCommand('npm') - .subscribe(async argvArg => { +npmciSmartcli.addCommand('npm').subscribe( + async argvArg => { let modNpm = await npmciMods.modNpm.load(); await modNpm.handleCli(argvArg); - }, err => { + }, + err => { console.log(err); - }); + } +); // trigger -npmciSmartcli - .addCommand('ssh') - .subscribe(async argvArg => { +npmciSmartcli.addCommand('ssh').subscribe( + async argvArg => { let modSsh = await npmciMods.modSsh.load(); await modSsh.handleCli(argvArg); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); // trigger -npmciSmartcli - .addCommand('trigger') - .subscribe(async argv => { +npmciSmartcli.addCommand('trigger').subscribe( + async argv => { let modTrigger = await npmciMods.modTrigger.load(); await modTrigger.trigger(); - }, err => { + }, + err => { console.log(err); process.exit(1); - }); + } +); npmciSmartcli.startParse();