https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example
Example of configuring a Custom Samples repository for Cloud Code
https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example
Last synced: 5 months ago
JSON representation
Example of configuring a Custom Samples repository for Cloud Code
- Host: GitHub
- URL: https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example
- Owner: GoogleCloudPlatform
- License: other
- Created: 2021-02-01T22:48:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T02:23:43.000Z (7 months ago)
- Last Synced: 2024-10-29T18:37:31.538Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.5 MB
- Stars: 35
- Watchers: 22
- Forks: 38
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE
- Code of conduct: docs/code-of-conduct.md
- Security: SECURITY.md
Awesome Lists containing this project
- jimsghstars - GoogleCloudPlatform/cloud-code-custom-samples-example - Example of configuring a Custom Samples repository for Cloud Code (JavaScript)
README
# Example Custom Sample Repository
This repository is an example [Custom Sample Repository](https://cloud.google.com/code/docs/vscode/set-up-template-repo?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-) that can be used with the Cloud Code plugins for [VSCode](https://cloud.google.com/code/docs/vscode/quickstart?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-) and [IntelliJ](https://cloud.google.com/code/docs/intellij/quickstart?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-).
*Apache Log4j Vulnerability (Log4j 2):* this repository previously included a sample using a vulnerable version of Log4j 2. The sample was removed on December 15, 2021. We strongly advise customers to update their samples repositories. Visit the [security advisory](https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example/security/advisories/GHSA-h9xv-vc3v-gvw9) for details and remediation.
---
## UsageTo see an example of how the Custom Sample feature of Cloud Code works, you can configure your IDE to recognize this repository and create applications based on the sample within. Follow the steps below to see this feature in action!
1. Install Cloud Code for [IntelliJ](https://cloud.google.com/code/docs/intellij/install?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-) or [VS Code](https://cloud.google.com/code/docs/vscode/install?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-)
2. Import the Custom Sample repo on [IntelliJ](https://cloud.google.com/code/docs/intellij/create-app-from-custom-template?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-) or [VS Code](https://cloud.google.com/code/docs/vscode/create-app-from-custom-template?utm_source=ext&utm_medium=partner&utm_campaign=CDR_kri_gcp_cloudcodereadmes_012521&utm_content=-), using this repo's Git URL: `https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example.git`
You can create your own Custom Sample repo using this repository as a base.
1. Clone this repository
2. Create a new directory containing your own sample (or make changes to any of the samples)
3. Make any necessary updates to the samples in the `.cctemplate` file
4. Import your local, updated repository into Cloud Code
---
## Contents### .cctemplate
The `.cctemplate` is a [Sample Descriptor](https://cloud.google.com/code/docs/intellij/set-up-template-repo#template_descriptor_schema) file that describes the contents of your repository so that Cloud Code knows where to look for your samples. It should look something like the following:```
{
"metadata": {
"version": "1"
},
"templates": [
{
"path": "path/to/my/sample",
"name": "My Sample",
"description": "This sample helps you create something amazing!"
},
...
]
}
```There is an example `.cctemplate` file in this repository that you can review, and you can learn more about the Sample Descriptor schema [here](https://cloud.google.com/code/docs/vscode/set-up-template-repo#template_descriptor_schema).
### hello-world
A simple sample written in Go. You can see an entry for this sample in the `.cctemplate` file.
### file-sync-example
An example application demonstrating skaffold's [file sync](https://skaffold.dev/docs/pipeline-stages/filesync/), which is used by Cloud Code under the hood. Changes to a file are copied to the container without needing to rebuild or restart the corresponding pod. The original version of this sample is located in the [skaffold examples repo](https://github.com/GoogleContainerTools/skaffold/examples/hot-reload).
### kubernetes-custom-sample/nodejs
A Node.js sample with a frontend and backend service. This sample uses MongoDB as a database and runs on Kubernetes. You can see an entry for this sample in the `.cctemplate` file.
---
## Sign up for user research
We want to hear your feedback!
The Cloud Code team is inviting our user community to sign-up to participate in Google User Experience Research.
If you’re invited to join a study, you may try out a new product or tell us what you think about the products you use every day. At this time, Google is only sending invitations for upcoming remote studies. Once a study is complete, you’ll receive a token of thanks for your participation such as a gift card or some Google swag.
[Sign up using this link](https://google.qualtrics.com/jfe/form/SV_4Me7SiMewdvVYhL?reserved=1&utm_source=In-product&Q_Language=en&utm_medium=own_prd&utm_campaign=Q1&productTag=clou&campaignDate=January2021&referral_code=UXbT481079) and answer a few questions about yourself, as this will help our research team match you to studies that are a great fit.
---
## ContributingContributions welcome! Be sure to read our [contributing guide](./docs/contributing.md) and [Code of Conduct](./docs/code-of-conduct.md).