init
tasks defined in the .gitpod.yml
ahead of time. init
tasks can take a lot of time, like a build or test suite, etc.
When a workspace is started later on, the prebuild is used as a base for the new workspace. In effect, init
is already done and developers are immediately ready-to-code.
init
or before
task in the repository’s .gitpod.yml..gitpod.yml
to run. You can do this by ensuring you have either an init
or before
task present.
The below example .gitpod.yml
shows a repository that will run npm install
inside a prebuild. The command
task with npm start
is not executed in the prebuild as it’s assumed to be a long-running process, e.g. a web server.
gp validate --prebuild
./repositories
.gitpod.yml
changed (if configured)tasks
definition for either a before
or init
task in the .gitpod.yml
changed20
.
For example:
git
branches:
main
)init
tasks fails, these are the ways to debug it and understand why.
gp validate
to test changes to .gitpod.yml
gp validate --prebuild
in the workspace you are editing the .gitpod.yml
in simulates the execution of a prebuild right in your workspace. This offers the best turnaround time for debugging a prebuild.
/workspace
directory is persisted from a prebuild/workspace
directory. Other directories like the home directory are not saved by prebuilds. To ensure the necessary files are saved, copy them to the /workspace
directory before the prebuild completes, and/or restore those files in your command
task.
/prebuilds
. To see a list of all prebuilds that ever ran, please consult Gitpod’s usage report.
before
and init
tasks combined exceed 1 hour, your prebuild will be terminated.
.gitpod.yml
, you can view their logs alongside other tasks on the prebuilds detail page.
Create Workspace
button gone?