Jump to content

Git Integration


viceroypenguin

Recommended Posts

As an interim until Plastic releases a new TeamCity plugin that is effective for branches and such, we are considering the use of Git as a medium for allowing TeamCity access to Plastic. That is to say, Plastic is our primary source control, we use Plastic hooks to automatically replicate changes to Git, and TeamCity picks up the changes from Git and builds as necessary.

We downloaded and are using Plastic 4.2.27.373 - Newcastle. This is the latest labs version, and it does have Git bi-sync. I am able to use the GUI to set a URL http://<server>:<port>/<project>.git with a username and password and the process syncs fine. I am now attempting to use the command line so I can automate the sync process.

I have attempted to run 'cm sync <project>@<server>:<port> git' as well as 'cm sync <project>@<server>:<port> git --user=<user> --pwd=<password>'. In both cases, I get the following output: Receiving references ...Error: Exception of type 'Codice.Foreign.ForeignSCMInvalidCredentialsException' was thrown. I can use the exact same user/pass in the GUI, but the command line doesn't seem to like it.

Is there something I'm missing regarding how to connect to the git server via Plastic? As additional info, both the Git server and the Plastic server are running on the same Windows box; the backend DB is SQL Server 2012; the Git server is GitStack (http://www.gitstack.com).

Link to comment
Share on other sites

As further information, I reviewed the HTTPS traffic - the data given appears to be different. Using the GUI, the username and password are passed via valid "basic" authentication, that is the base64 encoded version of "<username>:<password>". Using the command line, the Authorization is simply "Og==", which is the base64 encoded version of ":", implying an empty username and password. This is in spite of the fact that I specifically provided username and password using the appropriate command line parameters.

Link to comment
Share on other sites

Hi,

I've had this same problem in the past trying to connect to GitHub via the Plastic / Git bidirectional sync. Unfortunately I can't remember what I was doing wrong to start with, but what works for me now is something like this:-

cm sync NTestCaseBuilder2 git https://github.com/sageserpent-open/NTestCaseBuilder2.git --user=sageserpent-open --pwd=<omitted>

Note use of explicit URL for the Git repository, explicit call out of https protocol and the trailing '.git' in the URL path.

I appreciate you're using GitStack locally, so this may not work for you.

I do know that whatever I did to fix this problem (I think it was simply changing the protocol in the URL from either http:// or git://) didn't involve me playing with the server settings - so no changes to the user name or password. I guess you've already connected to GitStack using a Git client to verify the server setup?

Link to comment
Share on other sites

manu -

Both the username and the password are showing blank in the http header, although both are provided. GitStack version is the latest (2.3). Git version is (git version 1.8.0.msysgit.0).

Also, as an additional test, I attempted to change the sync url to include the username and password in the url (https://<username>:<password>@<server>:<port>/<git ref>.git) and it still uses blank data.

I'll add my votes to one of the existing cases (https://plasticscm.uservoice.com/forums/181648-git-bisync/suggestions/3475058-there-are-changesets-to-push-error-exception-of-) because it seems very similar to what I'm experiencing.

Gerard - yes, I am using https and using the trailing .git in the URL.

Link to comment
Share on other sites

OK - I finally got it working. I wasn't providing the URL because I had gotten errors previously using the URL, but I guess I had never exactly matched the URL string from the command line with the URL string store in the DB.

manu - this might be something to look at for the git bisync anyway. If you allow the command line to not provide the URL, because it's already stored in the db, then currently it's not pulling the username and pass from the command line. It probably should either allow storing the username/password in the db along with the URL or allow the user to provide both on the command line w/o providing the git URL. Regardless, I'm operational with this now at least.

Link to comment
Share on other sites

manu - this might be something to look at for the git bisync anyway. If you allow the command line to not provide the URL, because it's already stored in the db, then currently it's not pulling the username and pass from the command line. It probably should either allow storing the username/password in the db along with the URL or allow the user to provide both on the command line w/o providing the git URL. Regardless, I'm operational with this now at least.

You are completely right.

Thanks for sharing us the conclusion!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...