Skip to content

cgrant/cloudshell-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cloudshell-tutorial

Official Docs

Examples

Cloud Shell - w/ Editor - No console - (console.cloud.google.com/cloudshell/editor)

Open in Cloud Shell w Editor

Cloud Shell - No Editor - No Console - (console.cloud.google.com/cloudshell/editor) (shellonly=true)

Open in Cloud Shell

Cloud Shell - No Editor - w/ Console

Open in Cloud Shell w Console

Branches

You can specify the branch with the cloudshell_git_branch parameter as in &cloudshell_git_branch=v123

Clones & Re clones

Each time you click the buttons above, the repo is cloned down to your cloud shell in a new numbered directory. If the repo name was demo, the first click would clone to ~/cloudshell_open/demo the second click would download to ~/cloudshell_open/demo-1 Once downloaded, the shell is opened into that cloned folder. The second click would open the shell into ~/cloudshell_open/demo-1

When using directives in the turorials that reference files and path the system uses relative links based on the workspace value. By default this value is set to your home directory ~. You can set this in the button's url with the cloudshell_workspace parameter. This will also set the IDE workspace to that directory. One additional note here is that this command is executed for you within the cloned repo folder.

Consider this link

https://console.cloud.google.com/cloudshell/editor
    ?cloudshell_git_repo=https://github.com/cgrant/cloudshell-tutorial.git
    &cloudshell_git_branch=v123
    &cloudshell_workspace=.
    &cloudshell_tutorial=docs/tutorial.md

With the previous link and assuming this is the third click of the button, when clicked the v123 branch of the repo will be downloaded to the ~/cloudshell_open/demo-2 directory. The shell will be opened into the ~/cloudshell_open/demo-2 directory. The IDE will be opened with the explorer root as ~/cloudshell_open/demo-2 and the tutorial will open the file at ~/cloudshell_open/demo-2/docs/tutorial.md

Images

All images utilize absolute urls. While ideally you'd like to keep assets together, I've found serving them from firebase hosting to be the easiest model. Storing them in git is challenging during development, trying to pull the right versions when on a branch etc.

Releases

No releases published

Packages

No packages published

Languages