From 0c512cd0307cd3f96b6c5b4bb5d4182e0fd66958 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 17 Oct 2019 13:40:11 -0700 Subject: [PATCH] feat(docs): add listBuildTriggers sample to README (#5) --- .../{list-build-triggers.js => listBuildTriggers.js} | 10 ++++++++-- cloudbuild/system-test/samples.js | 7 ++++--- 2 files changed, 12 insertions(+), 5 deletions(-) rename cloudbuild/{list-build-triggers.js => listBuildTriggers.js} (83%) diff --git a/cloudbuild/list-build-triggers.js b/cloudbuild/listBuildTriggers.js similarity index 83% rename from cloudbuild/list-build-triggers.js rename to cloudbuild/listBuildTriggers.js index 3413ad380f..60d967b870 100644 --- a/cloudbuild/list-build-triggers.js +++ b/cloudbuild/listBuildTriggers.js @@ -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, @@ -15,6 +16,11 @@ 'use strict'; +// sample-metadata: +// title: List Triggers. +// description: List available build triggers. +// usage: node list-build-triggers.js + // [START cloudbuild_list_build_triggers] async function listBuildTriggers( projectId = 'YOUR_PROJECT_ID' // Your Google Cloud Platform project ID diff --git a/cloudbuild/system-test/samples.js b/cloudbuild/system-test/samples.js index ff1f4ea9f2..c5f7d7e2c6 100644 --- a/cloudbuild/system-test/samples.js +++ b/cloudbuild/system-test/samples.js @@ -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, @@ -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');