From 95c8f757fe1ed68a95bfbc2ce302d7595c9e91ea Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 5 Sep 2018 10:40:24 -0700 Subject: [PATCH] Add templating to synth and update CI config (#43) --- packages/google-cloud-redis/.circleci/config.yml | 11 +++++++---- packages/google-cloud-redis/.jsdoc.js | 4 ++-- packages/google-cloud-redis/synth.py | 11 +++++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-redis/.circleci/config.yml b/packages/google-cloud-redis/.circleci/config.yml index 80dcf7e67d9..8af6a4d0489 100644 --- a/packages/google-cloud-redis/.circleci/config.yml +++ b/packages/google-cloud-redis/.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-redis/.jsdoc.js b/packages/google-cloud-redis/.jsdoc.js index bc0d4a2819a..130e55e3220 100644 --- a/packages/google-cloud-redis/.jsdoc.js +++ b/packages/google-cloud-redis/.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/redis', diff --git a/packages/google-cloud-redis/synth.py b/packages/google-cloud-redis/synth.py index e259ac47b49..899672a14a8 100644 --- a/packages/google-cloud-redis/synth.py +++ b/packages/google-cloud-redis/synth.py @@ -9,8 +9,7 @@ # tasks has two product names, and a poorly named artman yaml version = 'v1beta1' -library = gapic.node_library( - 'redis', version) +library = gapic.node_library('redis', version) # skip index, protos, package.json, and README.md s.copy( @@ -18,9 +17,9 @@ excludes=['package.json', 'README.md', 'src/index.js', f'src/{version}/index.js']) -# -# Node.js specific cleanup -# +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library() +s.copy(templates) + subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'prettier']) -subprocess.run(['npm', 'run', 'lint'])