From 990d9b5ea4f1681bfa84f11e82fac66037a30832 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:36:45 -0800 Subject: [PATCH] build: add Kokoro configs for autorelease (#18) * build: add Kokoro configs for autorelease * build: add Kokoro configs for autorelease * chore: remove CircleCI config --- .../.circleci/config.yml | 179 ------------------ .../.circleci/key.json.enc | Bin 2352 -> 0 bytes .../.circleci/npm-install-retry.js | 60 ------ 3 files changed, 239 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/.circleci/config.yml delete mode 100644 packages/google-cloud-securitycenter/.circleci/key.json.enc delete mode 100755 packages/google-cloud-securitycenter/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-securitycenter/.circleci/config.yml b/packages/google-cloud-securitycenter/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-securitycenter/.circleci/config.yml +++ /dev/null @@ -1,179 +0,0 @@ -version: 2 -workflows: - version: 2 - tests: - jobs: &workflow_jobs - - node6: - filters: &all_commits - tags: - only: /.*/ - - node8: - filters: *all_commits - - node10: - filters: *all_commits - - lint: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - docs: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - system_tests: - requires: - - lint - - docs - filters: &master_and_releases - branches: - only: master - tags: &releases - only: '/^v[\d.]+$/' - - sample_tests: - requires: - - lint - - docs - filters: *master_and_releases - - publish_npm: - requires: - - system_tests - - sample_tests - filters: - branches: - ignore: /.*/ - tags: *releases - nightly: - triggers: - - schedule: - cron: 0 7 * * * - filters: - branches: - only: master - jobs: *workflow_jobs -jobs: - node6: - docker: - - image: 'node:6' - user: node - steps: &unit_tests_steps - - checkout - - run: &npm_install_and_link - name: Install and link the module - command: |- - mkdir -p /home/node/.npm-global - ./.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: npm test - node8: - docker: - - image: 'node:8' - user: node - steps: *unit_tests_steps - node10: - docker: - - image: 'node:10' - user: node - steps: *unit_tests_steps - lint: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: &samples_npm_install_and_link - name: Link the module being tested to the samples. - command: | - cd samples/ - npm link ../ - ./../.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Run linting. - command: npm run lint - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - docs: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: npm run docs - sample_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - fi - - run: *npm_install_and_link - - run: *samples_npm_install_and_link - - run: - name: Run sample tests. - command: npm run samples-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json - fi - when: always - working_directory: /home/node/samples/ - system_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -md md5 -in $encrypted_key \ - -out $(echo $encrypted_key | sed 's/\.enc//') \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - done - fi - - run: *npm_install_and_link - - run: - name: Run system tests. - command: npm run system-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/*.json - fi - when: always - publish_npm: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: ./.circleci/npm-install-retry.js - - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - - run: npm publish --access=public diff --git a/packages/google-cloud-securitycenter/.circleci/key.json.enc b/packages/google-cloud-securitycenter/.circleci/key.json.enc deleted file mode 100644 index f44a58d71836b6b2d7e5f10671736830062705b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2352 zcmV-03D5RZVQh3|WM5yK`O*QxmOAz^NI-L~l_t7FZesR!&_Gt~RV$-gEl0+*u7~bp05)+ z?i@{6HmdQf$#r3m_ky-wzY8~>K4zW`-+ZEaL;mZFc~+R~4{z{lJooRp2G}C3wH>B8 zEGkp{JSFo*{98#Ch`~C%N`NHb{nZ!v%h*^4Kfx+l>O3!-5<+4ZbPyIK@K6R>xXshq z2w9S8wqCHA4@fFzs$p`=XwKG@g(ikdqZGXTos1w`jl=0pxdeoJ0tG}(Fwk8W91}}Z zuq}TGNIT_P6*XpMg0oyDIv&K(V_WC-3&)_pNG8S@k!I=0#jR~WGldaVM(WutpNZ|# zTjb!z4qUGqs(ma3pqMBo7a+4Yg~ZES*+A%r$h?#}|AX!FE{an@h6m=5F>t`IbTmt1 zL6c3mM?W2kRB{;CG=9~jbxy^|c~ss5Lks;~g94va7Y7M-t}w#$bpz-9MnH7g45s}= z>RSA}L^H*mY+i^1Z8o?xg!`KQa;X)1u?i6~q_K{P^=Kg{N#rKov`@s)%G)n($2NRy$2>=E-%ZO8 z69;+8P0aOF=bmsQrWq`raEo6WT>%9#^tA;WqRcc-HfXj(3LmW|1&P6|pm3Pg6CY;E zHaG?xM^GOlq)x9ad*Gd5y!I{fhCb%Z+L0?u9h!Xdb(mRANR}Y|E8C(GbZGO##vZX{ zg(0CTr3F%yi~wk_L2AE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8TOANm{;< z{SHfI2$acp4R{wLC{v%6K3XHLQzmtL&BDnM#UVR|<_;R@lmyH5bFtAf2lJk?pn_&w@p&Q?zre>`tJ9`Lb0lxZL^C%1QUiNe-<9cOE0UAc zQkVd37rciH(AP|2sjt zjPuYXGOF;Wi6L5X*yuhysWIG1|E}T2W$gwX0*0%xC>g$v8{)aES2D8=29(UN0qWGZ zvm}`A)g&J*@~Smil1Rbz!vmZzdpGeRU9Et)0T#m`SS#zO!%GO@23U7chKkUaB3j6y W`jC4YdTKOxG`92c0ZW*e6_iGF!;uyM diff --git a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js deleted file mode 100755 index 3240aa2cbf2..00000000000 --- a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env node - -let spawn = require('child_process').spawn; - -// -//USE: ./index.js [... NPM ARGS] -// - -let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; -let attempts = process.argv[3] || 3; -let args = process.argv.slice(4); -if (args.length === 0) { - args = ['install']; -} - -(function npm() { - let timer; - args.push('--verbose'); - let proc = spawn('npm', args); - proc.stdout.pipe(process.stdout); - proc.stderr.pipe(process.stderr); - proc.stdin.end(); - proc.stdout.on('data', () => { - setTimer(); - }); - proc.stderr.on('data', () => { - setTimer(); - }); - - // side effect: this also restarts when npm exits with a bad code even if it - // didnt timeout - proc.on('close', (code, signal) => { - clearTimeout(timer); - if (code || signal) { - console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); - - if (--attempts) { - console.log('[npm-are-you-sleeping] restarting'); - npm(); - } else { - console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); - throw new Error("npm install fails"); - } - } - }); - - function setTimer() { - clearTimeout(timer); - timer = setTimeout(() => { - console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); - proc.kill('SIGTERM'); - // wait a couple seconds - timer = setTimeout(() => { - // its it's still not closed sigkill - console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); - proc.kill('SIGKILL'); - }, 2000); - }, timeout); - } -})();