How can you retrieve the currently building revision from within a custom Heroku buildpack?

StackOverflow https://stackoverflow.com/questions/14952077

  •  10-03-2022
  •  | 
  •  

Pergunta

I have a catalog of builds indexed by git revision stored on s3 by our CI server. Instead of performing a build at deploy time, I would like to just download a pre-built application, unpack it and go.

I'm trying to accomplish this with a custom buildpack, but in order to do so, I need for it find out which revision of the code is being compiled. Sadly (for me), I can not find this information anywhere in the environment.

It seems like this is something that ought to be discoverable somehow, but I'm completely flummoxed as to where.

Foi útil?

Solução

You might want to take a look at the (not officially supported) heroku-anvil plugin, which includes the heroku release command to push externally created slugs to a Heroku app. It was originally designed for working with slugs created with Anvil, but should work for any TAR GZ, as long as it can be run on Heroku. For example you could do something like this:

$ heroku release https://s3.amazonaws.com/my-bucket/slugs-000.tgz -a myapp-staging
Releasing to myapp-staging.heroku.com... done, v42
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top