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 and Ace Nassri committed Nov 10, 2022
1 parent 5a73471 commit 0c512cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
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 cloudbuild/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 0c512cd

Please sign in to comment.