coder / envbuilder

Build development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Enable developers to modify their development environment quickly.
Apache License 2.0
128 stars 25 forks source link

feat: Add a way to select a specific branch before building the devcontainer #266

Open ggjulio opened 2 months ago

ggjulio commented 2 months ago

Description

Improve feature parity with github codespaces.

The goal is to add a new coder_parameter called target branch to workspace templates. It will let the user select a branch from which to build a devcontainer.

Unlike the devcontainer cli, the git clone happen in the enbuilder container. So I think it is the responsibility of envbuilder to checkout to the target branch before building the container.


PS: The workaround in readme.md does not work on all platforms.

matifali commented 2 months ago

This should already be possible. See https://github.com/coder/envbuilder#git-branch-selection You can preformat your repo url to choose a specific branch.

ggjulio commented 2 months ago

I already tried with bitbucket datacenter but not luck. I'm not sure if this workaround can work on bitbucket.

Also it is not user friendly, IMO it should be as easy as github codespaces. image

When using the devcontainer cli instead of enbuilder it is quite simple, just git checkout before invoking the cli.

Also auto completion of branches would be nice but out of the scope of envbuilder.