Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate code from googleapis/nodejs-cloudbuild #2823

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2c0c0a4
feat: initial release of cloud build library (#2)
bcoe Oct 17, 2019
eecc8b0
feat(docs): add listBuildTriggers sample to README (#5)
bcoe Oct 17, 2019
d815de8
feat: moves library to TypeScript code generation (#10)
bcoe Oct 31, 2019
e965568
chore: release 1.0.0 (#3)
release-please[bot] Oct 31, 2019
7717811
chore: release 1.1.0 (#20)
release-please[bot] Nov 11, 2019
18e0777
chore: update license headers
JustinBeckwith Nov 25, 2019
8326e39
chore: release 1.2.0 (#25)
release-please[bot] Dec 5, 2019
f1ff5f5
chore: release 1.3.0 (#33)
release-please[bot] Dec 11, 2019
90f8fbc
chore(deps): update dependency c8 to v7 (#38)
renovate-bot Dec 28, 2019
1368f5c
chore: update license headers
yoshi-automation Dec 29, 2019
d5eb8bf
refactor: use explicit mocha imports (#40)
JustinBeckwith Dec 30, 2019
34cef7b
chore(deps): update dependency mocha to v7 (#43)
renovate-bot Jan 6, 2020
886da97
chore: release 1.3.1
release-please[bot] Jan 6, 2020
03c0d9e
chore: release 1.3.2 (#49)
release-please[bot] Jan 30, 2020
50b81b2
chore: release 1.3.3 (#59)
release-please[bot] Feb 10, 2020
a13f887
chore: release 1.4.0 (#63)
release-please[bot] Feb 13, 2020
4c3c2bb
chore: release 1.5.0 (#67)
release-please[bot] Mar 9, 2020
3ee0b6c
chore(deps): update dependency mocha to v8 (#122)
renovate-bot Jun 11, 2020
74f818f
chore: release 2.0.0 (#92)
release-please[bot] Jun 16, 2020
9d104f4
chore: release 2.0.1 (#126)
release-please[bot] Jul 7, 2020
4114a78
chore: release 2.0.2 (#133)
release-please[bot] Jul 10, 2020
e56d9e7
chore: release 2.0.3 (#143)
release-please[bot] Jul 28, 2020
0de5a44
chore: release 2.0.4 (#179)
release-please[bot] Nov 3, 2020
b6f9b8d
chore: release 2.0.5 (#182)
release-please[bot] Nov 16, 2020
a94e96d
chore: release 2.0.6 (#186)
release-please[bot] Dec 2, 2020
5ee913c
chore: release 2.1.0 (#205)
release-please[bot] Apr 3, 2021
152f05a
chore: release 2.2.0 (#213)
release-please[bot] Apr 16, 2021
81f3fb2
chore: release 2.2.1 (#220)
release-please[bot] May 8, 2021
952249f
chore: release 2.2.2 (#227)
release-please[bot] May 13, 2021
cf116b0
chore: release 2.2.3 (#232)
release-please[bot] May 27, 2021
e26114c
chore: release 2.2.4 (#242)
release-please[bot] Jun 24, 2021
b6bd498
chore: release 2.2.5 (#247)
release-please[bot] Jul 1, 2021
2a74820
chore: release 2.2.6 (#250)
release-please[bot] Jul 15, 2021
091142f
chore: release 2.2.7 (#252)
release-please[bot] Jul 21, 2021
64ff8bd
chore: release 2.3.0 (#263)
release-please[bot] Aug 5, 2021
d2b1be5
fix(build): migrate to using main branch (#265)
sofisl Aug 12, 2021
1043c50
chore: release 2.3.1 (#266)
release-please[bot] Aug 12, 2021
53e64e7
chore: release 2.3.2 (#269)
release-please[bot] Aug 16, 2021
1431851
chore: release 2.4.0 (#270)
release-please[bot] Aug 16, 2021
2239c2f
chore: release 2.5.0 (#272)
release-please[bot] Aug 23, 2021
b0301ab
chore: release 2.6.0 (#275)
release-please[bot] Aug 25, 2021
315dd21
docs(samples): add example tags to generated samples (#287)
gcf-owl-bot[bot] Nov 10, 2021
7d91832
chore: update v2.12.0 gapic-generator-typescript (#301)
gcf-owl-bot[bot] Jan 26, 2022
aadaf7b
docs(samples): include metadata file, add exclusions for samples to h…
gcf-owl-bot[bot] Feb 18, 2022
b70f803
chore(quickstart): mention private pool caveats (#317)
Apr 15, 2022
a4900dd
build(node): update client library version in samples metadata (#1356…
gcf-owl-bot[bot] Apr 21, 2022
45e581b
build!: update library to use Node 12 (#325)
alexander-fenster May 17, 2022
9fb8396
chore(main): release 3.0.0 (#326)
release-please[bot] May 17, 2022
fec7005
chore(main): release 3.0.1 (#328)
release-please[bot] Jun 30, 2022
bf5eb99
chore(main): release 3.1.0 (#334)
release-please[bot] Jul 4, 2022
3f30e76
fix: better support for fallback mode (#337)
gcf-owl-bot[bot] Aug 23, 2022
f7bc014
chore(main): release 3.1.1 (#340)
release-please[bot] Sep 8, 2022
27c26f1
chore(main): release 3.1.2 (#345)
release-please[bot] Sep 22, 2022
9b5b7a5
Merge remote-tracking branch 'migration/main' into nodejs-cloudbuild-…
grayside Nov 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions generated,README.md,.eslintrc.yml/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
rules:
no-console: off
node/no-missing-require: off
node/no-extraneous-require: off
70 changes: 70 additions & 0 deletions generated,README.md,.eslintrc.yml/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Cloud Build: Node.js Samples](https://github.com/googleapis/nodejs-cloudbuild)

[![Open in Cloud Shell][shell_img]][shell_link]



## Table of Contents

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

## Before you begin

Before running the samples, make sure you've followed the steps outlined in
[Using the client library](https://github.com/googleapis/nodejs-cloudbuild#using-the-client-library).

`cd samples`

`npm install`

`cd ..`

## Samples



### List Triggers.

List available build triggers.

View the [source code](https://github.com/googleapis/nodejs-cloudbuild/blob/main/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/main/samples/quickstart.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/quickstart.js,samples/README.md)

__Usage:__


`node samples/quickstart.js`






[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-cloudbuild&page=editor&open_in_editor=samples/README.md
[product-docs]: https://cloud.google.com/cloud-build/docs/
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2022 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
//
// https://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,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(name) {
// [START cloudbuild_v1_generated_CloudBuild_ApproveBuild_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the target build.
* For example: "projects/{$project_id}/builds/{$build_id}"
*/
// const name = 'abc123'
/**
* Approval decision and metadata.
*/
// const approvalResult = {}

// Imports the Cloudbuild library
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1;

// Instantiates a client
const cloudbuildClient = new CloudBuildClient();

async function callApproveBuild() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await cloudbuildClient.approveBuild(request);
const [response] = await operation.promise();
console.log(response);
}

callApproveBuild();
// [END cloudbuild_v1_generated_CloudBuild_ApproveBuild_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2022 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
//
// https://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,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(projectId, id) {
// [START cloudbuild_v1_generated_CloudBuild_CancelBuild_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The name of the `Build` to cancel.
* Format: `projects/{project}/locations/{location}/builds/{build}`
*/
// const name = 'abc123'
/**
* Required. ID of the project.
*/
// const projectId = 'abc123'
/**
* Required. ID of the build.
*/
// const id = 'abc123'

// Imports the Cloudbuild library
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1;

// Instantiates a client
const cloudbuildClient = new CloudBuildClient();

async function callCancelBuild() {
// Construct request
const request = {
projectId,
id,
};

// Run request
const response = await cloudbuildClient.cancelBuild(request);
console.log(response);
}

callCancelBuild();
// [END cloudbuild_v1_generated_CloudBuild_CancelBuild_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright 2022 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
//
// https://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,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(projectId, build) {
// [START cloudbuild_v1_generated_CloudBuild_CreateBuild_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The parent resource where this build will be created.
* Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. ID of the project.
*/
// const projectId = 'abc123'
/**
* Required. Build resource to create.
*/
// const build = {}

// Imports the Cloudbuild library
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1;

// Instantiates a client
const cloudbuildClient = new CloudBuildClient();

async function callCreateBuild() {
// Construct request
const request = {
projectId,
build,
};

// Run request
const [operation] = await cloudbuildClient.createBuild(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateBuild();
// [END cloudbuild_v1_generated_CloudBuild_CreateBuild_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2022 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
//
// https://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,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(projectId, trigger) {
// [START cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The parent resource where this trigger will be created.
* Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. ID of the project for which to configure automatic builds.
*/
// const projectId = 'abc123'
/**
* Required. `BuildTrigger` to create.
*/
// const trigger = {}

// Imports the Cloudbuild library
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1;

// Instantiates a client
const cloudbuildClient = new CloudBuildClient();

async function callCreateBuildTrigger() {
// Construct request
const request = {
projectId,
trigger,
};

// Run request
const response = await cloudbuildClient.createBuildTrigger(request);
console.log(response);
}

callCreateBuildTrigger();
// [END cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading