Gerenciar repositórios de amostra personalizados no Cloud Code for IntelliJ
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Um repositório de amostra é um repositório Git que contém amostras personalizadas criadas para o desenvolvimento de aplicativos.
Isso significa que, em uma organização ou equipe, é possível configurar repositórios
de amostra com o Cloud Code, personalizado para sua organização, para oferecer um
conjunto padrão de aplicativos, serviços e configurações de infraestrutura iniciais
que outras pessoas pode usar. Isso ajuda a alinhar novos projetos à pilha técnica e aos padrões preferidos da sua organização, além de incentivar as práticas recomendadas no início do ciclo de desenvolvimento.
Um repositório de amostra pode ser um repositório existente de aplicativos de amostra
que você já criou ou um novo conjunto de amostras que você gostaria que outras pessoas usassem.
Para importar um repositório com o Cloud Code, adicione um
arquivo de descritor de amostra ao repositório.
Quando eles estiverem prontos, os repositórios de amostra serão fáceis de compartilhar com sua equipe. o usuário precisará
configurar o Cloud Code e o URL do Git do repositório de amostra
que será usado. Para repositórios Git particulares, somente membros que tenham acesso ao repositório podem usar as amostras personalizadas subjacentes.
Para ver um exemplo de como um repositório de amostra pode ser configurado, consulte
este repositório (em inglês).
Antes de começar
Verifique se a versão 2.25.0 ou mais recente do Git está instalada na sua máquina local.
Como criar um repositório de amostra
Para usar um repositório atual, pule para
criar um arquivo de descritor de amostra. Para criar um novo
repositório para usar como um repositório de amostra, siga estas etapas:
Crie um repositório Git.
O repositório Git pode ser hospedado remotamente ou ativo na máquina local. Neste exemplo, é usado um novo repositório do GitHub, "custom-sample-repo".
Adicione diretórios de amostra ao repositório.
Os diretórios de exemplo podem conter qualquer coisa e estar localizados em qualquer lugar no repositório. Neste exemplo, dois diretórios de amostra, "hello-world" e "kubernetes-custom-sample", foram adicionados a "custom-sample-repo".
É altamente recomendável usar um arquivo readme com instruções sobre como usar melhor as amostras personalizadas.
Na tabela Repositórios de amostra personalizados, selecione o URL do repositório que você quer remover e clique em - Remover.
Na caixa de diálogo de confirmação, clique em Remover para excluir o
repositório selecionado do Cloud Code.
Receber suporte
Para enviar um feedback ou informar um problema no ambiente de desenvolvimento integrado do IntelliJ, acesse
Tools > Cloud Code > Help / About > Envie
feedback ou informe um problema para informar um problema no GitHub.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-05 UTC."],[[["\u003cp\u003eA sample repository in Cloud Code contains custom samples for teams to use in developing applications, promoting standardized starter configurations.\u003c/p\u003e\n"],["\u003cp\u003eSample repositories can be existing or newly created Git repositories, requiring a \u003ccode\u003e.cctemplate\u003c/code\u003e descriptor file in the root directory for Cloud Code to recognize them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e.cctemplate\u003c/code\u003e file defines metadata and an array of samples, each with details like path, name, and an optional description, enabling Cloud Code to understand and use each custom template.\u003c/p\u003e\n"],["\u003cp\u003eTo share sample repositories, users need Cloud Code and the repository's Git URL, and access to private repositories is limited to authorized members only.\u003c/p\u003e\n"],["\u003cp\u003eCustom sample repositories can be removed from Cloud Code either by manually deleting them or by navigating through the \u003cstrong\u003ePreferences\u003c/strong\u003e to remove the desired repository.\u003c/p\u003e\n"]]],[],null,["# Manage custom sample repositories in Cloud Code for IntelliJ\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\nBefore you begin\n----------------\n\nMake sure that Git version 2.25.0 or later is installed on your local\nmachine.\n\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/intellij/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.\n\nDeleting a custom sample repository\n-----------------------------------\n\nTo delete a custom sample repository from Cloud Code:\n\n1. Navigate to **Preferences** \\\u003e **Tools** \\\u003e **Cloud Code** \\\u003e\n **Custom Samples**.\n\n2. In the **Custom Sample Repositories** table, select the repository URL that\n you want to remove and click **- Remove**.\n\n3. In the confirmation dialog that appears, click **Remove** to delete the\n selected repository from Cloud Code.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]