Skip to content

Commit

Permalink
Update CircleCI config and version to v1.3.0 (#90)
Browse files Browse the repository at this point in the history
Update CircleCI config and version to v1.3.0
  • Loading branch information
jkwlui committed Aug 31, 2018
1 parent 4010a95 commit 83c7b6a
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 35 deletions.
107 changes: 76 additions & 31 deletions packages/google-cloud-videointelligence/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,47 @@ workflows:
tests:
jobs: &workflow_jobs
- node6:
filters:
filters: &all_commits
tags:
only: /.*/
- node8:
filters:
tags:
only: /.*/
filters: *all_commits
- node10:
filters:
tags:
only: /.*/
filters: *all_commits
- lint:
requires:
- node6
- node8
- node10
filters:
tags:
only: /.*/
filters: *all_commits
- docs:
requires:
- node6
- node8
- node10
filters:
tags:
only: /.*/
- sample_tests:
filters: *all_commits
- system_tests:
requires:
- lint
- docs
filters:
filters: &master_and_releases
branches:
only: master
tags:
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:
only: '/^v[\d.]+$/'
tags: *releases
nightly:
triggers:
- schedule:
Expand All @@ -60,73 +57,121 @@ jobs:
node6:
docker:
- image: 'node:6'
user: node
steps: &unit_tests_steps
- checkout
- checkout
- run: &npm_install_and_link
name: Install and link the module.
command: npm install
name: Install and link the module
command: |-
mkdir -p /home/node/.npm-global
npm install
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run: npm test
- run: node_modules/.bin/codecov

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 install
npm link ../
npm install
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:
name: Build documentation.
command: npm run docs
- run: npm run docs
sample_tests:
docker:
- image: 'node:8'
user: node
steps:
- checkout
- run:
name: Decrypt credentials.
command: |
openssl aes-256-cbc -d -in .circleci/key.json.enc \
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}"
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: /var/video-intelligence/.circleci/key.json
GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Remove unencrypted key.
command: rm .circleci/key.json
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
openssl aes-256-cbc -d -in .circleci/key.json.enc \
-out .circleci/key.json \
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
fi
- run: *npm_install_and_link
- run:
name: Run system tests.
command: npm run system-test
environment:
GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json
- run:
name: Remove unencrypted key.
command: |
if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
rm .circleci/key.json
fi
when: always
working_directory: /var/video-intelligence/
publish_npm:
docker:
- image: 'node:8'
user: node
steps:
- checkout
- run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
- run: npm publish
- run: npm install
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run: npm publish --access=public
4 changes: 2 additions & 2 deletions packages/google-cloud-videointelligence/.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/video-intelligence',
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-videointelligence/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@google-cloud/video-intelligence",
"description": "Google Cloud Video Intelligence API client for Node.js",
"version": "1.2.0",
"version": "1.3.0",
"license": "Apache-2.0",
"author": "Google Inc",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "ava -T 5m --verbose system-test/*.test.js"
},
"dependencies": {
"@google-cloud/video-intelligence": "^1.2.0",
"@google-cloud/video-intelligence": "^1.3.0",
"yargs": "^12.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 83c7b6a

Please sign in to comment.