83

GitHub - GoogleCloudPlatform/cloud-run-button: Let anyone deploy your GitHub rep...

 5 years ago
source link: https://github.com/GoogleCloudPlatform/cloud-run-button
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

Cloud Run Button

If you have a public repository, you can add this button to your README.md and let anyone deploy your application to Google Cloud Run with a single click.

Try it out with a "hello, world" Go application (source):

Run on Google Cloud

Demo

Cloud Run Button Demo

Add the Cloud Run Button to Your Repo's README

  1. Copy & paste this markdown:

    [![Run on Google Cloud](https://storage.googleapis.com/cloudrun/button.svg)](https://console.cloud.google.com/cloudshell/editor?shellonly=true&cloudshell_image=gcr.io/cloudrun/button&cloudshell_git_repo=YOUR_HTTP_GIT_URL)
    
  2. Replace YOUR_HTTP_GIT_URL with your HTTP git URL, like:
    https://github.com/GoogleCloudPlatform/cloud-run-hello.git

  3. If the repo contains a Dockerfile it will be built using the docker build command. Otherwise, the CNCF Buildpacks will be used to build the repo.

Customizing source repository parameters

  • To use a different git branch, add a cloudshell_git_branch=BRANCH_NAME query parameter.
  • To run the build in a subdirectory of the repo, add a cloudshell_working_dir=SUBDIR query parameter.

Customizing deployment parameters

If you include an app.json at the root of your repository, it allows you customize the experience such as defining an alternative service name, or prompting for additional environment variables.

For example:

{
  "name": "foo-app",
  "env": {
      "BACKGROUND_COLOR": {
          "description": "specify a css color",
          "value": "#fefefe",
          "required": false
      },
      "TITLE": {
          "description": "title for your site"
      }
  }
}

Reference:

  • name: (optional, default: repo name, or sub-directory name if specified) Name of the Cloud Run service and the built container image. Not validated for naming restrictions.
  • env: (optional) Prompt user for environment variables.
    • description: (optional) short explanation of what the environment variable does, keep this short to make sure it fits into a line.
    • value: (optional) default value for the variable, should be a string.
    • required, (optional, default: true) indicaes if they user must provide a value for this variable.

Notes

  • Disclaimer: This is not an officially supported Google product.
  • See LICENSE for the licensing information.
  • See Contribution Guidelines on how to contribute.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK