Skip to content

Commit

Permalink
feat(docs): add listBuildTriggers sample to README (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe authored Oct 17, 2019
1 parent 2c0c0a4 commit eecc8b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
20 changes: 20 additions & 0 deletions generated,README.md,.eslintrc.yml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

* [Before you begin](#before-you-begin)
* [Samples](#samples)
* [List Triggers.](#list-triggers.)
* [Quickstart](#quickstart)

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



### List Triggers.

List available build triggers.

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

[![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)

__Usage:__


`node list-build-triggers.js <PROJECT_ID>`


-----




### Quickstart

View the [source code](https://github.com/googleapis/nodejs-cloudbuild/blob/master/samples/quickstart.js).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* Copyright 2019, Google, LLC.
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -15,6 +16,11 @@

'use strict';

// sample-metadata:
// title: List Triggers.
// description: List available build triggers.
// usage: node list-build-triggers.js <PROJECT_ID>

// [START cloudbuild_list_build_triggers]
async function listBuildTriggers(
projectId = 'YOUR_PROJECT_ID' // Your Google Cloud Platform project ID
Expand Down
7 changes: 4 additions & 3 deletions generated,README.md,.eslintrc.yml/system-test/samples.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* Copyright 2019, Google, LLC.
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -50,7 +51,7 @@ describe('Sample Integration Tests', () => {

it('should run list-build-triggers.js', async () => {
const stdout = execSync(
`node ./samples/list-build-triggers.js ${PROJECT_ID} ${TRIGGER_ID} cloud-build-mvp`,
`node ./samples/listBuildTriggers.js ${PROJECT_ID} ${TRIGGER_ID} cloud-build-mvp`,
{cwd}
);
assert.include(stdout, 'Push-to-any-branch');
Expand Down

0 comments on commit eecc8b0

Please sign in to comment.