Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git describe #370

Open
6 tasks done
cerw opened this issue Apr 10, 2018 · 10 comments
Open
6 tasks done

git describe #370

cerw opened this issue Apr 10, 2018 · 10 comments

Comments

@cerw
Copy link

cerw commented Apr 10, 2018

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

  • You're running the latest release version of Deployer.
  • Ensure that you're running at least PHP 5.6.4, you can check this by running php -v
  • You've ran composer install --no-dev from the root of your installation.
  • You've ran npm install --production from the root of your installation.
  • You've ran rm -rf bootstrap/cache/* from the root of your installation.
  • 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

@REBELinBLUE
Copy link
Owner

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)

@cerw
Copy link
Author

cerw commented Apr 19, 2018

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
Copy link
Author

cerw commented Apr 26, 2018

@REBELinBLUE

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

@mdriessen
Copy link

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!

@REBELinBLUE
Copy link
Owner

@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
Copy link
Owner

@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

@mdriessen
Copy link

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
Copy link

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

@REBELinBLUE
Copy link
Owner

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

@cerw
Copy link
Author

cerw commented Jan 31, 2019

Still happy to help too

git describe --tags

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants