Creating a new application from a custom template

Once you've set up your template repository (or one has been set up for you), you can start creating applications with these templates.

Alternatively, you can import the Cloud Code sample repository if you'd just like to try out the custom template experience. To better understand how custom template repositories are set up, it is recommended that you try forking the repository and modifying its structure and content before importing it. You can do this by creating new templates within the repository or modifying the source code to create your own versions of the Hello World or Kubernetes Custom Template apps.

Creating your app from an imported template

To create a new application using one of the templates from your template repository, follow these steps:

  1. Copy the Git URL of the template repository that you'd like to use.

  2. Navigate to the Custom Templates settings page with File > Settings > Tools > Cloud Code > Custom Templates or for Mac OS X, IntelliJ IDEA > Preferences > Tools > Cloud Code > Custom Templates.

    Custom application template repositories page with table with columns, Repository URL and Branch

  3. Click the Add symbol, +, to open the Repository for Custom Application Templates dialog.

  4. Enter the Git URL you copied earlier in the Repo URL field and click Next.

    The URL in this example is of the HTTPS GitHub format: https://github.com/username/repo-name.git.

    Git URL filled with HTTPS format URL: https://github.com/GoogleCloudPlatform/cloud-code-samples.git

  5. Click Add to authorize your use of the repo in your IDE, if necessary, and to add the template repository to your IDE.

  6. If your repository addition is successful, you should see a green check mark in the Status column of your table of template repositories. The branch field is automatically populated with the repository's default branch. To edit the branch, select the project and click the table's edit button.

    If a warning icon is displayed in the Status column, hover over the icon to get more information about why your repository is not valid. You can then update your repository accordingly and check the repository's status in your IDE by clicking the table's refresh button.

    Custom application template repositories page with newly added Repository listed in the table with a green checkmark next to it to indicate successful addition

  7. Create a new project by navigating to File > Open > New Project.

  8. Select Cloud Code: Custom as the type of project you'd like to create and choose a template from the list of available custom templates. Click Next to proceed.

    List of custom templates available when creating a new Cloud Code app

  9. Pick a name and project location for your new app.

    Once you click Finish, Cloud Code creates your app using your chosen template and opens it for use.

Getting support

To send feedback, report an issue on GitHub or ask a question on Stack Overflow.