@curiostack/cloudbuild-github
Integration between Google Container Builder and GitHub.
Last updated 5 months ago by chokoswitch .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @curiostack/cloudbuild-github 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.0.23                                ...           latest (5 months ago)

28 Versions

  • 0.0.23                                ...           5 months ago
  • 0.0.22                                ...           5 months ago
  • 0.0.21                                ...           5 months ago
  • 0.0.20                                ...           5 months ago
  • 0.0.19                                ...           5 months ago
  • 0.0.19-alpha.1                                ...           5 months ago
  • 0.0.18                                ...           5 months ago
  • 0.0.17-alpha.5                                ...           5 months ago
  • 0.0.17-alpha.4                                ...           5 months ago
  • 0.0.17-alpha.3                                ...           5 months ago
  • 0.0.17-alpha.2                                ...           5 months ago
  • 0.0.17-alpha.1                                ...           5 months ago
  • 0.0.16                                ...           2 years ago
  • 0.0.15                                ...           2 years ago
  • 0.0.14                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 28
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |