{"id":13638018,"url":"https://github.com/GoogleCloudPlatform/cloud-run-button","last_synced_at":"2025-04-19T17:32:29.425Z","repository":{"id":35448269,"uuid":"186705695","full_name":"GoogleCloudPlatform/cloud-run-button","owner":"GoogleCloudPlatform","description":"Let anyone deploy your GitHub repos to Google Cloud Run with a single click","archived":false,"fork":false,"pushed_at":"2024-10-29T02:08:17.000Z","size":741,"stargazers_count":527,"open_issues_count":46,"forks_count":92,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-29T18:37:31.915Z","etag":null,"topics":["google-cloud-run"],"latest_commit_sha":null,"homepage":"https://cloud.run","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleCloudPlatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-14T21:51:15.000Z","updated_at":"2024-10-29T02:08:21.000Z","dependencies_parsed_at":"2024-03-13T02:40:20.382Z","dependency_job_id":"c753c3a4-c97a-4547-b168-c613ffe23488","html_url":"https://github.com/GoogleCloudPlatform/cloud-run-button","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fcloud-run-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fcloud-run-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fcloud-run-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fcloud-run-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleCloudPlatform","download_url":"https://codeload.github.com/GoogleCloudPlatform/cloud-run-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223805027,"owners_count":17205839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-cloud-run"],"created_at":"2024-08-02T01:00:38.576Z","updated_at":"2024-11-09T08:30:33.882Z","avatar_url":"https://github.com/GoogleCloudPlatform.png","language":"Go","funding_links":[],"categories":["Tools","Go"],"sub_categories":["Container guides"],"readme":"# Cloud Run Button\n\nIf you have a public repository, you can add this button to your `README.md` and\nlet anyone deploy your application to [Google Cloud Run][run] with a single\nclick.\n\n[run]: https://cloud.google.com/run\n\nTry it out with a \"hello, world\" Go application ([source](https://github.com/GoogleCloudPlatform/cloud-run-hello)):\n\n[![Run on Google\nCloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run/?git_repo=https://github.com/GoogleCloudPlatform/cloud-run-hello.git)\n\n### Demo\n\n[![Cloud Run Button Demo](assets/cloud-run-button.png)](https://storage.googleapis.com/cloudrun/cloud-run-button.gif)\n\n### Add the Cloud Run Button to Your Repo's README\n\n1. Copy \u0026 paste this markdown:\n\n    ```text\n    [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run)\n    ```\n\n1. If the repo contains a `Dockerfile`, it will be built using the `docker build` command.  If the repo uses Maven for\n   the build and it contains the [Jib plugin](https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin),\n   then the container image will be built with Jib\n   ([Jib Spring Boot Sample](https://github.com/GoogleContainerTools/jib/tree/master/examples/spring-boot)).  Otherwise,\n   [CNCF Buildpacks](https://buildpacks.io/) (i.e. the `pack build` command) will attempt to build the repo\n   ([buildpack samples][buildpack-samples]).  Alternatively, you can skip these built-in build methods using the\n   `build.skip` field (see below) and use a `prebuild` or `postbuild` hook to build the container image yourself.\n\n[buildpack-samples]: https://github.com/GoogleCloudPlatform/buildpack-samples\n\n### Customizing source repository parameters\n\n- When no parameters are passed, the referer is used to detect the git repo and branch\n- To specify a git repo, add a `git_repo=URL` query parameter\n- To specify a git branch, add a `revision=BRANCH_NAME` query parameter.\n- To run the build in a subdirectory of the repo, add a `dir=SUBDIR` query parameter.\n\n\n### Customizing deployment parameters\n\nIf you include an `app.json` at the root of your repository, it allows you\ncustomize the experience such as defining an alternative service name, or\nprompting for additional environment variables.\n\nFor example, a fully populated `app.json` file looks like this:\n\n```json\n{\n    \"name\": \"foo-app\",\n    \"env\": {\n        \"BACKGROUND_COLOR\": {\n            \"description\": \"specify a css color\",\n            \"value\": \"#fefefe\",\n            \"required\": false\n        },\n        \"TITLE\": {\n            \"description\": \"title for your site\"\n        },\n        \"APP_SECRET\": {\n            \"generator\": \"secret\"\n        },\n        \"ORDERED_ENV\": {\n            \"description\": \"control the order env variables are prompted\",\n            \"order\": 100\n        }\n    },\n    \"options\": {\n        \"allow-unauthenticated\": false,\n        \"memory\": \"512Mi\",\n        \"cpu\": \"1\",\n        \"port\": 80,\n        \"http2\": false,\n        \"concurrency\": 80,\n        \"max-instances\": 10\n    },\n    \"build\": {\n        \"skip\": false,\n        \"buildpacks\": {\n            \"builder\": \"some/builderimage\"\n        }\n    },\n    \"hooks\": {\n        \"prebuild\": {\n            \"commands\": [\n                \"./my-custom-prebuild\"\n            ]\n        },\n        \"postbuild\": {\n            \"commands\": [\n                \"./my-custom-postbuild\"\n            ]\n        },\n        \"precreate\": {\n            \"commands\": [\n                \"echo 'test'\"\n            ]\n        },\n        \"postcreate\": {\n            \"commands\": [\n                \"./setup.sh\"\n            ]\n        }\n    }\n}\n```\n\nReference:\n\n- `name`: _(optional, default: repo name, or sub-directory name if specified)_\n  Name of the Cloud Run service and the built container image. Not validated for\n  naming restrictions.\n- `env`: _(optional)_ Prompt user for environment variables.\n  - `description`:  _(optional)_ short explanation of what the environment\n    variable does, keep this short to make sure it fits into a line.\n  - `value`: _(optional)_ default value for the variable, should be a string.\n  - `required`, _(optional, default: `true`)_ indicates if they user must provide\n    a value for this variable.\n  - `generator`, _(optional)_ use a generator for the value, currently only support `secret`\n  - `order`, _(optional)_ if specified, used to indicate the order in which the\n    variable is prompted to the user. If some variables specify this and some\n    don't, then the unspecified ones are prompted last.\n- `options`: _(optional)_ Options when deploying the service\n  - `allow-unauthenticated`: _(optional, default: `true`)_ allow unauthenticated requests\n  - `memory`: _(optional)_ memory for each instance\n  - `cpu`: _(optional)_ cpu for each instance\n  - `port`: _(optional)_ if your application doesn't respect the PORT environment\n    variable provided by Cloud Run, specify the port number it listens on\n  - `http2`: _(optional)_ use http2 for the connection\n  - `concurrency`: _(optional)_ concurrent requests for each instance\n  - `max-instances`: _(optional)_ autoscaling limit (max 1000)\n- `build`: _(optional)_ Build configuration\n  - `skip`: _(optional, default: `false`)_ skips the built-in build methods (`docker build`, `Maven Jib`, and\n `buildpacks`), but still allows for `prebuild` and `postbuild` hooks to be run in order to build the container image\n manually\n  - `buildpacks`: _(optional)_ buildpacks config (Note: Additional Buildpack config can be specified using a `project.toml` file. [See the spec for details](https://buildpacks.io/docs/reference/config/project-descriptor/).)\n    - `builder`: _(optional, default: `gcr.io/buildpacks/builder:v1`)_ overrides the buildpack builder image\n- `hooks`: _(optional)_ Run commands in separate bash shells with the environment variables configured for the\n  application and environment variables `GOOGLE_CLOUD_PROJECT` (Google Cloud project), `GOOGLE_CLOUD_REGION`\n  (selected Google Cloud Region), `K_SERVICE` (Cloud Run service name), `IMAGE_URL` (container image URL), `APP_DIR`\n  (application directory). Command outputs are shown as they are executed.\n  - `prebuild`: _(optional)_ Runs the specified commands before running the built-in build methods. Use the `IMAGE_URL`\n    environment variable to determine the container image name you need to build.\n    - `commands`: _(array of strings)_ The list of commands to run\n  - `postbuild`: _(optional)_ Runs the specified commands after running the built-in build methods. Use the `IMAGE_URL`\n    environment variable to determine the container image name you need to build.\n    - `commands`: _(array of strings)_ The list of commands to run\n  - `precreate`: _(optional)_ Runs the specified commands before the service has been created\n    - `commands`: _(array of strings)_ The list of commands to run\n  - `postcreate`: _(optional)_ Runs the specified commands after the service has been created; the `SERVICE_URL` environment variable provides the URL of the deployed Cloud Run service\n    - `commands`: _(array of strings)_ The list of commands to run\n\n### Notes\n\n- Disclaimer: This is not an officially supported Google product.\n- See [LICENSE](./LICENSE) for the licensing information.\n- See [Contribution Guidelines](./CONTRIBUTING.md) on how to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoogleCloudPlatform%2Fcloud-run-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGoogleCloudPlatform%2Fcloud-run-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoogleCloudPlatform%2Fcloud-run-button/lists"}