샘플 저장소는 개발자가 애플리케이션을 개발할 때 사용할 수 있도록 생성한 커스텀 샘플이 포함된 Git 저장소입니다.
즉, 조직 또는 팀 내에서 조직에 맞게 Cloud Code로 샘플 저장소를 설정하여 다른 사람이 사용할 수 있는 시작 애플리케이션, 서비스, 인프라 구성을 제공할 수 있습니다. 이렇게 하면 새로운 프로젝트를 조직이 선호하는 기술 스택 및 표준에 맞추는 데 도움이 되며 개발 주기 초기에 권장사항을 장려할 수 있습니다.
샘플 저장소는 이전에 만든 샘플 애플리케이션의 기존 저장소이거나 다른 사람이 사용할 수 있는 새로운 샘플 세트일 수 있습니다.
Cloud Code를 사용하여 저장소를 가져오려면 저장소에 샘플 설명자 파일을 추가하세요.
준비가 되면 샘플 저장소를 팀과 간편하게 공유할 수 있습니다. Cloud Code를 설정하고 사용할 샘플 저장소의 Git URL이 있어야 합니다. 비공개 Git 저장소의 경우 저장소에 대한 액세스 권한이 있는 구성원만 기본 커스텀 샘플을 사용할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eSample repositories are Git repositories containing custom samples that teams can use to develop applications, aligning new projects with an organization's technical standards.\u003c/p\u003e\n"],["\u003cp\u003eThese repositories can be existing collections of sample applications or new sets of samples, which are imported into Cloud Code by adding a \u003ccode\u003e.cctemplate\u003c/code\u003e sample descriptor file to the root directory of the repository.\u003c/p\u003e\n"],["\u003cp\u003eTo create a new sample repository, one must create a Git repository, add sample directories, and then create the sample descriptor file, and there is a specific schema that this file must adhere to.\u003c/p\u003e\n"],["\u003cp\u003eSharing sample repositories with a team requires them to have Cloud Code set up and access to the Git URL, with private repositories restricted to members who have been granted permissions.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a custom sample repository involves removing the template folder at the \u003ccode\u003elocalPath\u003c/code\u003e location, which can be found in the \u003ccode\u003esettings.json\u003c/code\u003e file, as well as deleting the corresponding entry in that same file.\u003c/p\u003e\n"]]],[],null,["# Manage custom sample repositories in Cloud Code for Cloud Shell\n\nA sample repository is a Git repository that contains custom samples you\ncreate that your team can use to develop applications.\n\nThis means that, within an organization or team, you can set up sample\nrepositories with Cloud Code, custom to your organization, to offer a\nstandard set of starter applications, services, and infrastructure configuration\nthat others can use. This helps align new projects with your organization's\npreferred technical stack and standards, and encourages best practices at the\nbeginning of the development cycle.\n\nA sample repository can be an existing repository of sample applications\nyou've already created or a new set of samples you'd like others to use.\nTo import a repository with Cloud Code, you add a\n[sample descriptor file](#sample_descriptor_schema) to the repository.\n\nWhen ready, sample repositories are easy to share with your team; they'll\nneed Cloud Code set up and the Git URL of the sample repository\nto use. For private Git repositories, only members that have access to the\nrepository can use the underlying custom samples.\n\nTo see an example of how a sample repository might be set up, reference this\n[repository](https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example/).\n\nCreating a sample repository\n----------------------------\n\nTo use an existing repository, skip to\n[creating a sample descriptor file](#sample_descriptor). To create a new\nrepository to use as a sample repository, follow these steps:\n\n1. Create a new Git repository.\n\n Your Git repository can be hosted remotely or live on your local\n machine. This example uses a new GitHub repository, 'custom-sample-repo'.\n\n2. Add sample directories to the repository.\n\n Your sample directories can contain anything and be located anywhere you\n want in the repository. In this example, two sample directories,\n 'hello-world' and 'kubernetes-custom-sample', have been added\n to 'custom-sample-repo'.\n\n A readme file with instructions on how best to use your custom samples\n is highly recommended.\n\n\n3. Create a sample descriptor file.\n\n A sample descriptor file provides Cloud Code with information\n on your sample to properly create your application. This file must be named\n `.cctemplate`, must be located in your root directory, and must have the\n schema defined in the\n [sample descriptor file schema](#sample_descriptor_schema) section.\n4. Test your custom sample by following the steps to\n [create an app from a custom sample](/code/docs/shell/create-app-from-custom-sample).\n\nSample descriptor schema\n------------------------\n\n#### Example\n\n {\n \"metadata\":{\n \"version\":\"1\"\n },\n \"name\": \"My Sample Repository\",\n \"templates\":[\n {\n \"path\":\"/path/to/sample1_location\",\n \"name\":\"My Sample 1\",\n \"description\":\"The first sample of its name.\"\n },\n {\n \"path\":\"/path/to/sample2_location\",\n \"name\":\"My Sample 2\",\n \"description\":\"The sequel.\"\n }\n ]\n }\n\n### Sample schema\n\n#### Example\n\n {\n \"path\":\"path/to/sample1\",\n \"name\":\"My Sample 1\",\n \"description\":\"The first sample of its name.\"\n }\n\n### Metadata schema\n\n#### Example\n\n {\n \"version\":\"1\"\n }\n\nDeleting a custom sample repository\n-----------------------------------\n\nTo delete a custom sample, which removes it from the custom application\nselector flow and from users' machines:\n\n1. In the `settings.json` file, look up the `localPath` for the custom sample\n entry.\n\n \"cloudcode.customApplications\": [\n {\n \"repoUrl\": https://github.com/GoogleCloudPlatform/cloud-code-custom-samples-example.git,\n \"branchName\": \"\",\n \"localPath\": \"/Users/username/Library/cloud-code/custom-templates/https-github-com-google-cloud-platform-cloud-code-custom-samples-example-git\"\n }\n ],\n\n2. Delete the template folder at the path.\n\n | **Note:** On Macs, `Library` is a hidden folder.\n3. Delete the custom sample section from the `settings.json` file."]]