Deploying a specific commit instead of a branch/tag

Hi, I am curious if it is possible to deploy a dev environment based on a commit SHA, without having to create a branch/tag for it?

Hi @Mark90 !

You should be able to set the commit SHA as your current working tree in your local filesystem, and then run the okteto deploy command, as follows:

git checkout <Commit SHA>
okteto deploy

Would that accomplish your use-case objective?

Thanks!

Hi Jona,

Locally that would work, but we’re using okteto pipeline deploy to deploy several (27) different repositories. It has the --branch option but it doesn’t seem to accept commit SHA. If this option doesn’t exist, perhaps I should create a feature request?

Thanks, Mark

Hi @jona, not sure if you got my last reply. Should I create a feature request?

Hi @Mark90 , I will go ahead and create a feature request on your behalf for this. I can update on this thread as I receive updates on the feature request. Thanks for the heads up and the additional information.

Thank you!

1 Like

Okteto pipeline deploy does not support commit SHA. --branch only works with branches and tags because the pipeline needs a ref that it can resolve, not a detached commit. Local checkout works, but pipelines don’t.

A workaround is to add a temporary tag to each commit, or you could file a feature request. This is a good use case for multi-repo pipelines.