Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

MatteoGioioso/google-cloud-build-trigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Client for triggering Cloud build

//Path to your service account file
const config = { keyFilename: "./path/to/service-account.json" };
const builder = require("./index")(config);

//You can get the triggerId by navigating to cloud build from the google cloud platform console
//click on the triggers list and click on the trigger that you want to run,
//the url of the page should look something like that:
//https://console.cloud.google.com/cloud-build/triggers/<trigger_id>?project=<project_id>
//You can grab the triggerId from there
const options = {
  requestBody: { branchName: "master" },
  triggerId: "your-trigger-id"
};

builder.runTrigger(options, function(err, resp) {
  if (err) {
    console.log(err)
  }

  console.log(resp)
});

About

Simple library for triggering cloud build on google cloud platform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published