From 2c285f7df56e3f0c5398b5138cc0c426def9092a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:34:42 -0800 Subject: [PATCH] build: add Kokoro configs for autorelease (#257) * build: add Kokoro configs for autorelease * build: add Kokoro configs for autorelease * chore: remove CircleCI config --- .../google-cloud-speech/.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-speech/.circleci/config.yml delete mode 100644 packages/google-cloud-speech/.circleci/key.json.enc delete mode 100755 packages/google-cloud-speech/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-speech/.circleci/config.yml b/packages/google-cloud-speech/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-speech/.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-speech/.circleci/key.json.enc b/packages/google-cloud-speech/.circleci/key.json.enc deleted file mode 100644 index 8d522f44763342f65c2b7f658c999b66e8e24d61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2368 zcmV-G3BUGJVQh3|WM5wqdHwPsEJB~*Dr^$fSNw;yrouu3tfnWrPqTux;7Tx8JD)mR z%B=&UXEZQXoMXTrGpm;VLHUSsGju}$kHKJn&Rkd=r4uh% z-hZGnZ)?kFlrCyWx)i*h_gTQ(XkI5QQ24|5lZLyTsrX-2Jbs#9I)py+bC}_$vdYu1Jm$_Pkqf%ZcZjs>BVmh#KskoswwuNGhtKcQ+mi( z?c-5w5PQN2uMEE2C8gcCa45u*-b7$uCJk27tno#xBjB2nwzGNlJqq}H_Bb6`SuztK z$nqFrmCMD3pG1`0U40M<@ze)(9T02D66^` zVKhb$?&46zS4o@n&W%9lf0AKLiP-(8-ReQ(v6-GN;(rJ(kPVue_F6ISf(rr#&p;3;BfzJdD?4yY?cJQi6^y!2=^B)6$^J91ypPM?* z#0>6)28qm{3+Dt(9`e#i^T{5Qww32`;c_LhVYUeyL2Wm(+FoG%^$c;U-Z6HoOrK8Y8?Wtt* zx*ZBb9S012Y=s4}jDKW6E(-UttmJn`KF-IWFcq+#@Vi;&ci1-+d`jbYD&bUG=lw_#K7 zTVI59IbniXIDlIYDOaEs$AWKXW(*PL9{i8-z4lry;?YfGu2bmJqh(Pvrk3T43ZOC~x^U4p+5^u43>9=N!^QqN*w$S?yn( z6|;bnK$HCcI$NRQ9XBkyaX#&wv7gNJl-RG}8;yGTJ{%hszHb<@bx@kzi9JWXUUne0 zxYwC7L_Xopr;5FGtvS)){5X=DDHqi^ksXdncon3C{r>U(6bN}6ZzZ5(H`QoS@S4ZR zDggv#O&^ZXp+NZGl-Sq8Eo0gC+)hn4k~BiJ+=Wu}R>sS1QuRD!?;@iU9=3VIUNH)I zr`{*+2h#oU_|cI{cwQ`7h~EY2ITs!-SX5QbI9v{|rOobS2}nw(flD{^FkCf8f_ zC8D6rP#g_xwbYvoYI2Mu*yOVVLr=p3D-2^1Sw9RmlogdRJ;N48&uT+Gg9I*}J>UGR zpw(|o3YOFOC8ma9FxUi8OGJ0>JQ|`q$pN}wg$ei!ok1MoCLYJ!JRPrzCkb--yI`4T z`1M0C^f2oMT+?@OzvRGvR~QV*o1>qjRbRf&|5U^kXsCVFR}wo+96nF0cbnEzB_*#i z-Ruzpav!G_*P9+-3wr;quk2+?QvA^OK7V&@bnN;Rr}hw79TH)xH1E#B`y&V-u9SU@}z$+z+v((VLu;qGF*-C3Y%$Nj`=c< zI}r)-5Rx38PtZnq0rn+`SrD2Q16oS*LcT@TwICX+a0v*tfDLAc%stG6arAxKRZ3F! z#r9l&5N;r8BvNE%&ta@i(v(?*S?oYi!asuFj&pnm+>VQU|8%_LFH?Tb^F`h{WTmIcK`d`QohuK~PJjgwGGW^kJ13EP+4ml7}T45FIECN^(#Yg^R$b{lM-i8tT8?K{kXNO mM~aqg$5V{ELVe07g!WH(qm!sO#B(jn%lYeh1tDB(KHHuBnVUlZ diff --git a/packages/google-cloud-speech/.circleci/npm-install-retry.js b/packages/google-cloud-speech/.circleci/npm-install-retry.js deleted file mode 100755 index 3240aa2cbf2..00000000000 --- a/packages/google-cloud-speech/.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); - } -})();