Custom installation script
Gitpod will recognize and run one of the following install scripts from your dotfiles repository.- install.sh
- install
- bootstrap.sh
- bootstrap
- script/bootstrap
- setup.sh
- setup
- script/setup
chmod 755 <install-script-name>.sh
before committing and pushing to your dotfiles repository.
If there is no install script, your dotfiles will be symlinked into /home/gitpod
. In that case Gitpod will not overwrite existing files in your $HOME
directory. If you want to overwrite existing files you may use a custom install script.
Example
You can refer this demo-dotfiles template to bring your dotfiles to Gitpod.
.bash_aliases
. If this file is present in a workspace home directory, it will be found by the ‘.bashrc’ startup script in the Gitpod default image, so no additional install script is required.
.bash_aliases
Troubleshooting
The dotfiles repository installation logs are saved to/home/gitpod/.dotfiles.log
and can be viewed via
FAQs
How to debug or test dotfiles changes inside an existing workspace without creating a new one each time?
If you want to quickly test out dotfiles inside an existing workspace created from yourdotfiles
repository, you can run the below command snippet in your terminal as a workaround:
docker
, where your dotfiles will be installed so you can easily test.
For convenience, you can create a file called debug.sh
in your dotfiles repository and paste the snippet there. You could then run bash debug.sh
to use it.
How to install symlinks from dotfiles when using a custom installation script?
When you commit a custom script such asinstall.sh
in your dotfiles repository, Gitpod will no longer auto symlink your dotfiles under $HOME
for you. It is by design so that you can have full control of how your dotfiles gets installed. An example of setting up a symlinking step is described below:
- Create a directory called
home_files
inside your dotfiles repository. You can place your .dotfiles in thehome_files
directory, that means you could put files like.zshrc
,.tmux.conf
,.config/nvim/
and etc. in there. - In your custom installation script (e.g.
install.sh
), use/append the below snippet:
It it possible to cache the dotfiles installation?
If your dotfiles installation relies on some heavy dependencies, that can take some time to install by nature. So, everytime you start a workspace, you may have to wait for the dotfiles installation to complete before you can enter the workspace. For some cases, you can start the commands in background from yourinstall.sh
, by adding & disown
at the end of a command:
zsh
) or a dependency of something else that has to start before your dotfiles can get installed.
See #7592 for more info, please upvote and share your feedback on this issue.