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

[Docs] How to install on ubuntu. Why so little documentation on Linux installation? #2365

Closed
sunilshahi opened this issue Jul 21, 2020 · 11 comments · Fixed by #2599
Closed
Assignees
Milestone

Comments

@sunilshahi
Copy link

Apologies in advance. I will admit I am a noob with both gitversion and ubuntu. So maybe I am missing something.

I am trying to install gitversion command line in Ubuntu 18.04.4 LTS. The documentation here says we need to install mono-complete and run mono gitversion.exe.

How do I get the exe file? downloading and uncompressing the tar.gz file from here gave me just a single file named gitversion, I do not see any exe file.

wget https://github.com/GitTools/GitVersion/releases/download/5.3.7/gitversion-ubuntu.18.04-x64-5.3.7.tar.gz
tar -xvf gitversion-ubuntu.18.04-x64-5.3.7.tar.gz

A little more guideline in docs would be helpful.

Thanks in advance

@asbjornu
Copy link
Member

Please see #2260 (comment). LibGit2Sharp doesn't support Debian 10 based distributions. Can you please explain in which context you want to use GitVersion and why you are installing it so we can better guide you towards the best available package? You can also have a look at #2326 to see which alternatives exist and make a choice for yourself.

@sunilshahi
Copy link
Author

why you are installing it so we can better guide you towards the best available package?

Basically, I am trying to setup a CICD Pipeline for one of my project. I have a teamcity server with a ubuntu build agent. I am trying to use semantic version to use it with docker build command so that I can tag the docker image with appropriate version.
Hope that gives you an idea what I am looking for.

@asbjornu
Copy link
Member

I see. Then I would recommend you use one of our Docker Images to execute GitVersion.

@rhaines-chwy
Copy link

I had the same issue, albeit with MacOS. The information on how to actually install gitverison is buried on https://gitversion.net/docs/usage/command-line . I don't consider installation to be usage, it's... installation. Please consider adding a dedicated tab with installation instructions for each platform. I ended up finding the installation instructions by web searching for them, even though I had already visited the gitversion docs.

@asbjornu
Copy link
Member

Great idea, @rhaines-chwy. I agree. Would you please submit a PR for that documentation refactoring?

@stale
Copy link

stale bot commented Dec 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2020
@arturcic arturcic removed the stale label Dec 20, 2020
@johlju
Copy link

johlju commented Dec 25, 2020

I did the following on a Ubuntu (running in WSL). But I need to run it using sudo gitversion. I like to avoid that, but not sure how to do that yet, but it is running. Changes the ownership on the files and then gitversion can be started without sudo.

Installed mono according to this article but not sure if it is needed: https://www.river.red/install-gitversion-ubuntu-16-04/
Realized after I did that, that there are packages for all Ubuntu versions on the releases page.

UPDATE: I removed mono-complete and libcurl3 after I did the below and it still possible to run sudo gitversion.
UPDATE2: No need to do anything else than below, see #2365 (comment).

cd /tmp
wget https://github.com/GitTools/GitVersion/releases/download/5.6.0/gitversion-ubuntu.16.04-x64-5.6.0.tar.gz
cd ~
mkdir gitversion
cd ~/gitversion
sudo tar -xvf /tmp/gitversion-ubuntu.16.04-x64-5.6.0.tar.gz
sudo chmod +x gitversion
sudo ln -sf $(pwd)/gitversion /usr/local/bin/gitversion
# replace 'johlju' with your login
sudo chown johlju:users ~/gitversion/*
cd /{my_git_repo}
gitversion

@arturcic
Copy link
Member

@johlju Glad you are able to use GitVersion. We definitely need the docs to be updated on the installation part as there are so many changes and GitVersion is much easier to install now. For GitVersion you do not need mono or dotnet sdk to be installed that is because the tar.gz file contains the self contained .net core tool that includes the runtime as well. You just need the minimal requirements you can find here for your distribution.

@asbjornu asbjornu self-assigned this Feb 18, 2021
asbjornu added a commit to asbjornu/GitVersion that referenced this issue Feb 22, 2021
@asbjornu asbjornu mentioned this issue Feb 22, 2021
5 tasks
@asbjornu asbjornu added this to the 5.6.7 milestone Feb 22, 2021
@arturcic
Copy link
Member

🎉 This issue has been resolved in version 5.6.7 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

@cml87
Copy link

cml87 commented Apr 16, 2022

@arturcic Thanks for the clarification. The solution posted by @johlju did work for me too. Unfortunately, I didn't find this approach in the documentation. I was trying instead to use GitVersion by means of the proposed docker container in Ubuntu 20.04. Being in a git project directory, I was doing:

 $ docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.6.6 /repo init

with no effects. I was getting the same output as without the init argument. Passing -h to see the help gave me an error:

$ docker run -it  -v "$(pwd):/repo"  gittools/gitversion:5.10.1-ubuntu.20.04-6.0 /repo -h
Unhandled exception. GitVersion.WarningException: Could not parse command line parameter '-h'.
   at GitVersion.ArgumentParser.ParseTargetPath(Arguments arguments, String name, IReadOnlyList`1 values, String value, Boolean parseEnded) in D:\a\GitVersion\GitVersion\src\GitVersion.App\ArgumentParser.cs:line 190
   at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\GitVersion\GitVersion\src\GitVersion.App\ArgumentParser.cs:line 86
   at GitVersion.Program.<>c__DisplayClass4_0.<CreateHostBuilder>b__2(IServiceProvider sp) in D:\a\GitVersion\GitVersion\src\GitVersion.App\Program.cs:line 30
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at GitVersion.Program.Main(String[] args) in D:\a\GitVersion\GitVersion\src\GitVersion.App\Program.cs:line 15
   at GitVersion.Program.<Main>(String[] args)

However, argument -showconfig seemed to work in this case. Doing as @johlju suggested above seems to work for me. Now I'm prompted as expected after entering gitversion init in my git project directory:

$ gitversion init
INFO [04/16/22 17:40:39:62] Working directory: /home/camilo/my_java_projects/restful-web-services_db
GitVersion init will guide you through setting GitVersion up to work for you

Which would you like to change?

0) Save changes and exit
1) Exit without saving

2) Run getting started wizard

3) Set next version number
4) Branch specific configuration
5) Branch Increment mode (per commit/after tag) (Current: )
6) Assembly versioning scheme (Current: )
7) Setup build scripts

> 

@arturcic
Copy link
Member

@johlju or @cml87 you are very welcomed to improve the documentation regarding the linux usage, please fill in a PR to update the docs and then others will be able to use these knowledge

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

Successfully merging a pull request may close this issue.

6 participants