Sublime Forum

Question for web developers

#5

Thanks for the reply. I have tried mounting the drive using transmit and your right that does solve the problem. I think I’m just used to navigating a server via transmit, I really like the “Go To” feature so I can type out the directory paths. If I mount it local then I have to use finder which by default won’t see .htaccess and other files I may need to edit.

Thanks again for the reply, I knew I couldn’t be the only person doing web development on remote servers.

0 Likes

#6

BestGreek, do you use any type of version control? If you don’t, I strongly recommend it. It sounds scary, and even pointless if you’re a one-man operation, but it really isn’t! It has changed the way I develop websites, and now I pretty much never use FTP software. Here is my process:

Development

  1. Setup GIT repository in Beanstalk (http://beanstalkapp.com/) for new website
  2. Develop new website locally (running on MAMP or WAMP server)
  3. Commit all code to Beanstalk as I go
  4. Test site locally
  5. Deploy, when ready, to production server using Beanstalk’s very handy deployment tools

Maintenance

  1. Make change locally
  2. Test change locally
  3. Commit change to Beanstalk
  4. Deploy change from Beanstalk to production server

Github is great too (and a little cheaper), but being new to version control I found Beanstalk a little more approachable. Also, their deployment tools are totally awesome - they make the transition from FTP a lot easier.

Finally, you can manage GIT using command line (lots of people do), but I have found Tower (http://www.git-tower.com/) to be more my style.

Hope that helps. :wink:

0 Likes

#7

Have you tried using the sidebar in Sublime Text? Just drop your whole FTP folder into it, and you will see the files hidden by the OS. You can then use the handy CMD-P file search to local your files. Just another option!

0 Likes

#8

[quote=“jonathan”]BestGreek, do you use any type of version control? If you don’t, I strongly recommend it. It sounds scary, and even pointless if you’re a one-man operation, but it really isn’t! It has changed the way I develop websites, and now I pretty much never use FTP software. Here is my process:

Development

  1. Setup GIT repository in Beanstalk (http://beanstalkapp.com/) for new website
  2. Develop new website locally (running on MAMP or WAMP server)
  3. Commit all code to Beanstalk as I go
  4. Test site locally
  5. Deploy, when ready, to production server using Beanstalk’s very handy deployment tools

Maintenance

  1. Make change locally
  2. Test change locally
  3. Commit change to Beanstalk
  4. Deploy change from Beanstalk to production server

Github is great too (and a little cheaper), but being new to version control I found Beanstalk a little more approachable. Also, their deployment tools are totally awesome - they make the transition from FTP a lot easier.

Finally, you can manage GIT using command line (lots of people do), but I have found Tower (http://www.git-tower.com/) to be more my style.

Hope that helps. :wink:[/quote]

I totally agree its crazy to edit a live site. In my own case I am editing on a live server but its a development server. Once something is ready I do commit it (subversion) and then update the production server with “svn update”. I am on a mac and I have used MAMP but I didn’t like it. I prefer to build on the exact same system my code will run against. I think if I was going to go the route of local development I’d probably create a Vmware instance of Centos and mount that as a drive.

Also a lot of projects I do are just messing around and trying new things out and in those cases it dosen’t matter if its right on the server since its only for me.

I have tried bean stalk but I ended up just settings up my own svn server and using that. I haven’t had a project that used GIT yet but I do love github and I will probably find a reason to use git soon.

I’ll go take another look at MAMP incase its improved, but last time I used it the whole thing felt very clunky to me.

Thanks for the reply, its really interesting to hear how other developers do similar work.

0 Likes

#9

[quote=“jonathan”]

Have you tried using the sidebar in Sublime Text? Just drop your whole FTP folder into it, and you will see the files hidden by the OS. You can then use the handy CMD-P file search to local your files. Just another option![/quote]

I have tried that yet but thanks for the idea, I’ll try it tonight.

0 Likes

#10

[quote=“BestGreek”]I’ll go take another look at MAMP incase its improved, but last time I used it the whole thing felt very clunky to me.

Thanks for the reply, its really interesting to hear how other developers do similar work.[/quote]

No worries! I find it interesting myself.

As for MAMP, yeah, don’t get too excited. It works…but that’s about it. Really, I mean any sort of local web server…whatever your flavour is. I just find developing locally so much faster. I cannot stand waiting for a file to upload on each save. If you have a laptop and are traveling (with no Internet connection), you can continue to develop as well.

0 Likes

#11

I used to edit files locally and upload it via FTP to production servers like you, then I took an arrow to the knee. Since then I use Subversion to commit the project files to my central online repository from which I checkout files to the production server. I’m considering migrating to git.

0 Likes

#12

I use a VM to dev on my mac, mount that as a local drive via Transmit, add the site/folder to a project in Sublime Text 2 and edit the files as needed, manage the code via git (github) on the command line and rsync to whatever box i need to when im done.

BTW, If you use the sidebar in Sublime Text, you can drag in two folders, and if the file names that you open are the same, the name of the folder will be appended to the file name in the file tab. eg index.php - folder 1 and index.php - folder 2.

Further to this, if the folders that you have dragged in are also named the same, the path to each file will be appended to the file name in the file tab. eg /site1/www/index.php and /site2/www/index.php

0 Likes

#13

[quote=“matt-g”]I use a VM to dev on my mac, mount that as a local drive via Transmit, add the site/folder to a project in Sublime Text 2 and edit the files as needed, manage the code via git (github) on the command line and rsync to whatever box i need to when im done.

BTW, If you use the sidebar in Sublime Text, you can drag in two folders, and if the file names that you open are the same, the name of the folder will be appended to the file name in the file tab. eg index.php - folder 1 and index.php - folder 2.

Further to this, if the folders that you have dragged in are also named the same, the path to each file will be appended to the file name in the file tab. eg /site1/www/index.php and /site2/www/index.php[/quote]

Thanks, I was thinking about possibly doing it this way. From all the options available right now this is what I’ll likely do. I still wish when opening remote files it showed the proper file path. At my day job we have a proprietary development language and its not possible to run locally. At least for my own projects this solution will work really well.

Thanks for sharing the idea, its great to here other dev’s way of working.

0 Likes

#14

As a Web Developer in Linux I mount my SFTP projects trough sshfs.
And my FTP projects I mount trough curlftpfs.
Both are really handy.

~Juje007

0 Likes

#15

@matt-g: Can you explain this a little further? I have been looking at alternatives to MAMP. What software do you use for your VM? What OS are you running on the VM? Thanks!

0 Likes

#16

for those on Windows who want to mount s/ftp as a drive, google netdrive. It is free for personal use.

0 Likes

#17

[quote=“jonathan”]

@matt-g: Can you explain this a little further? I have been looking at alternatives to MAMP. What software do you use for your VM? What OS are you running on the VM? Thanks![/quote]

I don’t know what he is using but you can use “VMware fusion”. Then any linux distro you want will work, I personally use Cento OS 6. After you setup the VM you use use the ipaddress to access it, or you can use your Mac’s host file to give it a domain name.

If this is something your interested in doing you probably need to be comfortable setting up the linux install from scratch. If you need more detailed steps how to go about this let me know, or maybe matt-g will have more details.

0 Likes

#18

Thanks for the feedback. I’m comfortable setting up a Linux box. My current web host is a Linode “slice” which I installed Ubuntu on. That’s sort of what I want, because it’s so easy to customize. MAMP is great if all you need is MAMP as it is out of the box.

Running Linux in a VM seemed like a good (if not somewhat slow) way to create the ideal development server. However, I’m new to Max/OSX, so I’m not sure what other devs are doing out there. Surely not everyone is using MAMP!?!

0 Likes

#19

[quote=“jonathan”]

Thanks for the feedback. I’m comfortable setting up a Linux box. My current web host is a Linode “slice” which I installed Ubuntu on. That’s sort of what I want, because it’s so easy to customize. MAMP is great if all you need is MAMP as it is out of the box.

Running Linux in a VM seemed like a good (if not somewhat slow) way to create the ideal development server. However, I’m new to Max/OSX, so I’m not sure what other devs are doing out there. Surely not everyone is using MAMP!?![/quote]

I have in the past run a VM and tried to have as close a match as possible to my production server and this works great. When I’m working on something less critical I work on a remote server directly. In one instance I have a development site and production site on the same server. After development is completed/QA’ed I commit the changes then go to the production directory and update the files. In my cases I don’t have to change server settings or packages, I just edit/write php code so there is little to no impact on the production server. There are downsides to doing this but one upside is if something works on development it will work in production being they are the same box.

0 Likes

#20

[quote=“BestGreek”]Thanks for the feedback. I’m comfortable setting up a Linux box. My current web host is a Linode “slice” which I installed Ubuntu on. That’s sort of what I want, because it’s so easy to customize. MAMP is great if all you need is MAMP as it is out of the box.

Running Linux in a VM seemed like a good (if not somewhat slow) way to create the ideal development server. However, I’m new to Max/OSX, so I’m not sure what other devs are doing out there. Surely not everyone is using MAMP!?![/quote]

my production box is also linode (used to be slicehost until they sold out and began to suck) with ubuntu and i do local dev on an identically set up ubuntu install in a VM using vmware fusion.

a while ago, i wrote a tutorial on how to clone your production VPS to a VM. that tutorial lives here.

i hope that helps someone.

0 Likes

#21

[quote=“pjv”]my production box is also linode (used to be slicehost until they sold out and began to suck) with ubuntu and i do local dev on an identically set up ubuntu install in a VM using vmware fusion.

a while ago, i wrote a tutorial on how to clone your production VPS to a VM. that tutorial lives here.

i hope that helps someone.[/quote]

Cool! Will check that out. By the sounds of it VMware Fusion is the choice over Parallels for this setup?

0 Likes

#22

[quote=“jonathan”]

[quote=“pjv”]my production box is also linode (used to be slicehost until they sold out and began to suck) with ubuntu and i do local dev on an identically set up ubuntu install in a VM using vmware fusion.

a while ago, i wrote a tutorial on how to clone your production VPS to a VM. that tutorial lives here[/quote]

.

i hope that helps someone.

Cool! Will check that out. By the sounds of it VMware Fusion is the choice over Parallels for this setup?[/quote]

I haven’t used Parallels for a few years so I can’t say but I would expect it would work fine. I can only say VMware Fusion will work and I’m happy with it.

0 Likes

#23

i use fusion because i have been using vmware products for a long time. i’ve never used parallels. i’ve played around a bit with virtualbox but it was a bit fussy to set up compared with fusion (though it is free and fusion costs some dollars).

i can’t think of any reason that any of the three wouldn’t work perfectly fine for this purpose. if you can install your linux of choice in a VM and if it has network connectivity (and how could it not?), then you should be able to follow my recipe with some very minor modifications with either parallels or virtualbox.

0 Likes

#24

Over the years I think I’ve tried every solution (first with TextMate, then with Sublime Text 2) in this thread and while I’ve had decent luck with some of them, they’ve all come up short. So I made something that, so far, has worked great (for me). However, right now you should not try it unless all the follow are true about you.
[ul]
[li]You are using OS X.[/li]
[li]You know ‘enough’ git.[/li]
[li]You have git installed on your web server.[/li]
[li]You are using homebrew.[/li]
[li]You are using pip.
[/li][li]And some other stuff. If you look over the documentation, sparse though it is, you should get some idea.[/li][/ul]

It’s called GitSync.
github.com/ClockworkNet/GitSync

Basically it allows you to work on your local file system. Then anytime you ‘save’ (you write to the file system) GitSync which you run in the ‘background’ will pick up your changes and, using git and fabric (via ssh) it will send the changes to your websever server. There are a lot of advantages of doing it this way, some of them are.

[ul]
[li]Git keeps track of all your changes, so it’s like having a version history for everything. It’s not super useful because it contains almost every little change, but if you wanted something back you could get it.[/li]
[li]If things change on the server, say from a coworker also working on the same files, it won’t throw it away and hopefully it will merge everything smoothly. This is where it really helps to know something about git though because if you get ‘conflicted’ you’ll have to sort it out on your own.
Because, as far as sublime text is concerned, you are working on the local file system, everything is super fast.[/li]
[li]Even if you have a slow internet connection, it does not need to slow you down. You might have to wait a few extra seconds before you refresh the website you are working on but that’s way better then having to wait, even a half second, every time you save a file.[/li]
[li]and many many more.[/li][/ul]

So this software is alpha. However I have used it a lot and for several months now and it has made my life so much better. So I figured I should start spreading the word. Who knows maybe some of you will be inspired to help me take out the rough edges.

One big unknown, is if you are currently using git as your version control system, can this play nicely with it? Currently where I work we are still using svn so that has not really been a problem. I use svn for source code control and git for syncing.

Please let me know if you have any suggestions or ideas or bugs, and especially if you would like to help.

Thanks.

0 Likes