npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@curiostack/cloudbuild-github

v0.0.23

Published

Integration between Google Container Builder and GitHub.

Downloads

52

Readme

cloudbuild-github

cloudbuild-github allows integrating Google Container Builder (Cloudbuild) and GitHub. It sets up a webhook and status / comment notifications using Google Cloud Functions.

Setup

Curiostack users

Create a new project with the org.curioswitch.gradle-curio-cloudbuild-github-plugin applied and run the :deploy task, e.g.,

$ ./gradlew :tools:cloudbuild-github-functions:deploy

Normal usage

The gcloud must be present on the path (see https://cloud.google.com/sdk/downloads) for how to install. In addition, the GCLOUD_PROJECT environment variable may need to be set to your GCP project ID.

Start by creating a new project with a dependency on the library.

$ yarn init # main: index.tsx, private: true
$ yarn add @curiostack/cloudbuild-github
$ yarn

This will download the library, including a CLI to help setup. To create the configured cloud function and deploy it, run

$ yarn run cloudbuild-cli setup
$ # Customize config.yml (e.g., replacing build step)
$ yarn run cloudbuild-cli deploy

This will prompt you for information about your repository, including an access token for working with your GitHub repository (see details about tokens here). It will then write out an index.tsx and config.yml file that will be used by the webhook, deploy the cloud functions, and set up the repository webhook. That's it.

If you update the configuration, just run deploy again.

$ yarn run cloudbuild-cli deploy

If you have trouble getting redeployed functions to update, add the --delete option when deploying. This will delete the function before deploying, so there will be some downtime. Hopefully as cloud functions matures, redeploys will work reliably and this option will go away.

$ yarn run cloudbuild-cli deploy --delete

Details

This package includes two cloud functions, a GitHub webhook and a pubsub subscriber to cloudbuild events. In response to an incoming webhook request, the first function will use the cloudbuild REST API to start a new build, which is configured to fetch the source from GitHub and then run a build command. The subscriber function is notified of all build events, and appropriately sets the GitHub status and comments on success or failure for change.

The webhook only supports pull requests, it does not implement support for repository push events. It is trivial to set up a triggered cloudbuild within GCP itself and is recommended to do so. The subscriber will properly run on events for triggered builds too.