From 9c9626df69979371885d430a9609686945658146 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:34:35 -0800 Subject: [PATCH] build: add Kokoro configs for autorelease (#138) * 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 2368 -> 0 bytes .../.circleci/npm-install-retry.js | 60 ------ 3 files changed, 239 deletions(-) delete mode 100644 packages/google-cloud-bigquery-datatransfer/.circleci/config.yml delete mode 100644 packages/google-cloud-bigquery-datatransfer/.circleci/key.json.enc delete mode 100755 packages/google-cloud-bigquery-datatransfer/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-bigquery-datatransfer/.circleci/config.yml b/packages/google-cloud-bigquery-datatransfer/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-bigquery-datatransfer/.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-bigquery-datatransfer/.circleci/key.json.enc b/packages/google-cloud-bigquery-datatransfer/.circleci/key.json.enc deleted file mode 100644 index 619ae47d1d8c9e22c069a7203bc7a1f7a75cc515..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2368 zcmV-G3BUGJVQh3|WM5w+l55KD%gV0k#*}#t)LdlIsqs{@GZ}zDsXK52+L%!t(*_|o z&o^40nn!a&Mf#6Fdi+-zig4tZz=&ClgLQ`~COm5K0xp8#lE3P;c6%=ia_mm#t2bf+#vN$gp%~jq8zVlV0#ino_N6kr!{+ zCh4Ww14-m{jE`GbQEOE)vi^L9z?nymZLF`U10L@YzNL+c%sW=j&2 zD}c3-nTKds;EZKlb+7ORu(&_+`f$g#qUhB#WB!Lc4IXtGpQ zYIUw+TH30uDqYt19iV4ir__;?-5?hQjB2hR$fRh!Y#i&vz6EPAPu*lbcr-{LeagWU zx9T;aWm{#z^;O%(GG>l2TaO0g7W6R5t}K`|n{nb-Zpv9{Sl1H52Q=5i$XSU(Yy6et zS-aXDn)l^HJyRV9J6nS;lSg1{t|s~dH*N747prhQ{rvC48X=x|QHzTzfxCa!3_@$0!99DL8|RPQIr5r?v-mV)4z1#{QNciMKwpVzGWK>%UO1%U#t}1?sYLSu(|VEqi~&4Q^v!X)5%_D_#Tb@6A{w!Jo*=q=-eR_gclt5 zFn_7n?*Z}=cL*g=!2$uNd;G@B!d_S>9F)v8^f$;Vdxxw;@jG=cT)w?kC$M_WcN`Vh zi9ftNIeb%^T9RSqGSA~ID$5M&7j||$yqoLP*Q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4Dt(j|1q+r-c1iw{Lb^2ElH7OcDmX3%D||LXI>k)(}-r*}$N z844bTAGa|B687qMiwse*PEQJi6r-2cG%e03A4eY-?2}d9#qxYBQ%C);ndH@vmII9> ziA9Z3IwCbWo_br)NnwtZJjS?w7&q-NQ;;Rc`j^=d7^xnLhoRn_4HHES(G7`q@_&{* z$F#K~tg$ZEW&j0Z6~H^Nna9-dS)U+O%@!hJVdLnbyXsU)r-MHhfn) [... 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); - } -})();