https://github.com/gitpod-io/template-dynamic-workspace-location-and-tasks
https://github.com/gitpod-io/template-dynamic-workspace-location-and-tasks
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gitpod-io/template-dynamic-workspace-location-and-tasks
- Owner: gitpod-io
- Created: 2022-10-31T14:36:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T15:21:47.000Z (over 3 years ago)
- Last Synced: 2025-03-10T16:43:09.174Z (over 1 year ago)
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dynamic workspace root and tasks based on subdirectory context
Dynamically change VSCode [workspaceLocation](https://www.gitpod.io/docs/references/gitpod-yml#workspacelocation) based on context.
Browse to one of the subdirectories on this repo and open a workspace from there. Or you can also click on a button below!
- [](https://gitpod.io/#https://github.com/gitpod-io/template-dynamic-workspace-location/tree/main/docs)
- [](https://gitpod.io/#https://github.com/gitpod-io/template-dynamic-workspace-location/tree/main/examples)
- [](https://gitpod.io/#https://github.com/gitpod-io/template-dynamic-workspace-location/tree/main/practice)
# Details
A [.gitpod.yml](./.gitpod.yml) task is used to process `$GITPOD_WORKSPACE_CONTEXT_URL` variable. Later `code -r` command is used if a subdirectory was found on the CONTEXT_URL.
We can also run tasks conditionally based on the subdirectory context. (see the 2nd task in [.gitpod.yml](./.gitpod.yml) for example)