Currently I am working on a project that involves the following daily workflow:
Update local code and edit
commit to subversion repository
ftp to a testing server
I have been using Netbeans to handle all of this but frankly it, combined with the other stuff I am running, eats up all of my machine's resources frequently leaving it sluggish. By switching to a lighter text editor, a standalone ftp client and a standalone svn client I avoid the slowdowns and resource hogging but working becomes clunkier as I move between apps. Basically I really like Netbeans but until I can get a more powerful machine (Macbook Pro next week?) I am stuck.
What is your workflow? Any suggestions on how I can improve mine? Can I cut out FTP with Subversion in some way?
p.s. Subversion use is cast in stone so no git. Also, I'm on a Mac.
On Mac, I use TextMate as my editor of choice. Lots of language goodies for speeding development in whatever language you're doing via Bundles. It has an SVN bundle, which lets you update/checkout/commit directly. I use that for quick updates/checkouts. On my test server, I have another SVN working directory. I set up an SVN Post Commit hook to 1) automatically update the test server with the latest code, and then 2) send a twitter message to inform other developers of the change.
If I want to do more in depth work on the SVN repository (tags, commit logs, diffs) I tend to use the command line, or use a dedicated client like Cornerstone.
Eclipse is an IDE, which also includes syncing with version control, and FTP.
maybe install svn on the testing machine and do an update automatically every ten minutes or so. Or at a specific time.
Just an idea.
Sascha
Almost all the programming editors (Vim, Emacs, etc) support subversion integration.
The only missing link is the FTP to test server. You can do this easily with a post-commit hook in subversion.
If you want to run some pre-commit tests as well, check out this script I had written some time back:
http://code.google.com/p/svn-pre-check/
In case someone is still looking for svn ftp connection i would suggest svn2ftp.
Related
I recently started a new job, where all development is done on a remote dev server. I really like Eclipse as a centralized development environment for all the different stuff I'm working on, and am not a particularly big fan of emacs or vi. I'll use emacs if I have to change something quickly, but after really trying to like it for normal development, I'm really starting to miss Eclipse.
That said, is there any way I can use Eclipse with EPIC for Perl development on a remote server? I can live without debugging functionality, but proper syntax highlighting, and the ability to create projects would be really, really nice. So far, I've tried using a remote browser plugin for Eclipse to peruse the remote dev server and open stuff into Eclipse that way, but it is far from ideal. Anyone have any better ideas?
Answering my own question (which no one seems to have looked at or care about, but what the hell-- maybe someone will have the same issue):
Grab Remote Systems Explorer from here.
Setup RSE to ssh into your remote server.
Create a new empty EPIC project (or using whatever plugin/ language you want).
Right click the project, select "New Folder," then
Advanced >> Link to alternate location (Linked Folder)
Switch file system to RSE, then just browse to some folder on your remote system you'd like to become a project, and add it.
That's it, you're done. Now when you open your project in Eclipse, you'll see that folder with all the code you wanted, and you can use it just like you would locally.
The main problem I'm seeing with this right now is that currently I can't get it to do any error checking, which is too bad. I'll work on finding a work around for that and update here if I do.
If you're on linux, you can also mount the remote drive/folder with sshfs and use the same "linked folder technique". I do this all the time for Java EE development. sshfs is also very reliable, unlike Windows network shares mounted on linux with Samba-Client. (Sometimes the Windows sharing service gets confused. And needs to be restarted on the remote server. I use a powershell one liner for this "restart-service -name 'sharing service' " or something likeĀ“that.)
I am starting a small project in Eclipse(plus Tigris) and I'd like to try out Subversion on it. I don't have any repository on the web.
Do I need to have a repository on the web to be able to use source control? From what I've been looking all Eclipse allows me to do is to either checkout from a Host or add a new repository (from a Host).
I've been using Mercurial for a while and all I needed was to do a folder_name init to add that folder to source control. How to do the same with Subversion?
Subversion makes this easy. You can create a local repository on your system and reference it using file:// paths.
See http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-repository.html#tsvn-repository-create-commandline for how to create using either the TortoiseSVN GUI, or the command-line.
NOTE TortoiseSVN is a graphical front-end for Subversion, implemented as a Windows Explorer extension. It makes lots of common Subversion tasks really painless. Subversion of course ships with a command-line client so it's your choice which to use.
Just do
svnadmin create xyz
The URL will be, for example, file:///home/yourusername/xyz
Sure. I have subversion set up on my home computer with a local repositry and the server installed as a service. The URLs you use then point to localhost 127.0.0.0 instead of an external web address.
Maybe you should look into GIT. That doesn't require a server. http://git-scm.com/
I use VisualSVN and it works like a charm. It takes like 3 minutes from when you download it to when it's working in eclipse (assuming you have subclipse installed already and whatnot.)
www.visualsvn.com
I was struggling with how to use TFS as a source code repository for iPhone development.
My boss will never let me use Subversion (or God forbid Perforce), so I was stuck with TFS source control.
The solution is to go and buy tools to bridge Mac to TFS, and I am not trying to advertise here, but the Teamprise Client Suite for Mac OS X is the bridge between Mac OS X and TFS.
For standard check-ins and developer workflow, there is no integration between Xcode and TFS. You have to do it all manually through the Teamprise Explorer client.
For builds, it turns out that Automator and the Teamprise Command Line client do the trick.
Is there some Xcode to TFS bridge out there?
What source code control system are you using for iPhone development?
The key for me is the following bash script embedded in an Automator workflow.
%1 = Local folder to do a code pull to.
%2 = Project Name to do the pull from.
This script assumes the Teamprise Command Line Client is installed to ~/Teamprise
PATH="$PATH:~/Teamprise:~/Teamprise/lib"
cd "$1"
mkdir "$1/logs"
tf workspace -delete BuildScript -server:http://TFSServer -login:uname#domain,password >> $1/logs/wsdelete1.log
tf workspace -new BuildScript -server:http://TFSServer -login:uname#domain,password >> $1/logs/wscreate.log
tf workfold -map "$/TFSRoot" . -workspace:BuildScript -server:http://TFSServer -login:uname#domain,password >> $1/logs/workfold.log
tf get "$/TFSRoot/$2" -all -recursive -server:http://TFSServer -login:uname#domain,password >> $1/logs/get.log
tf workspace -delete BuildScript -server:http://TFSServer -login:uname#domain,password >> $1/logs/wsdelete2.log
#pump the tfs landing folder to the next step in the Automator script.
echo $1/Projects/$2
As Louis states, XCode doesn't currently provide a publicly accessible plug-in model for us (Teamprise) to provide a TFS integration with - it is something that we would love to do.
We've experimented with a couple of hacks - such as pretending to be the Perforce command line and talking to TFS instead, however these internal proof of concepts have so far not worked out very well - especially as we would want to ideally have Work Item Tracking linked in somehow as well so that you can associate check-ins with bugs etc.
Today, the majority of our customers that are using Teamprise to talk to TFS from XCode are doing so either using the standalone UI tool (Teamprise Explorer) or are doing Automator actions like you suggest to hook into the tf command line.
Apologies that this isn't a great experience. All I can suggest is that you file a bug with Apple to provide a plug-in model for SCM systems to hook into XCode. Hopefully if there is significant developer demand then we might have more luck than just us requesting it.
While internally Xcode is using a plugin system to support different version control systems, it is not public or documented. Aside from minimal support like running some commandline scripts there is no supported way to use any version control systems except for those Xcode ships with.
You should file a bug with Apple asking for native support for TFS, or a supported VCS plugin system for Xcode.
Anyway, in the short run I don't think you will find an satisfactory solution to your problem.
If you must integrate with a TFS server, your best route at this time is to use SVNBridge and then connect to the bridge via Xcode's built-in subversion functionality.
Also, installing a VisualSVN server for the first time took me less than 15 minutes for a base install and another ten or so configuring users and getting the SSL cert signed by our company's root certificate. Give it a try, it was really easy.
I'm forced to use SourceSafe at my job. There is no way this is going to change. I would like to use another source control for my own need in parallel. I want to be able to keep an history of my modifications, branch easily and merge. I can install any application that doesn't requires admin rights. I cannot install Python or anything that integrates in File Explorer.
I'm not much of a command line guy so a GUI is a must. I managed to install Mercurial but not TortoiseHG. There is a chance msysgit would install but the GUI isn't very good.
Any suggestions?
you can install svn command line just by unzipping it, but if you want TortoiseSVN for the GUI then I you may need admin rights, not sure. But you don't need a separate gui if your IDE supports SVN, like Eclipse or any other java IDE does.
Git has a pretty nice command-line interface with color and auto-completion. After reading the Pro Git Book I found the command-line is great.
There is GUI bundled with it. It is nice for viewing logs and merges but may be not to your taste. There is also a TortoiseGit shell extension (like the famous TortoiseSVN), but that would require admin privileges to install (as opposed to Git portable).
Install and use a Virtual Machine product and go crazy with whatever you want, then look for another job.
I would check out SourceGear Vault, it has SourceSafe Import and SourceSafe Feature support. This may need admin rights though...
Another tack is to synchronize a copy of the directory to another machine where you do have some rights. I would recommend rsync -- I think there are several Windows versions available.
On this other machine you can now use whatever tools you like. I know it's a kludge, but then so is working on a system where you aren't even trusted enough to install something like Python.
AFAIK any TortoiseXX will need admin rights as it needs to hook up explorer.exe to use it. you should still be able to use hgtk part of tortoisehg to get at the windows though
There is no way this is going to
change
I don't mean to say that you should shout your head off about how svn, or whatever, is great, and moan about VSS all the time. But I find it hard to believe that a well-reasoned proposal to switch to a newer, better version control system outlining the pitfalls of VSS (no security - all users have write access to the history of everything, for example) would be ignored.
If you can't install programs that integrate with explorer, then using any version control system is going to mean learning to use it from the command line!
Check out bazaar (bzr). I've not used it personally but it claims to have an excellent gui which may mean you don't need a TortoiseXX install.
Just use a version control tool from the command line. It isn't painful and it can be automated quite easily via your existing tools. SVN isn't going to be great when interacting with an existing version control system (it is finicky about files/directories being deleted, renamed etc), whereas the DVCS tools (I prefer Mercurial) are much smarter about it.
My recommendation: Use Mercurial. It has sane ignore rules so it can be trained to ignore VSS cruft, a single .hg directory that contains all the VC data, and easy branching (which will help you change gears more often). git is fine too, but has a steeper learning curve.
I've got a number of batch processes that run behind the scenes for a Linux/PHP website. They are starting to grow in number and complexity, so I want to bring a small amount of process to bear on them.
My source tree has a bunch of cpp files and scripts, organized with development but not deployment in mind. After compiling all the executables, I need to put various scripts and binaries on a cluster of machines. Different machines need different executables, scripts, and config files for their batch processes. I also have a few of tools that I've written that belong on every machine. At the moment, this deployment process is manual and error prone.
I'm guessing I'm just going to end up with a script that runs at the root of the source tree and builds a smaller tree of everything necessary for any of the machines. Then, I'll just rsync that to the appropriate machines. But I'm curious how other people are managing this type of problem. Any ideas?
There are a several categories of tool here. Some people use a combination of tools from these categories. I sometimes use, for example, both Puppet and Capistrano. See Puppet or Capistrano - Use the Right Tool for the Job for a discussion.
Scripting Tools aimed at Deploying an Application:
The general pattern with tools in this category is that you create a script and/or config file, often with sets of commands similar to a Makefile, and the tool will ssh over to your production box, do a checkout of your source, and run whatever other steps are necessary.
Tools in this area usually have facilities for rollback to a previous version. So they'll check out your source to releases/ directory, and create a symbolic link from "current" to "releases/" if all goes well. If there's a problem, you can revert to the previous version by running a command that will remove "current" and link it to the previous releases/ directory.
Capistrano comes from the Rails community but is general-purpose. Users of Capistrano may be interested in deprec, a set of deployment recipes for Capistrano.
Vlad the Deployer is an alternative to Capistrano, again from the Rails community.
Write your own shell script or Makefile.
Options for getting the files to the production box:
Direct checkout from source. Not always possible if your production boxes lack development tools, specifically source code management tools.
Checkout source locally, then tar/zip it up. Use scp or rsync to copy the tarball over. This is sometimes preferred for something like an Amazon EC2 deployment, where a compressed tarball can save time/bandwidth.
Checkout source locally, then rsync it over to the production box.
Packaging Tools
Use your OS's packaging system to generate packages containing the files for your app. Create a master package that has as dependencies the other packages you need. The RubyWorks system is an example of this, used to deploy a Rails stack and sample application. Then it's a matter of using apt, yum/rpm, Windows msi, or whatever to deploy a given version. Rollback involves uninstalling and reinstalling an old version.
General Tools Aimed at Installing Apps/Configs and Maintaining a Set of Systems
These tools do not specifically target the problem of deploying a web app, but rather the more general problem of deploying/maintaining Apps/Configs for a set of servers, or an entire company's workstations. They are aimed more at the system administrator than the web developer, though either can find them useful.
Cfengine is a tool in this category.
Puppet aims to improve on Cfengine. It's got a learning curve but many find it worth the time to figure out how to do the configs. Once you've got it going, each box checks the central server periodically and makes sure everything is up to date. If someone edits a file or changes a permission, this is detected and corrected. So, unlike the deployment tools above, Puppet not only puts files in the right place for you, it ensures they stay that way.
Chef is a little younger than Puppet with a similar approach.
Smartfrog is another tool in this category.
Ansible works with plain YAML files and does not require agents running on the servers it manages
For a comparison of these and many more tools in this category, see the Wikipedia article, Comparison of open source configuration management software.
Take a look at the cfengine tutorial to see if cfengine looks like the right tool for your situation. It may be a little too complicated for a small website, but if it is going to involve more computers and more configuration in the future, at some point you will end up using cfengine or something like that.
Create your own packages in the format your distribution uses, e.g. Debian packages (.deb). These can either be copied to each machine and installed manually, or you can set up your own repository, and add it to your list of sources.
Your packages should be set up so that the scripts they contain consult a configuration file, which is different on each host, depending on what scripts need to be run on each.
To tie it all together, you can create a meta package that just depends on each of the other packages you create. That way, when you set up a new server, you install that one meta package, and the other packages are brought in as dependencies.
Although this process sounds a bit complicated, if you have many scripts and many hosts to deploy them to, it can really pay off in the long run.
I have to roll out PHP scripts and Apache configurations to several customers on a frequent basis. Since they all run Debian Linux, I've set up a Debian package repository on my server and the all the customer has to do is type apt-get upgrade and they get the latest version.
The first thing to do is get all these scripts into a source control repository (svn or git are good) so that you can track changes to these scripts over time.
If you are interested in ruby, check out Capistrano, it is well suited deploying things to multiple machines in a cluster, and is fairly easy to set up. It can read files directly from your version control system.
Puppet is another tool that can be used in this situation. It is similar to cfengine - you create a model of the desired deployment and Puppet figures how to get the environment to this state.