How to enter SVN credentials into Jenkins without using UI? - windows

When configuring a build job for the first time that uses Subversion for SCM you get an error that looks like this:
I'm aware that to enter my credentials I simply need to use this url.
http://< my-server >/scm/SubversionSCM/enterCredential
But I'm trying to completely automate the set up/configuration of my jenkins server. Is there a way to give jenkins svn credentials without having to access the UI?
My jenkins server is on Windows and is the latest version. Subversion is on linux.
Edit: I've come across a screenshot online similar to the one above except the is a Credentials field! Does anyone know why I can't see this field. Here is the url of the image
http://michal.karzynski.pl/images/illustrations/2014-04-19/jenkins-source-code-management-configuration.png
Thanks

https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin
this can provide credentials to svn repo.
what actually you gonna do? just access the SVN or looking for the SVN SCM change or any other. simply enter password i don't forsee a need of jenkins plugin

The solution is to create some "domain credentials" in the "Manage credentials" section (admin part: http://<server>:8080/credentials/):

One way around this is to use the Subversion command line. Jenkins doesn't need the command line client and you might have to install it.
However, for a particular repository, do a checkout of a project via the command line with the user you want to use. Then, say "Yes" when Subversion asks if you want to cache the credentials.
When Jenkins does a checkout, it will use these cached credentials if you didn't specify a particular Jenkins credential to use. This works per Subversion repository.

Related

How to pull artifact version in udeploy from a custom url

I am very new to udeploy and looking for a feature to pull latest version of artifacts from one of our build tool using simple http download from a given url.
I can see that "Source Configuration Type" has many option available like filesystem, teamcity, git repo etc, but no option is available for a simple url download.
I am actually using teamcity build and teamcity provides GET API to download artifacts, I understand that uDeoploy is also using this teamcity feature but the url it is constructing is not correct and throwing 401 exception (unauthorized) when not auth information is not provided, it should be using teamcity guest access to download the artifacts.
Please Note: when login information is provided it is working fine
any thoughts.
You can adjust the guest account privileges inside the Administration Panel, then inside the Users management, there is a link to setuo the guest account privileges.

git-credential-winstore.exe for two GitHub logins?

I use git-credential-winstore (installed with msysgit) to store my personal GitHub account details in Window's credentials store (Control Panel -> User Accounts -> Manage your credentials -> windows credentials) I'm now trying to use a second GitHub account. I've modified the local git.config (git config user.name "foo") but when I push, it's still trying to use the personal GitHub credentials. I know I can change the repository url from https://github.com/user/project.git to https://user:password#github.com/user/project.git, but I'd rather not take the security risk by embedding credentials in the git.config. I know I can go into Control Panel and flip the credentials back and forth, but that's really annoying. Is there a way to store multiple GitHub account details in git-credential-winstore and configure each repo to use one or the other?
I have forked the git-credential-winstore to support multiple github logins.
You can find my fork here: https://gitcredentialstore.codeplex.com/SourceControl/network/forks/nickmeldrum/gitcredentialstore
(I have sent the original author a pull request but it doesn't look like he accepts them/ maintains the project anymore.)
The simplest way to use my fork would be:
Clone the repository locally: git clone https://git01.codeplex.com/gitcredentialstore
Build the project using the Debug configuration (should build from scratch with Visual Studio or MSBuild: msbuild.exe .\git-credential-winstore.sln)
Run the command: InstallLocalBuild.cmd to setup git to use this version of the credential helper
If anyone actually uses this fork and tells me about it, I will set up a proper binary download in codeplex!
Key piece of info:
In order for this to work you need to tell git the username that you want to use to connect to that particular remote in that repo. You do that by specifying it in the remote url. For example:
git remote set-url origin https://username#github.com/username/repository.git

SVN Commit failed, access forbidden

Recently I am facing problem of commit to SVN. The SVN server I am using is VisualSVN Server 2.5.9 and the client is TortoiseSVN 1.7.12.
At first, one user is having problem to commit files to SVN. But that user still can access to the repository and download the update. The second user on second PC is working properly. But today, the second user is having the same problem as the first user.
Why is this happen? How can the problem be solved? Thanks.
If the problem lies client side, this could be one of the causes of the error.
On clients TortoiseSVN saves client credentials under
Tortoise settings / saved data / authentication data.
I got the same error trying to commit my files, but my credentials were changed. Clearing this cache here will give you a popup on next commit attempt for re-entering your correct credentials.
You can get the "Forbidden" error if your user account lacks access permissions to a repository or repository path; it makes sense to check authorization settings for your user account. Make sure your system administrator hasn't provided you with No Access permission to the repository path.
If you are sure that permissions are set correctly, then double-check the URL you use. URLs in Apache Subversion are case-sensitive.
Additionally, I advise you to read articles on authorization in Subversion and VisualSVN Server:
SVNBook about path-based authorization.
VisualSVN Team's article about path-based authorization. It explains the principles of SVN authorization by comparing it with Windows Access Control.
The solution for me was to check the case sensitivity of the username. A lot of people are mentioning that the URL is case sensitive, but it seems the username is as well!
As a new user to these two software packages, I experienced the exact same problem. As was also discovered above, my solution was to use the same case letters as is in the Repository path.
Here's a tip that I find helpful: In VisualSVN, you can right click on the path, then click "Copy URL to Clipboard" for pasting in Tortoise to be sure that the path is the identical case.
Actually, I had this problem same as you.
My windows is server 2008 and my subversion info is :
TortoiseSVN 1.7.6, Build 22632 - 64 Bit , 2012/03/08 18:29:39
Subversion 1.7.4,
apr 1.4.5
apr-utils 1.3.12
neon 0.29.6
OpenSSL 1.0.0g 18 Jan 2012
zlib 1.2.5
I used this way and I solved this problem.
I used [group] option. this option makes problem.
I rewrite authz file contents.
I remove group option. and I set one by one.
I use well.
Thanks for reading.
Actually, I had this problem same as you. You can get the "Forbidden" error if your commit includes different directories ; Like external items.
And ı solved in one step. Just commit external items in another case.
Additionally, I advise you to read articles on External Items in Subversion and VisualSVN Server:
VisualSVN Team's article about Daily Use Guide External Items. It explains the principles of External Items in SVN.
https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-externals.html
I had a similar issue in Mac where svn was picking mac login as user name and I was getting error as
svn: E170013: Unable to connect to a repository at URL 'https://repo:8443/svn/proj/trunk'
svn: E175013: Access to '/svn/proj/trunk' forbidden
I used the --username along with svn command to pass the correct username which helped me.
Alternatively, you can delete ~/.subversion/auth file, after which svn will prompt you for username.
I was unable to commit csharp-files (*.cs). In the end the problem was that at some point i installed mod_mono, which made the *.cs-files inaccessible, through its configuration. So it may well be an apache-configuration issue, if only some sort of files are not accessible.
grep ".cs" /etc/apache2/mods-enabled/*
...
mod_mono_auto.conf:AddType application/x-asp-net .cs
...
My issue was my SVN permissions.
I had the same problem "Access to '/svn/[my path]/!svn/me' forbidden" when trying to commit files to a project I had been working on daily for several months. After trying the steps above, I could not resolve the issue. I also tried pulling the project down from scratch, logging in/out of SVN, etc. Finally I contacted my company's IT department and there was a permissions issue that spontaneously emerged which changed my access from read/write to read-only access. The IT department refreshed my permissions and this solved the problem.

maven release plugin release.properties file contains unencrypted password

I'm running the maven release plugin (org.apache.maven.plugins:maven-release-plugin:2.3.2) and noticed that the password to the scm is saved in clear text in the release.properties file when passed in via the command line. I want to know if there is a way to turn this off.
I'm using Hudson to automate the release process, and the svn username and password are passed in to the command line via Hudson. The reason for this is that the person doing the release preparation can change and I have multiple hudson jobs sharing a settings.xml to release different projects.
I'm passing in parameters such as:
-Dtag=${svn.label} -DreleaseVersion=${maven.releaseVersion} -DdevelopmentVersion=${maven.developmentVersion} -Dusername=${svn.username} -Dpassword=${svn.password} -DscmCommentPrefix='[maven-release-plugin] ${env.BUILD_URL} '
The release.properties file gets created during the release:prepare, but I don't think it should be necessary as I'm passing in all the information along the command line. When this release.properties file is created it includes the password in plain text. This is problematic because it's possible to use hudson to browse the workspace, so anyone with access to hudson can see the password by opening the file via the browser.
Is there a way to not create the release.properties file, or to not save the password in the file? I realize that an encrypted password could be saved in a settings.xml file but this file is shared among multiple jobs and is not editable by the people running the jobs.
We avoided such problems letting the svn-client caching the password for us.
For this purpose we have a special account with adequate rights in subversion.
On our build server the password is stored plain text by the svn-client in the account for the user who runs hudson. For us it's no problem because only to hudson administrators have access to this account.
But you can also configure the svn-client to store the password encrypted. The configuration depends on your operating system.
svn-client configuration is stored in .subversion (linux) or "ApplicationData/Subversion" (windows).
See
here, here or here.
Just a couple of days ago somebody asked for this improvement: https://jira.codehaus.org/browse/MRELEASE-846

SVN Server with single repo and no root path

I have a strange SVN server configuration issue I cannot figure out.
A previous employee setup Collabnet svn server (version 1.6.9) on a windows server at work which we use for development. It's a great system, love using it.
We use a local LAN path for the repository with all our various folders, like this...
"svn://server1"
It has one repository called "repo".
I have recently installed a second SVN on another server (same version, same OS)
It has one repository called "main". In order to access it I have to use the svn path of ...
"svn://server2/main"
So the question is.... does anyone know how we ended up with one server requiring to use a "repo name" after the server name (and does not work without it) and one server not requiring a "repo name" (and does not work with it)?
The main reason for asking is I also need to setup additional repositories on the original server and do not want to affect the current configuration. I assume this is some level or option or configuration or a "default repo" setting or something, but I just can't seem to find where and how it was set.
Check the entry in your conf file. If you have your svn information within a location tag, the location is the only way to access the repository.

Resources