From c6e746fed5ae9be10faf66f1e1abd1281dbaa6e7 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 24 Sep 2018 12:04:32 -0700 Subject: [PATCH] build: bring in Kokoro cfgs via synth.py (#77) --- packages/google-cloud-oslogin/.circleci/config.yml | 11 +++++++---- .../.circleci/npm-install-retry.js | 2 +- packages/google-cloud-oslogin/.jsdoc.js | 4 ++-- packages/google-cloud-oslogin/synth.py | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-oslogin/.circleci/config.yml b/packages/google-cloud-oslogin/.circleci/config.yml index 80dcf7e67d9..8af6a4d0489 100644 --- a/packages/google-cloud-oslogin/.circleci/config.yml +++ b/packages/google-cloud-oslogin/.circleci/config.yml @@ -149,21 +149,24 @@ jobs: name: Decrypt credentials. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + for encrypted_key in .circleci/*.json.enc; do + openssl aes-256-cbc -d -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: .circleci/key.json - run: name: Remove unencrypted key. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json + rm .circleci/*.json fi when: always publish_npm: diff --git a/packages/google-cloud-oslogin/.circleci/npm-install-retry.js b/packages/google-cloud-oslogin/.circleci/npm-install-retry.js index ae3220d7348..3240aa2cbf2 100755 --- a/packages/google-cloud-oslogin/.circleci/npm-install-retry.js +++ b/packages/google-cloud-oslogin/.circleci/npm-install-retry.js @@ -6,7 +6,7 @@ let spawn = require('child_process').spawn; //USE: ./index.js [... NPM ARGS] // -let timeout = process.argv[2] || 60000; +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) { diff --git a/packages/google-cloud-oslogin/.jsdoc.js b/packages/google-cloud-oslogin/.jsdoc.js index 2886c844492..03bcfb68e89 100644 --- a/packages/google-cloud-oslogin/.jsdoc.js +++ b/packages/google-cloud-oslogin/.jsdoc.js @@ -1,5 +1,5 @@ /*! - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2018 Google LLC. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2017 Google, Inc.', + copyright: 'Copyright 2018 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/os-login', diff --git a/packages/google-cloud-oslogin/synth.py b/packages/google-cloud-oslogin/synth.py index 6817dd4a33a..20c7a287ee8 100644 --- a/packages/google-cloud-oslogin/synth.py +++ b/packages/google-cloud-oslogin/synth.py @@ -38,9 +38,12 @@ excludes=['package.json', 'README.md', 'src/index.js'], ) +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library() +s.copy(templates) + # # Node.js specific cleanup # subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'prettier']) -subprocess.run(['npm', 'run', 'lint'])