I am trying to get git-svn working with the teamcity remote run.
Anyone had success witht that ?
The main querstion here is whether that is actually possible.
Very late for an answer but nevertheless...
It's possible through remote run via commandline:
https://github.com/tendant/teamcity-git-svn
Script needs some updates to run on windows and I'll make a pull request to the author once I'm done fixing it.
Related
When i want to update my app running on server, i should ssh to server, cd to app folder, execute git pull, then i should run npm build, next i should restart the server. How to automate this with bash script or something? Is it the case for which jenkins stands for (or some other tools)?.
But how to do this with simple bash script or something?
I dont need the rebuilding of an app every time i push to git, only when i need to update and restart everything.
Also it there a way if build take a lot of time notify me by email that build success?
For now eery time i do update for remote app, i should wait with open terminal when it builded and only then i can close the sshed terminal. Some time builds take a lot of time.
You can simply script those commands, and put that script on your server.
That way, all you need to do is to ssh to that server and call that script, which will execute those commands on demand.
Is it the case for which jenkins stands for (or some other tools)?
Not in this case, since it is purely on demand: you can execute the script through a simple ssh call, no need for Jenkins.
I have just made a new repository. My server is Ubuntu 12.04 32 bit.
I want my commits to be live as soon as I have committed them. This is achieved by making a working copy in my public html directory, and having the post-commit hook update that working copy. I have set that up using the instructions here:
http://www.frenssen.be/content/using-subversion-automatically-update-live-website
The issue is that my post-commit will not run when my project commits. My project commits just fine. I know that the script is a valid script too, because I can run it with
env ./post-commit
inside of the hooks directory and it properly updates.
I thought it might be a permissions thing so I have made extensive use of chown to ensure that www-data is the owner of:
the repo /home/svn/repo2
the working copy /var/www/html
the hook /home/svn/repo2/hooks/post-commit
the update binary /home/svn/autoupdate/autoupdate
But still nothing. My commits are successful, but the hook never runs. My hook script looks like this:
#!/bin/sh
/home/svn/autoupdate/autoupdate
All of the googling seems to be pointing to a permissions issue but I can't figure this one out.
Can you repeat this guy's example, and see if it works at all?
mikewest.org/2006/06/subversion-post-commit-hooks-101
Do you get an error when you commit?
If your post-commit hook actually failed, I think you would see evidence of that in whatever client you were using to perform the checkin. I'm almost suspecting that post-commit is not firing at all. Just to double check, the file needs to actually be called post-commit, all lowercase, and not post-commit.tmpl.
I'm using CollabNet Subversion Edge on Windows 2008 … and trying to auto-deploy (so update from repo to folder) when any commits are made by developers using Tortoise SVN.
I've got a post-commit hook file in the correct repo /hooks folder. The file is named post-commit.bat
The file has one line -
"C:\Program Files\TortoiseSVN\bin\tortoiseproc.exe" /command:update /path:"c:\wamp\www\thewebsite*" /closeonend:1 /outfile:"c:\csvn\update-logs\thewebsite-out.txt"
When I commit anything, it's timing out if I have the file present. If the file is not present, the commits work without any problem. So that tells me the post-commit file is being called … and it's got a problem!
Anyone got a sample post-commit Windows batch file that can help me? Or know how to solve my particular problem?
You should try testing your script by simply calling it from the command line and passing in the repo and version parameters. This might give you some more insight as to why it is timing out. For example:
script.bat PATH_TO_REPO REPO_VERSION
Also instead of using Tortoise, use the native SVN client library. In your script you can navigate to the folder you want to update, and call the "svn update" command. This will be more straightforward and not have to go through Tortoise just to make the update command back to the native library.
Try something like this:
cd "c:\wamp\www\thewebsite"
svn update
If your SVN server requires permissions you may need to pass these in your script as well.
Here is my problem:
I have a python build script building a .air package and deploying it on a server. If I run this script from a cmd.exe window, there is no problem, the files are correctly created and deployed.
But I would like to use Bamboo to be able to build my app everytime I commit/push changes. I configured it but have a serious problem: the .air package is created but the deployment (with a fabric script) doesn't finish... I noticed that the process is launched by 'Administrator' in a cmd.exe and by SYSTEM trough Bamboo. I think that this is the problem (maybe SYSTEM cannot find the ssh host or whatever), so I wanted to know if someone knows how to change the user executing the script to 'Administrator'.
Yes, you can change the user that your bamboo server runs as. I recently posted an answer with details on how do just that in Windows Mercurial global keychain . All the documentation for the windows stuff in the wrapper file can found at http://wrapper.tanukisoftware.com/doc/english/props-nt.html .
Before anybody shoots me down for this - I have already checked every appropriate thread and still not found a solution to my problem.
I have Hudson with git plugin installed on windows server (not my choice) and Hudson runs as a service. Git/bin is on the path. However I cannot clone the repository. Here is a shortened display of the console output:
Started by user anonymous
Checkout:workspace / C:\.hudson\jobs\sdf\workspace - hudson.remoting.LocalChannel#65394b
Last Built Revision: Revision 74200b32314231a5efdadd87bf36b42ec145c720 (origin/master)
Checkout:workspace / C:\.hudson\jobs\sdf\workspace - hudson.remoting.LocalChannel#65394b
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://git.mccannlondon.co.uk/git/mccann_admin
[workspace] $ "C:\Program Files\Git\bin\git.exe" fetch -t ssh://git.mccannlondon.co.uk/git/mccann_admin +refs/heads/*:refs/remotes/origin/*
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 f1:48:2a:0a:d9:18:cf:2e:f2:8c:b3:25:7f:34:d5:34
Connection abandoned.
fatal: The remote end hung up unexpectedly
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
So it seems I need to authenticate the host however I'm not sure why hudson is starting the job as user anonymous when I have set the Administrator as owner of the hudson service.
Does anyone know:
a) how to change hudson's run user? or
b) connect to the remove computer with the same user account as hudson uses as to allow hudson to fetch?
If this has been posted before apologies but I spent a good few hours searching around and couldn't find anything.
Thanks
Lewis
This may be related to the question Git, Can’t clone repo on windows
The problem is that MSysGit starts PLink in the background, i.e. the terminal is not actually connected to the input of PLink. That means that you simply can't type anything into PLink.
You simply have to connect to the server once using PLink or PuTTY, answer Yes and from then on, you won't be asked again.
The tutorial from cletus can be helpful as well.
A good description of the issue can be found in this blog entry
the problem is that Hudson is a service and runs under the user "Local Service Account".
The next step is to add the trace manually the cache (a file) because I know you can do in Linux.
Wrong again, Windows does not have this cache as a file but uses the registry.
Searching in the register found an entry for my user (who had previously accessed the repository and added to the cache footprint) where the trace was stored and copied to HKEY_USERS so that users can access it.
The entry goes like this:
Key Name: HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys
Class Name: NO CLASS
Last Write Time: 23.01.2009 - 18:35
Value 0
Name: dss#22:bla_bla.com
Type: REG_SZ
Data: 0xb477b...
From the command line, you can easily add the key as follows:
reg add HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys /v dss#22:bla_bla.com /d 0xb477b...
Now Hudson, run as a service, go happily and smoothly to the repository where the code.
The 'started by anonymous' is telling you which Hudson user started the job. If you haven't created any Hudson users, then everything is started by 'anonymous'
It is not related to which OS user is executing the process.
You asked how to change the user that Hudson runs as: you need to edit the service (Control Panel->Administrative Tools->Services, double click the Hudson service and change the "Log On" to "This account").
Once the account is setup I make sure that the git server is in MINGW's (Git Bash's) ~hudson/.ssh/known_hosts, and that there's a ~hudson/.ssh/identity file in place. The only warning I have is that if you have cygwin installed on the box you need to make sure that %CYGWIN% is empty, otherwise you'll see key permission errors in the Hudson logs. My recommendation is that you simply set the CYGWIN environment variable to empty in Hudson.
I meet the same problem and after check git plugin, http://wiki.hudson-ci.org/display/HUDSON/Git+Plugin
It is stated to change the git path to /usr/bin/git in Global setting and config the git username
And it fixes my problem
Hope it works for you as well, by the way, I use ubuntu, but it should be the same