deployer icon indicating copy to clipboard operation
deployer copied to clipboard

git describe

Open cerw opened this issue 7 years ago • 10 comments

Before submitting your issue, please make sure that you've checked all of the checkboxes below.

  • [x] You're running the latest release version of Deployer.
  • [x] Ensure that you're running at least PHP 5.6.4, you can check this by running php -v
  • [x] You've ran composer install --no-dev from the root of your installation.
  • [x] You've ran npm install --production from the root of your installation.
  • [x] You've ran rm -rf bootstrap/cache/* from the root of your installation.
  • [x] You have restarted the queue listener and node socket server.

Hi there,

This is more request for a feature or just talk. I want to export git describe before compiling npm run dev so i can use this variable inside of Laravel or Vue.js app. But Deployer downlaod the file via ZIP so there is no access to git repo.

How can I solve this? I can only see sha variable in commands.

Thanks

P

cerw avatar Apr 10 '18 05:04 cerw

Hey, sorry for the late reply, can you show me what git describe does, can't seem to get it working.

The git repo is available on the deployer server so in theory I can create a variable with the content of the output

(it keeps a mirror of it then uses git archive and uploads that, it use to clone the repo on the servers but if you had a large repo as we did at work at the time it took a very long time to deploy as it cloned a new copy each time)

REBELinBLUE avatar Apr 19 '18 07:04 REBELinBLUE

Hi @REBELinBLUE ,

if you use tags and branches then it looks like this:

1.0.9-292-ge72b455

Be great to be able to run some git command or expose this in ENV?

Thanks

cerw avatar Apr 19 '18 09:04 cerw

@REBELinBLUE

I thought it was fetching the ZIP archive using API ? Not via Git clone?

cerw avatar Apr 26 '18 03:04 cerw

I'm looking for something similar, except for the command 'git describe --tags --long'. It generates a similar version string except it also looks at lightweight tags and outputs the hash even when on the commit tag.

If I could write the output to a file on de remote server that would be great!

mdriessen avatar Apr 30 '18 11:04 mdriessen

@cerw No because that isn't a standard git feature, it is specific to the github/bitbucket/gitlab etc APIs so wouldn't work with things like plan old self hosted git repostiries. See resources/scripts/deploy/CreateReleaseArchive.sh to see what it does

REBELinBLUE avatar Apr 30 '18 21:04 REBELinBLUE

@mdriessen Makes sense, I'll have a look at adding 2 more tags for those 2 cases tomorrow but I think I need to look at a way to run commands on the deployer server to create other tags because no doubt there will be more needed at some point

REBELinBLUE avatar Apr 30 '18 21:04 REBELinBLUE

Custom tags sounds like a great feature but adding a tag for the describe command would be sufficient for my use case. Thanks for your help!

mdriessen avatar May 01 '18 10:05 mdriessen

@REBELinBLUE Any progress in making the tags for the describe commands? If not, maybe I can help?

mdriessen avatar May 29 '18 17:05 mdriessen

Really sorry, I started on it and then hit a bit of a roadblock (trying to figure out what to do if you aren't using a tag) and then got really busy at work. Willing to accept PRs if you want to take a look, if not hopefully I will get time this week to look into it

REBELinBLUE avatar May 29 '18 19:05 REBELinBLUE

Still happy to help too

git describe --tags

produces even nicer version of the app :) v2.2.1-3-ga0378503

cerw avatar Jan 31 '19 02:01 cerw