Skip to content

Commit

Permalink
Add templating to synth and update CI config (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Sep 5, 2018
1 parent 8cbf739 commit 95c8f75
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
11 changes: 7 additions & 4 deletions packages/google-cloud-redis/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-redis/.jsdoc.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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',
Expand Down
11 changes: 5 additions & 6 deletions packages/google-cloud-redis/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@

# 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(
library,
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'])

0 comments on commit 95c8f75

Please sign in to comment.