Jump to content


Photo

Version Control & Deployment

version control git deployment

  • Please log in to reply
6 replies to this topic

#1 evu

evu

    Privileged

  • Privileged
  • PipPipPipPip
  • 703 posts
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 19 June 2014 - 08:11 AM

Hi,

 

I've had a little experience with Git on a personal level, mainly to get to grips with it. In this case I had a local WP installation set up on ampps, I'd make changes and when I was happy I'd push the changes to Bitbucket and FTPloy would deploy them to my live server. No problem, simple enough.

 

Now, the question is, how does this work for a large ecommerce site? At work we have a dev server and the live server. At the momement, we simply use FTP to try things on the Dev server and when it's signed off, it just gets manually FTP'd to the live server. What I'm confused about is how do you try things if I don't have a local server set up?

 

I had planned on getting it set up so that things are pushed to the dev server, once it's signed off it gets merged with the live server code base and pushed to the live server. I don't understand how this works though, do I have to push/commit everything I want to try whilst developing to the dev server? That's a lot of hassle...

 

How do you manage such a use case?



#2 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 4,034 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 19 June 2014 - 11:12 AM

Why are you using FTP with git? You should be using SSH.  SSH and Git used in the terminal means you can deploy very quickly.  I'd probably quit my job if my place used FTP the difference is that vast.

 

Also if you're using git make sure you're using a .gitignore file so you don't commit local specific things like wp-config.php if using wordpress, .htaccess.  anything installed by grunt etc.

 

 

All the devs at my place have local servers, then we have a dev server.  Competed projects that are client approved then gt pulled down to the live server.


Edited by rbrtsmith, 19 June 2014 - 11:13 AM.

  • evu likes this

#3 evu

evu

    Privileged

  • Privileged
  • PipPipPipPip
  • 703 posts
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 19 June 2014 - 11:50 AM

I'm not "using" anything with git atm per se, and when I have used git for personal stuff that's how I did it though, I dunno, maybe because it's still quite new to me and I'm not fond of CL work..

 

Yeah, I have considered that thanks :)

 

That's the problem though with this situ @rbrtsmith, we can't have local servers, we don't have full access to the entire codebase (back-end stuff, think magento go stylee) but we do have access to the template files/css/js/etc. So I just don't see how it can be done easily when you have to push everything to the dev server. A typical case is when you keep adjusting and doing minor changes in css/js over the course of a few hours, this would mean lots and lots of minor pushes which is a hell of a lot of hassle compared to just dragging and dropping a file in an ftp client. Maybe I'm misunderstanding how it works entirely..?

 

Cheers.



#4 junior

junior

    Privileged

  • Privileged
  • PipPipPipPip
  • 636 posts
  • Gender:Male
  • Location:Leeds, UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 19 June 2014 - 12:41 PM

I use Git on a daily basis for version control and deployments even on a large scale.

 

Once set up it is easy to deploy a site.

 

As rbrtsmith says you shouldn't try and use Git and FTP as this will cause errors when you deploy. If you are making minor changes to the CSS etc then are you doing this locally before deploying it?

 

One good thing about Git is that many people can be working on the same project and often the same files at the same time.


  • evu likes this

#5 evu

evu

    Privileged

  • Privileged
  • PipPipPipPip
  • 703 posts
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 19 June 2014 - 01:17 PM

As rbrtsmith says you shouldn't try and use Git and FTP as this will cause errors when you deploy. 

 

If you are making minor changes to the CSS etc then are you doing this locally before deploying it?

 

Well the plan is to make the changes and have Beanstalk deploy the changes to the live site once it's tested so shouldn't need to touch the ftp.

 

In response to your question, that's the trouble I'm having understanding.

 

At the moment the set up is this:

 

Test/Development Server (internal access only)

 

Live/Production Server (public facing)

 

When a change is requested, I connect to the dev server via ftp, download the files to change, work on them and upload back to dev server. And so on until I've done whatever I was asked to do. Then that server is checked and if everything is okay, I tell someone what files changed, they take them from the dev server and upload to the live server.

 

We only have access to the front end (templates, js, css, etc). All heavy backend stuff is managed by a third party and isn't accessible nor is it possible to have a local (my machine) version because it's managed by a third party. 

 

So, how am I supposed to work on the dev server if git is in the way and everything needs to be pushed to the dev server again and again? This is why I think I may have a misunderstanding on the process. I work for a company as big as Argos, New Look, etc. I am sure they have version control though.

 

What I had hoped to have set up is this:

 

*(insert bit I don't get, lets pretend I do have a local version)* I make the changes as requested, those are then pushed to the dev server. Once it's tested and signed off, those changes are pushed and merged with the live server code and Beanstalk takes care of deployment to the live server.

 

So that bit in *(...)* is where, as I understand it, is where a local version should be. But as this is not possible, how do other companies do it? I should mention the third party that handles the back-end of the site also manages other well known big brand sites too, at least some of them must have version control set up...

 

It's getting very annoying and I can't find answers anywhere :(

 

Thanks.

 



#6 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 847 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 13 July 2014 - 04:23 PM


Well the plan is to make the changes and have Beanstalk deploy the changes to the live site once it's tested so shouldn't need to touch the ftp.

 

In response to your question, that's the trouble I'm having understanding.

 

At the moment the set up is this:

 

Test/Development Server (internal access only)

 

Live/Production Server (public facing)

 

When a change is requested, I connect to the dev server via ftp, download the files to change, work on them and upload back to dev server. And so on until I've done whatever I was asked to do. Then that server is checked and if everything is okay, I tell someone what files changed, they take them from the dev server and upload to the live server.

 

We only have access to the front end (templates, js, css, etc). All heavy backend stuff is managed by a third party and isn't accessible nor is it possible to have a local (my machine) version because it's managed by a third party. 

 

So, how am I supposed to work on the dev server if git is in the way and everything needs to be pushed to the dev server again and again? This is why I think I may have a misunderstanding on the process. I work for a company as big as Argos, New Look, etc. I am sure they have version control though.

 

What I had hoped to have set up is this:

 

*(insert bit I don't get, lets pretend I do have a local version)* I make the changes as requested, those are then pushed to the dev server. Once it's tested and signed off, those changes are pushed and merged with the live server code and Beanstalk takes care of deployment to the live server.

 

So that bit in *(...)* is where, as I understand it, is where a local version should be. But as this is not possible, how do other companies do it? I should mention the third party that handles the back-end of the site also manages other well known big brand sites too, at least some of them must have version control set up...

 

It's getting very annoying and I can't find answers anywhere :(

 

Thanks.

That sounds like a really messy workflow.

 

Here's how we do it:

 

ALL development happens on your local machine. You NEVER connect to a remote server for development purposes.

 

Each environment is a clone of the exact same repository, so for us that means:

 

- local machine

- INT (integration) environment

- Test

- Stage

- Production (live)

 

This is probably more environments than most teams will need. You will probably be able to get away with staging and production, most likely. There are reasons we need this many environments, but we don't need to go into those details.

 

Each environment has a copy of the entire Git repo - your local environment is no different to INT/Test/Production in that regards.

 

All work is done on feature branches, and no work is ever committed to the master branch directly. Master is considered working, tested code, so we only ever MERGE into master from one of our tested feature branches.

 

We never need to start with something like your first step, where files are downloaded from a dev server, because every repo is the same, so we just start working locally. Do your changes on a feature branch then when they're tested and you're happy (I'm missing a step because we actually do a whole code review process at this point), merge into master. We then push master to Int/Test and get our testers to test the feature out.

 

Once they are happy, the changes are deployed to live.

 

You should never be downloading individual files, and you shouldn't have to tell anyone which files have changed, because every environment is a git repo, so you can see which files have changed without ever having to track them.

 

 

Here are a few handy links: http://code.tutsplus...tory--net-25982

 

Also this video (haven't watched, but it looks relevant):

 

Hope that helps a bit?


Edited by citypaul, 13 July 2014 - 04:25 PM.


#7 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 847 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 13 July 2014 - 04:27 PM

Just realised you'd said you can't get a local copy? You need to speak to that third party and ask for access to their repository. Everything should be in version control, and your changes need to be in there too. If they are using Git, it really shouldn't be a problem to give you full access. I'd start by asking them?







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users