Skip to content

Commit 0c92c65

Browse files
Repo Migration (#7)
1 parent 15c17be commit 0c92c65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5555
-3681
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
environment:
2+
matrix:
3+
- nodejs_version: 4
4+
- nodejs_version: 6
5+
- nodejs_version: 7
6+
- nodejs_version: 8
7+
8+
install:
9+
- ps: Install-Product node $env:nodejs_version
10+
- npm install -g npm # Force using the latest npm to get dedupe during install
11+
- set PATH=%APPDATA%\npm;%PATH%
12+
- npm install --force --ignore-scripts
13+
14+
test_script:
15+
- node --version
16+
- npm --version
17+
- npm rebuild
18+
- npm test
19+
20+
build: off
21+
22+
matrix:
23+
fast_finish: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
---
2+
# "Include" for unit tests definition.
3+
unit_tests: &unit_tests
4+
steps:
5+
- checkout
6+
- run:
7+
name: Install modules and dependencies.
8+
command: npm install
9+
- run:
10+
name: Run unit tests.
11+
command: npm test
12+
- run:
13+
name: Submit coverage data to codecov.
14+
command: node_modules/.bin/codecov
15+
when: always
16+
17+
version: 2.0
18+
workflows:
19+
version: 2
20+
tests:
21+
jobs:
22+
- node4:
23+
filters:
24+
tags:
25+
only: /.*/
26+
- node6:
27+
filters:
28+
tags:
29+
only: /.*/
30+
- node7:
31+
filters:
32+
tags:
33+
only: /.*/
34+
- node8:
35+
filters:
36+
tags:
37+
only: /.*/
38+
- lint:
39+
requires:
40+
- node4
41+
- node6
42+
- node7
43+
- node8
44+
filters:
45+
tags:
46+
only: /.*/
47+
- docs:
48+
requires:
49+
- node4
50+
- node6
51+
- node7
52+
- node8
53+
filters:
54+
tags:
55+
only: /.*/
56+
- system_tests:
57+
requires:
58+
- lint
59+
- docs
60+
filters:
61+
branches:
62+
only: master
63+
tags:
64+
only: /^v[\d.]+$/
65+
- sample_tests:
66+
requires:
67+
- lint
68+
- docs
69+
filters:
70+
branches:
71+
only: master
72+
tags:
73+
only: /^v[\d.]+$/
74+
- publish_npm:
75+
requires:
76+
- system_tests
77+
- sample_tests
78+
filters:
79+
branches:
80+
ignore: /.*/
81+
tags:
82+
only: /^v[\d.]+$/
83+
84+
jobs:
85+
node4:
86+
docker:
87+
- image: node:4
88+
steps:
89+
- checkout
90+
- run:
91+
name: Install modules and dependencies.
92+
command: npm install --unsafe-perm
93+
- run:
94+
name: Run unit tests.
95+
command: npm test
96+
- run:
97+
name: Submit coverage data to codecov.
98+
command: node_modules/.bin/codecov
99+
when: always
100+
node6:
101+
docker:
102+
- image: node:6
103+
<<: *unit_tests
104+
node7:
105+
docker:
106+
- image: node:7
107+
<<: *unit_tests
108+
node8:
109+
docker:
110+
- image: node:8
111+
<<: *unit_tests
112+
113+
lint:
114+
docker:
115+
- image: node:8
116+
steps:
117+
- checkout
118+
- run:
119+
name: Install modules and dependencies.
120+
command: |
121+
npm install
122+
npm link
123+
- run:
124+
name: Link the module being tested to the samples.
125+
command: |
126+
cd samples/
127+
npm link @google-cloud/compute
128+
npm install
129+
cd ..
130+
- run:
131+
name: Run linting.
132+
command: npm run lint
133+
134+
docs:
135+
docker:
136+
- image: node:8
137+
steps:
138+
- checkout
139+
- run:
140+
name: Install modules and dependencies.
141+
command: npm install
142+
- run:
143+
name: Build documentation.
144+
command: npm run docs
145+
146+
sample_tests:
147+
docker:
148+
- image: node:8
149+
steps:
150+
- checkout
151+
- run:
152+
name: Decrypt credentials.
153+
command: |
154+
openssl aes-256-cbc -d -in .circleci/key.json.enc \
155+
-out .circleci/key.json \
156+
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
157+
- run:
158+
name: Install and link the module.
159+
command: |
160+
npm install
161+
npm link
162+
- run:
163+
name: Link the module being tested to the samples.
164+
command: |
165+
cd samples/
166+
npm link @google-cloud/compute
167+
npm install
168+
cd ..
169+
- run:
170+
name: Run sample tests.
171+
command: npm run samples-test
172+
environment:
173+
GCLOUD_PROJECT: long-door-651
174+
GOOGLE_APPLICATION_CREDENTIALS: /var/compute/.circleci/key.json
175+
- run:
176+
name: Remove unencrypted key.
177+
command: rm .circleci/key.json
178+
when: always
179+
working_directory: /var/compute/
180+
181+
system_tests:
182+
docker:
183+
- image: node:8
184+
steps:
185+
- checkout
186+
- run:
187+
name: Decrypt credentials.
188+
command: |
189+
openssl aes-256-cbc -d -in .circleci/key.json.enc \
190+
-out .circleci/key.json \
191+
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
192+
- run:
193+
name: Install modules and dependencies.
194+
command: npm install
195+
- run:
196+
name: Run system tests.
197+
command: npm run system-test
198+
environment:
199+
GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json
200+
- run:
201+
name: Remove unencrypted key.
202+
command: rm .circleci/key.json
203+
when: always
204+
205+
publish_npm:
206+
docker:
207+
- image: node:8
208+
steps:
209+
- checkout
210+
- run:
211+
name: Set NPM authentication.
212+
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
213+
- run:
214+
name: Publish the module to npm.
215+
command: npm publish
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"requiresKeyFile": true,
3+
"requiresProjectId": true,
4+
"product": "compute_engine",
5+
"client_reference_url": "https://cloud.google.com/nodejs/docs/reference/compute/latest/",
6+
"release_quality": "alpha",
7+
"samples": [
8+
{
9+
"id": "vms",
10+
"name": "Virtual Machines",
11+
"file": "vms.js",
12+
"docs_link": "https://cloud.google.com/compute/docs"
13+
}
14+
]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/*
2+
samples/node_modules/*
3+
src/**/doc/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
extends:
3+
- 'eslint:recommended'
4+
- 'plugin:node/recommended'
5+
- prettier
6+
plugins:
7+
- node
8+
- prettier
9+
rules:
10+
prettier/prettier: error
11+
block-scoped-var: error
12+
eqeqeq: error
13+
no-warning-comments: warn
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/*.log
2+
**/node_modules
3+
.coverage
4+
.nyc_output
5+
docs/
6+
out/
7+
system-test/secrets.js
8+
system-test/*key.json
9+
*.lock
10+
*-lock.js*
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*!
2+
* Copyright 2017 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
'use strict';
18+
19+
module.exports = {
20+
opts: {
21+
readme: './README.md',
22+
package: './package.json',
23+
template: './node_modules/ink-docstrap/template',
24+
recurse: true,
25+
verbose: true,
26+
destination: './docs/'
27+
},
28+
plugins: [
29+
'plugins/markdown'
30+
],
31+
source: {
32+
excludePattern: '(^|\\/|\\\\)[._]',
33+
include: [
34+
'src'
35+
],
36+
includePattern: '\\.js$'
37+
},
38+
templates: {
39+
copyright: 'Copyright 2017 Google, Inc.',
40+
includeDate: false,
41+
sourceFiles: false,
42+
systemName: '@google-cloud/compute',
43+
theme: 'lumen'
44+
}
45+
};

packages/google-cloud-compute/.nycrc

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"report-dir": "./.coverage",
3+
"exclude": [
4+
"src/*{/*,/**/*}.js",
5+
"src/*/v*/*.js",
6+
"test/**/*.js"
7+
],
8+
"watermarks": {
9+
"branches": [
10+
95,
11+
100
12+
],
13+
"functions": [
14+
95,
15+
100
16+
],
17+
"lines": [
18+
95,
19+
100
20+
],
21+
"statements": [
22+
95,
23+
100
24+
]
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/*
2+
samples/node_modules/*
3+
src/**/doc/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
bracketSpacing: false
3+
printWidth: 80
4+
semi: true
5+
singleQuote: true
6+
tabWidth: 2
7+
trailingComma: es5
8+
useTabs: false

0 commit comments

Comments
 (0)