Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm using PHPUnderControl which runs on top of Cruise Control for my continuous integration and unit testing. I also have it setup to run PHPDocumentor to generate phpdoc's for me and it runs PHP Code Sniffer to enforce coding standards for me. But now I want to set up something on that same server (Ubuntu) to make deploying to a remote server easier. I already have it setup so after every successful build an SVN Export is done from trunk into a directory within the projects folder on the server.
I've been thinking of writing a little custom PHP script that will SSH to a configured remote server, tarball up the latest export, copy it over, untar and run any migrations. A PHP script like this shouldn't be too hard initially, unless I need to eventually begin scaling to multiple servers. I know there are systems out there like Phing, Fabric and others.
My question is if anyone has any experience with these and can provide some pro's and con's? I've begun setting up Phing on my server and will be trying Fabric next to play with them, but was wondering if anyone who has used them more extensively, or had to scale them, could provide some feedback.
I've used Capistrano with PHP (even though it's more of a Rails-y thing as it's written in Ruby).
It's been really straightforward to use, but that said I haven't had to scale much with it. We do deploy to various different staging/production servers though, and the multi-stage extension has been useful in those scenarios.
However like most things Ruby, there's a lot of hooks and "magic" which can get confusing if you're new to Capistrano and trying to do something tricky with it.
As for how it compares to other deployment tools, I can't comment. I know we used to use Phing, but I'm uncertain why we switched to Capistrano.
If you like Capistrano, but wished it was a bit more PHP'ish, check out Fredistrano.
I wrote an automated build (SVN export, Zend Guard encoding, etc) and deployment system using Phing once and found quite the pain to use. Whenever I had to write a special task I felt I had to jump through way to many hoops just to get it to work.
So, these days I just write simple bash scripts that does building with SVN checkout, encoding, creating a tag in SVN and deployment through rsync. It may be low-tech, and Phing may have some superior features, but atleast it doesn't get in my way.
Theres a new build tool, called Bldr. It uses Yaml for config, instead of xml like most of the build systems out there, and its highly extensible.
http://bldr.io
We use phing and it has come in handy. We don't use it for packaging, but it shouldn't be too hard to make it do what you are looking for. We mainly use it for common tasks such as clearing caches, building development sites, and other tasks to aide in development. Its been a big help, and from what I can gather it seems to be an ant clone, although it might not have all the functionality that ant has.
If I was to implement such a deployment system, I would probably opt for a slightly different solution from what you've outlined above. Instead of having code that runs locally on my system, connects to a list of remote servers and does the "work" there, I would pack the updater module with the rest of the code and have it pull the update data from my server on demand (or rather when I "told" it to do so). That way you have much less to worry about on your end (you just need to serve the updated code via http when requested, and the remote server handles the rest). Just my 2 cents.
I've written my own rsync like tool for this because i work from a very bad internet connection in a 3rd world contry and have all kinds of failures and starving connections so that rsync does not work.
On your remote system you should at least write a litte script that is doing backups before running migrations.
Better is you are using a total independent mirror system on your web host system and include some small but fundamental unit tests after a migration. Then do a root switching to put the updated website online. This would require to run a few interactive services in read-only mode during migration (unfortunately a feature that not many people implement).
But first of all - think if it is really worth your time doing this - if you only update each a quarter then a simple checklist on paper would be enough.
Related
For the last several years I have used jenkins/hudson and ant for my deployments.
But overall I find it quite heavy handed.
Is there a free, more lightweight software (preferable online) I can use?
What I need to do is
Grab my php files from git (based on time, commit or manual)
Replace some values in a config file
Push/Sync to a remote server
So far I have found http://www.deployhq.com and http://www.thoughtworks-studios.com/go-continuous-delivery
*Sorry if this is not the right overflow for this type of question.
There are indeed lots of different deployment solutions available.
For the workflow you describe, it might be worth considering BuildMaster. It's not hosted, but it's a pretty easy way to build (or in your case... test?) and deploy files. It would also manage your configuration files across different environments. For a simple example, check out how The Daily WTF is deployed using BuildMaster.
(disclaimer: I work for Inedo)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
My friend and I accepted simple PHP job, he has some experience working with a small team of developers and I'm new to this (and PHP to be honest :).
When I asked him about his environment I found out they (he and his previous team) never used source control, just a shared FTP server with a lot of mess. Now beginning this project I want to do it properly and use source control, I did some research and it looks like SVN is the simplest to use and fits our simple requirements.
My problem is that I don't really have an extra box to create a server... I have two options, one is to use my main windows machine as a server (it's always on so that's not a problem) BUT I can't always guarantee that it will be on when I'm far from home and I don't like how it will waste CPU cycles (It's also my gaming rig), the other option is to use an old laptop I have lying around (a Pentium 3 with about 128-256MB of RAM) and install the slimmest version of linux on it and the SVN server. it has the advantage of being simple, cheap and easy to maintain, but it has the disadvantage of being alow performing old laptop and having some uncertainty about it's reliability (I guess I'll set up some backup to my main machine).
Which option is better? I would prefer using the laptop but I'm unsure if its specs will slow us down, if I do use it, what version of linux would you recommend, and how simple is it to add some regular backup to it (I have almost no linux experience but I'm glad to learn).
PS. forgot to mention, both of us developing on windows machines.
EDIT: Most of you recommend Git and Mercurial, I think I'll go with mercurial because I read that git is more complicated, I really want the simplest solution that I can find. Unless git has some major advantage over mercurial? or maybe mercurial is the better one for the job?
Look at distributed version control systems like git and Mercurial (hg). Both have free/cheap hosting services (e.g., http://www.github.com and http://www.bitbucket.org) and are well suited for multiple developers working independently.
Also both have good tooling on Windows.
Why not use bitbucket/mercurial (hg)? You can set up (apparently) free private depots. Mercurial is crazy easy to use and is a lot newer (and rapidly gaining popularity) than svn.
Use git. It was designed and written by the guy who started Linux and he knows what he's doing.
You don't need a server for git, each user has a copy of the whole repository and you sync to each other. There is a bit of a learning curve, but if you're smart it will make you better developers.
DVCS like git is cool because you do not even need server. You basically just "synchronise" your code between each other here and there and due to fact that each repository has data from all repositories once is "synchronised" you do not need extra backup or server in most cases.
I found nice feature whit git (probably whit other VCS-s too) is that since they are just file based you can use any (free) cloud storage / ftp / git_server to backup your files in case of cataclysmic catastrophe.
I would highly recommend Mercurial (hg) as mentioned above, simple, easy to use and distributed. Personally, I prefer it slightly to Git and secondly its Windows support is better.
Bitbucket also lets you have free private repositories whereas Github is only free for public repos. Which I am guessing will be a factor if you are producing commercial code.
Why not go another route and get GitHub.com (pretty cheap, but costs a little) or BitBucket.com (this one is free for up to 5 users and unlimited repositories). You'll avoid a lot of headaches from maintaining your own servers.
If you want to host it yourself, check out subversion edge. Its a packaged svn that comes with apache and some management tools.
If you dont want to deal with admin stuff, check out beanstalk. They do hosted SVN.
Or, you could use something like git and github; but if you're really set on svn, check out beanstalk
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
i'm in a small team right now. We have two developers. We are developing PHP web applications. Now we have two servers. One is production server, the other is developing server. Usually my work-mate and I worked for different part of the project, but sometimes, we changed the same file. There was a source code version problem. As we are very small team, is there any light-weight version control strategy for us? We use different developing tools. I use VIM and my work-mate use Dreamweaver. Is there any source code control system support those editors?
Another question is how to control the synchronization between develop server and production server? Now what we do is just use ftp upload the files that we just tested on the
you have github(maybe by private account, because github is just amazing!) in your tag so I should suggest to just learn git(Command-line). It is the best in my opinion. One of the nice features of git is that it is distributed. I also bet if you search hard you could find plugins for both editors(like I did quickly):
git for vim.
git for dreamweaver.
But I would just use cli instead because it's power is just amazing.
As far as version control goes, Subversion is a popular choice, and easy to set up in my opinion. Looks like it can be integrated with Dreamweaver beginning with CS4, as well as VIM (although I don't have any direct experience with either of those plugins). Even without direct integration it's easy to use from the command line. I'm a big fan of RTFMing before digging into anything new, so the fact that the O'Reilly Subversion book is available as a free PDF on their website was a big plus for me.
For coordinating the move from development to production, my personal advice would be to automate as much as you possibly can - I've seen cases in which the migration is handled by a human with a checklist, and human error always seems to creep in eventually. If you're most comfortable with PHP, and you primarily access your servers via FTP, you could use PHP's FTP functions to automate moving the tested code from the development server to production.
Scenario : you can install subversion on production and developer server
Use svn and i suggest you add messages like +) for added stuff, -) for removed if that happen, o) for fixed bugs. This will help you latter.
Do commits as offen as you can
If you are not familiar with Tags and branches in SVN, just do the list of files that you are going to update on live server.
go to Live update.
Scenaria : you can't install subversion on production server
create a separate "live enviroment" on developer server
update it, when you see all works use any kind of FTP, SFTP to copy it to live server
Good luck
For version control almost any modern open source version control software will do,
For starters there is Subversion, mercurial, bazar, git. If you've never used one before I would recommend giving them all at least a quick look over to see what you like. My preference is git but the rest are all easy to use (ish). Most have companies that provide version control as a service (so you don't have to gaff with managing software yourself)such as github, launchpad, etc.
All have their benefits and downsides depending on your working style and project.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have been hearing a lot about the advantages of using a version control system and would like to try one. I was doing freelance web development in PHP for the past 2 years, two months back I hired two more programmer to help me. I will be hiring one more person soon. We maintain 4 websites, all of which are my own, which are continuously being edited by one of us. I learned PHP by myself and have never worked in any other firms. Hence I am new to version control, unit testing and all.
Currently, we have development servers on our workstations. When we edit a particular section of a site, we download the code for that particular section (say /news/ or /movies/ or /wallpapers/ ) from the production server to the dev server, makes the changes locally and uploads to the production server (no code review / testing). Because of this, our dev server is always out of date from our prod server. Occasionally, this also create problem when one of us forgets to download the latest copy from prod and overwrites the last change. I know this is very very foolish, but currently our prod server is the only copy that has all the updates and latest changes.
Can anyone please suggest which is the best version control system for me? I am more interested in distributed version control, since we don't have a central backup for all our code. I read about Mercurial and Git and found that Mercurial is used in several large open source projects by Mozilla, Sun, Symbian etc. So which one do you think is better for me? Not only version control, if there are any other package that I can use to make my current setup better, please mention that too :)
It sounds like Git can accomplish your goals quite well. As it's distributed, it's excellent for working locally since you can perform most operations (commit, revert, diff, patch) without connecting to a central server. You can also avoid that ugly moment of someone pushing new code to production while someone else is working on it, and then having the complicated task of merging those two versions of the code together (git provides a useful tool for doing this called rebase).
You noted there's some big projects using Hg (Mercurial), but there's some pretty big ones using Git, like the Linux Kernel, X.org, Android and Debian.
I use git for all my sites: it's lightning fast, efficient, and easy to use.
Edit: If you want to get into using Git, I'd recommend doing some reading before jumping right in. Starting off on the wrong foot can have some terrible implications later on. If you follow an Agile Workflow, you might want to check this out. Here's a website I learned most of my Git know-how from.
Version control is an incredible tool even when you're working alone, and when you are working with someone else it's indispensable. I would recommend using git. It's very fast, has a really great set of available tools, and of course has github.com. Mercurial is basically just as good as git, but it runs a little slower and doesn't have github.
For why to use git, please read http://whygitisbetterthanx.com/
Here's a nice-looking tutorial on getting started with git: http://www-cs-students.stanford.edu/~blynn/gitmagic/index.html
You can use SVN, Git, Mercurial.
The biggest challenge is having everyone be disciplined in using version control and not getting lazy.
Definitely Mercurial. Although you can use either Git or SVN, Mercurial is better for two reasons:
Vs Git: Good integration with Windows.
Vs SVN: It's distributed.
If you don't want to run yourself a Mercurial server (which is pretty easy anyway), there are many services available. Kiln + FogBugz is an EXCELLENT combination. There's also CodeBaseHQ (also supports Git and SVN), Bitbucket, and many more.
Before you jump onto it I strongly recommend you read at least Joel Spolsky's tutorial, but I strongly recommend you also read Mercurial: The Definitive Guide.
I am sorry, I had no intention of starting a DVCS holy war. I am going to try Git.
Yes, version control will help. To get started, I see two important issues for you:
hosted or self-managed? Do you want to host this yourself on a server, or want a service to take care of it for you? There are reasons to go either way, but if you're not that into managing the server look for a hosted option.
SVN or Git There are others, but these are the top open source contenders.
Pros and Cons (my opinion):
SVN: Good tutorials and fairly easy to get up-to-speed with. The training requirement is small (I've done a bit of it). SVN works really well with a co-located team, lots of projects, etc. With a limited number of branches (you may not need any), it is solid. There are plenty of integrations with other tools.
Git: Getting started can be a little rougher than with SVN. Some of the docs are good, but lots are geared assume a rather thorough understanding of the internals. Once you get the hang of it, it has great flexibility, but I've seen almost everyone who has started with it really stumble when beginning. Even after working with it for months, people debate the best patterns to use. It's really sweet for 1-person projects (where you want to track history), and for distributed projects like GitHub. I use Git even for small co-located teams, because I enjoy the speed and flexibility.
Given what you say about your team, though, I'd probably recommend trying SVN. There will be better resources to help you get going, and you'll be less likely to get frustrated with it.
Hope this helps.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am relatively new to the Web Development business. Me and 2 friends started up our own little company. 1 person is a designer, 1 person is sales / consultant, and I am the developer. Right now, its an after work project, but we hope to expand and let it become our full time jobs.
Anyway, my question to you, is what is the best way to go about a full web development project cycle.
List of things to discuss:
Proposals - do you guys find these important
Project Planning - how much planning and mapping out should there be?
Project Management Software - I did a
little research before and I like the
online portals. Parallels stood out
for me.
Editor tools - I have been using the
most basic editor Notepad++. I feel
like I should be using something more
advanced.
PHP Framework - I just got hooked on
CodeIgniter.
Ways to deploy site - right now I am
doing most of my editing via FTP to
the live site. Should I be working
on a local copy and then uploading to
a test site for the client? Then
eventually go to the live server.
Are there ways to automate this?
(best practice ?)
I cant wait to hear all your input, especially from folks who are veterans at it!
Proposals
This really depends on what sort of clientele you are looking at. It probably will not be necessary at the beginning of your company since you will be dealing with small to medium clients, but its not bad to get into the habit. When I did a bit of freelance web development, I did not work on a proposal-based system. Instead, I did more of a site mockup->changes->implementation system. I suppose a mockup is a form of a proposal...
Project Planning
Again, this depends on the size of the project. If you're working on a static 20-odd page website, you probably do not want to get too much into the planning aspect. However, if you are working with a site that pulls into a large number of technologies (forums, CMS, AJAX, web-services, etc.) you probably want to invest a little more beforehand.
Project Management Software
Cannot say I have ever used a project management tool during my days as a freelance web developer. I'd say don't invest in anything right now. Once your company grows, you'll have a better idea of what your requirements are.
Editor tools
Notepad++ may cut it now, but I wouldn't recommend it in the long-run. If you are looking at technologies other than PHP, I'd definitely not recommend it. In fact, if you are looking at a clientele that's more "business-user" esque you need to think about getting into ASP.NET or J2EE. I would suggest getting a PHP IDE that at least has code completion, as this can help eradicate a ton of PHP bugs. I'm not sure if Notepad++ has this. You also probably want to get a debugger that integrates into your IDE. I know Eclipse had a PHP IDE a few years back, but I'm not sure how good that is these days.
PHP Framework
Never really used any PHP frameworks but that's because I graduated and got a job before I had time to teach myself any of them. :) Go with whatever fits. You probably want to get used to more than one since some projects will fit better with some frameworks.
Ways to deploy site
Defintely, definitely get a local server set-up. You can get a WAMP/LAMP installation set up really easily on your dev machine. As others have said, you probably want to use source control because of Murphy's Law. Personally, I've been using wampServer the last few years as I haven't really been developing that much PHP and that allows me to get a working environment up really quickly. But you may wish to customize your devenv further. But you should definitely test your applications on a dummy server with a dummy database before deploying it to a live server with a real database!
Hope this helps!
Impossible to answer this fully in a single post here, but I'll give you some punchlines:
Proposals - do you guys find these important
Not sure what you mean by that? Sales proposals?
Project Planning - how much planning and mapping out should there be?
Don't spend too much time planning up front - it'll lose its value once you get further down the line. Do plan enough though. Usecases and some interface sketches/wireframes are good value.
Project Management Software - I did a little research before and I like the online portals. Parallels stood out for me.
You'll never find a golden bullet here. Use as little/simple as possible and always go for something with a clear exit route. Less is more. Also, keep in mind that this kind of tool needs to work for very different types of people, at the same time. The tool supports a process though, so keep that in mind - don't let the process be defined by the tool.
Editor tools - I have been using the most basic editor Notepad++. I feel like I should be using something more advanced.
Use what works for you. A good tool is nothing, unless you know how to use it. Likewise, if you know a simple tool well, you can get very far.
PHP Framework - I just got hooked on CodeIgniter.
The exact same applies as with editors.
Ways to deploy site - right now I am doing most of my editing via FTP to the live site. Should I be working on a local copy and then uploading to a test site for the client? Then eventually go to the live server. Are there ways to automate this? (best practice ?)
This should be high priority to change. At the very least, get your source code in a SCM - Subversion is the most mainstream, so I would suggest to use that. Second, get a separate development environment and production site. You develop at your dev setup, and when it's done, you deploy to the live site.
Next step is to look in to testing and automated deployment (google for that). But first things first - Get used to SCM and a separate dev/prod setup.
Finally, if you haven't read it already, Getting Real might be worth your time.
Proposals - Why not. Just don't overdo it. Don't let it become like this big corporate wall between you and your clients. You're small, be personal. That's your strength.
Project Planning - There's three of you? Skip project planning software.
Editor tools - If there's a specific function that Notepad++ doesn't have that you need, then switch editor. But don't switch just to feel more advanced.
PHP Framework - Keep an open mind and use what ever you get hooked on.
Ways to deploy site - Always work against a dev box. Some have test boxes with real-world data to test updates before deploying to the production box. Always version control your code. Whatever tool or method you use to deploy (really a matter of taste) keep a simple checklist with steps to go trough when deploying, and keep it up to date. Do automatic regular backups of your production box and actually do a reset and restore on a test box every now and then, and write down the steps needed to restore from backup.
As an editor, I strongly recommend jEdit. It's cross-platform, speaks many programming languages, has lots of plugins for extended functionality, macro record/save/playback, is actively maintained, and is very configurable.
For deployment, Subversion makes a lot of problems go away. For web development, I typically have two branches; devel and live. All changes are done in devel. When you're ready to publish the changes, a single svn merge operation applies the same changes to the live branch.
Subversion has hooks in its infrastructure to call scripts when certain events happen, like checking in software. A post-commit hook can automatically transfer (scp, ftp, unison, etc) the files onto either the devel server or the live server, depending on which branch the changes were. Now you have nearly immediate and automatic website updates whenever changes are checked it.
Another nice thing about Subversion is that it can hook into Apache to provide a WebDAV interface, so you can change files from anywhere without opening up Subversion itself through your firewall. If you need to make a quickie change from your day job, you can.