Skip to content

Commit eecc8b0

Browse files
author
Benjamin E. Coe
authored
feat(docs): add listBuildTriggers sample to README (#5)
1 parent 2c0c0a4 commit eecc8b0

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

generated,README.md,.eslintrc.yml/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
* [Before you begin](#before-you-begin)
1414
* [Samples](#samples)
15+
* [List Triggers.](#list-triggers.)
1516
* [Quickstart](#quickstart)
1617

1718
## Before you begin
@@ -23,6 +24,25 @@ Before running the samples, make sure you've followed the steps outlined in
2324

2425

2526

27+
### List Triggers.
28+
29+
List available build triggers.
30+
31+
View the [source code](https://github.com/googleapis/nodejs-cloudbuild/blob/master/samples/listBuildTriggers.js).
32+
33+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-cloudbuild&page=editor&open_in_editor=samples/listBuildTriggers.js,samples/README.md)
34+
35+
__Usage:__
36+
37+
38+
`node list-build-triggers.js <PROJECT_ID>`
39+
40+
41+
-----
42+
43+
44+
45+
2646
### Quickstart
2747

2848
View the [source code](https://github.com/googleapis/nodejs-cloudbuild/blob/master/samples/quickstart.js).

generated,README.md,.eslintrc.yml/list-build-triggers.js renamed to generated,README.md,.eslintrc.yml/listBuildTriggers.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/**
2-
* Copyright 2019, Google, LLC.
2+
* Copyright 2019 Google LLC
3+
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
56
* You may obtain a copy of the License at
67
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
89
*
910
* Unless required by applicable law or agreed to in writing, software
1011
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,6 +16,11 @@
1516

1617
'use strict';
1718

19+
// sample-metadata:
20+
// title: List Triggers.
21+
// description: List available build triggers.
22+
// usage: node list-build-triggers.js <PROJECT_ID>
23+
1824
// [START cloudbuild_list_build_triggers]
1925
async function listBuildTriggers(
2026
projectId = 'YOUR_PROJECT_ID' // Your Google Cloud Platform project ID

generated,README.md,.eslintrc.yml/system-test/samples.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/**
2-
* Copyright 2019, Google, LLC.
2+
* Copyright 2019 Google LLC
3+
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
56
* You may obtain a copy of the License at
67
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
89
*
910
* Unless required by applicable law or agreed to in writing, software
1011
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -50,7 +51,7 @@ describe('Sample Integration Tests', () => {
5051

5152
it('should run list-build-triggers.js', async () => {
5253
const stdout = execSync(
53-
`node ./samples/list-build-triggers.js ${PROJECT_ID} ${TRIGGER_ID} cloud-build-mvp`,
54+
`node ./samples/listBuildTriggers.js ${PROJECT_ID} ${TRIGGER_ID} cloud-build-mvp`,
5455
{cwd}
5556
);
5657
assert.include(stdout, 'Push-to-any-branch');

0 commit comments

Comments
 (0)