From a34bdfc46b3c5b8e1df990560a71a07ce54eaf22 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:34:10 -0800 Subject: [PATCH] build: add Kokoro configs for autorelease (#103) * build: add Kokoro configs for autorelease * build: add Kokoro configs for autorelease * chore: remove CircleCI config --- .../google-cloud-redis/.circleci/config.yml | 179 ------------------ .../google-cloud-redis/.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-redis/.circleci/config.yml delete mode 100644 packages/google-cloud-redis/.circleci/key.json.enc delete mode 100755 packages/google-cloud-redis/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-redis/.circleci/config.yml b/packages/google-cloud-redis/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-redis/.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-redis/.circleci/key.json.enc b/packages/google-cloud-redis/.circleci/key.json.enc deleted file mode 100644 index a1c0d809ce2b76632885370966837c1bc79e1396..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2368 zcmV-G3BUGJVQh3|WM5y+cUIV5a&~+y9=ac6358fSMUjh7(MWO2MKHEqS7-?SYqrDJ!KD5}S4jWm_7ZXE8y&*(c6nxMG z8X0$KD5<1aoY^`krr3X4{IeL)7JJ4GgGXuviVUOv05*Cz^kUHr z<^3XWy3_PFa;>l_SPq%m5Xo%X6kyn<0Y~sZ32(w=!_{ghP7Iwc^mj=QEDxBjk3)N@ z>Zt6!Lc0s%VXB@5u%ddnwK4VrOb);&&K2Euwz4EN;``wF9-~xiw{$eM@&_A^#8j|- zaqKAX?OcI$nEg8CQEOc*_n^p1zh^%CR17!2%d2xQ>F;P!%mTk=>k*r9#Q%TN6d#{? z?t+r2d2$qM+KWX~+f}PK%!BiZE zA?>(VTN#^je8XVyBB`9{TZnjxNW{vF?+$vNhAyQ9P5D&n?L7UC*YjK`>B^ULc~f1= zhcH8#t+3`S1>ag_B`ildE;4DKXSrC_SrfHJA;aT>LmJ&|kq%{bZ;lL`^wIE_t_Kd8 zUznPU%H2)Rf9B{&Jrt<{bPyuMsp#c!lwtc z>_xrHFh(M9L*Td^JSDL>F!7jN&&piasJn%HX1PUH4GZ~n%3sqNlzBh9^ySb2E?6H< zG76H9c9Q2lAO}}|teLbIFb_2Z(CaZloOg&;R^V$0%teIia>8}Cls(e?A!^sEDMi30o-qNLTSmN|t7J!;4lhDvJKG%R) z5eA4KZ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loJNJeJe{F|Cm zHwmvYu55rMS?IB?zgJqGW!0W652hg`-q@Zzn0p^VD51hOi8Nl+wu_%yVFa zKqZOi)8sp;9s%?_A&?##v04dlVg_hA454bY#gg4Yd+WP{iEAU@CYz5Y$Bs*#h}BkHKC>7AvN`s$G!sptw*^&mM0U^S@4)Z}mfN%#A [... 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); - } -})();