Creating a new application from a custom sample

A sample repository is a Git repository that contains custom samples you can use to develop applications. After you've set up your sample repository, you can start creating applications with these samples.

Alternatively, you can import the Cloud Code custom sample sample repository to try custom samples. To better understand how custom sample repositories are set up, it is recommended that you try cloning the repository and modifying its structure and content before importing it. You can do this by creating new samples in the repository or modifying the source code to create your own versions of the Hello World or Guestbook apps.

For step-by-step guidance on this task directly in Cloud Shell Editor, click Guide me:

Guide me

The following sections take you through the same steps as clicking Guide me.

Creating your app from an imported sample

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

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

  2. From the Cloud Code status bar menu, select New Application.

  3. When you're prompted for the type of sample to use, select the Custom Application option.

    Custom application option available when prompted for type of sample you'd like to use

  4. Select Import Sample from Repo.

    Import sample from repo option available when prompted for a sample to use

  5. When you're prompted for the URL, enter the Git URL you copied earlier.

    The URL in this example is of the HTTPS GitHub format:

    Git URL field filled with HTTPS format URL of

    Troubleshooting tip: If you're having trouble with Git authentication, check to see that your Cloud Shell git login is set up properly. See the Using version control with Cloud Shell Editor guide for details.

  6. To use the latest version of your samples in Cloud Code, click Refresh Templates.

    Refresh templates button icon

  7. Check the terminal window in your IDE to confirm that your repository has been cloned successfully.

    The repository's default branch is automatically used. To use another branch, edit the branch in use or the repository URL in your settings.json file, under cloudcode.customApplications, and then click the refresh button in the upper right corner after selecting the Custom Application option.

    If your repository wasn't cloned successfully, you can use the Manage Repositories option to update your sample repository details with a valid Git URL and/or branch.

  8. From the updated list of samples, select your custom sample.

  9. Fill in your project name and location in the dialog and then click Create New Application.

    Cloud Code creates your app using your chosen sample and opens your app for use.