Deploy with tags


I’d like to add git tag in serverless, but not sure how to generate it on fly. I want to use it to follow up the deployment and rollback if required.

For example, I have the latest git tag 1.2.3 in my repository, and need use it to all environment/variable defined in the serviceless stack.

$ cat development.yml

stage: ${opt:stage, self:provider.stage}
service: serverless
tag: ${git describe --abbrev=0 --tags)    # <= how to make this works

Then I can use it as ${self:custom.tag} in serverless stack.


Did you ever figure this out?


I wrote a wrapper script before do the deployment. It doesn’t support in serverless framework currently.


I add my project repos to the CF description so I can hunt down stuff easier later


Uses this script


could you give details on how to put them together and make it work?


self:custom.repo calls this file and gives me the value