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.
To follow step-by-step guidance for this task directly in the Cloud Shell Editor, click Guide me:
Creating your app from an imported sample
To create a new application using a sample from your sample repository:
Copy the Git URL of the sample repository that you'd like to use. If you're using a Git repository hosted live on your local machine, the
.git
suffix is omitted and the URL is of the form/path/to/repo
.In the Cloud Code status bar, click the active project name.
In the Quick Pick menu that appears, select New Application.
When you're prompted for the type of sample to use, select Custom application.
Click Import Sample from Repo.
When you're prompted for the URL, enter the Git URL you copied earlier.
The URL in this example uses the HTTPS GitHub format:
https://github.com/username/repo-name.git
.Troubleshooting tip: If you're having trouble with Git authentication, check to see that your Cloud Shell Git login is set up properly. See Using version control with Cloud Shell Editor for details.
To use the latest version of your samples in Cloud Code, click refresh Refresh Templates.
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 undercloudcode.customApplications
. - Click Custom Application.
- Click refresh Refresh.
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.
- Edit the branch in use or the repository URL in your
From the updated list of samples, select your custom sample.
Enter your project name and location.
Click Create New Application.
Cloud Code creates your app using your chosen sample and opens your app for use.