From 78d0df3574f1f2b0d5a94bd2bb07589f9c8b9c62 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:34:53 -0800 Subject: [PATCH] build: add Kokoro configs for autorelease (#180) * 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-monitoring/.circleci/config.yml delete mode 100644 packages/google-cloud-monitoring/.circleci/key.json.enc delete mode 100755 packages/google-cloud-monitoring/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-monitoring/.circleci/config.yml b/packages/google-cloud-monitoring/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-monitoring/.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-monitoring/.circleci/key.json.enc b/packages/google-cloud-monitoring/.circleci/key.json.enc deleted file mode 100644 index 72559a5251f74245329170fdba83bacccfde04a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2368 zcmV-G3BUGJVQh3|WM5xs5Wvrzg%}{96+WNJ3%jnaHc{Bf3ni3RHL&RHZCPQ@0t8^NE9HF?F4{5|Cgu4${N^_(v;fshb(f_!+d z8}i^b_#J&=)GK6Wrp9&h*tAec7G1tf$9*Pk9QR0h#x1zx=Mb*1)x|ODr>NYB__Di-l96C(=)CY7YdjMOE zK%c!mIFu#!BVN*<*#AQ1wvhJ$BbAkWDYuU8ouB!O)3tj~OwB<`fO`6zN`dH$S6hw=fK$SSn zb7U5fGZ09+3)LO}5pNRo!&daxH85Ko^S<0Fr$I#9zVLxb(H@DVJYP_n7ok=aN3DTx z)hanYF^l4-(tp-xTZ%D-vq~WQw5$=5*4q#`f zhJ4ojED~0$&0?D(*|EPRgMVWFc|Xkp>ez8kb1G>mDl54#3H^cb87U=Hi>D*ZG@(UgZ2oB5)}Dk}ZL%pJsZgs~nO` z$&8Ln41#K|sVjmK*7LI0XgNumH6XjT11sEj1_e-j=(D-J5Xzb1Q^1s1IyQ#|ffEHN zreaR07gJ6jbweYJ?HKN>?WX_-to8@*TWLNAOXex z7ms9@o5SNTpKWYU@R~wzhu`l^eMQgVXh`L!Z47K?EEz>A^frb+wwnWavcuX(prB17 zb6?>kh2Oc8(9?Q1xIb{hULg1cKeB1LTAi#>>+>itj(3J!Zu-P9f+Fx*XBY#QCV%)S zhaSP)osbK=PR_&=C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&0WqSXzfVV7lxjU0q_T_5mbD`WS z59&E15HWD$xN5Hly{diEFPY5-v&}TMu00 [... 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); - } -})();