bill
1
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?
bill
3
I wrote a wrapper script before do the deployment. It doesn’t support in serverless framework currently.
bill
5
could you give details on how to put them together and make it work?
Hi thanks for this script
I incorporated it as per your excellent example and added the
./scripts/git-remote.js
process.env.repo is still undefined for me
Any thoughts welcome
(it worked great as plain node code but NOT from serverless local custom var)
custom:
repo: ${file(./scripts/git-remote.js):gitUrl}
Does this work with bitbucket cloud? @fearlessfly @DavidWells