Use init
instead of before
when the main intent is to trigger a prebuild and you previously relied on a single before
without any init
. Use before
to extract common steps when both init
and command
are also present.
tasks:
- before: |
echo `gp url` >> before.txt
command: |
echo `gp url` >> command.txt
This repo demonstrates the following
- A gitpod
before
task is run as part of a prebuild even if there is noinit
task - The
before
task is run again in front of thecommand
task in the workspace - The workspace URL returned by
gp url
is different for the prebuild workspace.
- Open this repo in a gitpod workspace
before.txt
contains 2 lines - one with the URL of the prebuild workspace, one with the URL of the main workspacecommand.txt
contains the url of the main workspace
touch
touch
touch
touch
touch 31
touch 32
touch 33
touch 34
Hello Hola Guten Tag