Deployment

113 views
Skip to first unread message

johnamazindavies

unread,
Oct 11, 2014, 7:31:30 PM10/11/14
to ph...@googlegroups.com
Hi,

I have 3 different servers, live, test and dev. I use git to keep all 3 up-to-date.

I'm looking for a solution that can do something like continuous deployment, where the solution monitors git test or live for changes, when changes occur it logs into live or test servers and does git pull etc.

Can anyone suggest solution or tell me, their setup.

Any help appreciated
John

Paul Waring

unread,
Oct 12, 2014, 4:01:32 AM10/12/14
to ph...@googlegroups.com
Instead of pulling changes from git, which requires regular polling, why
not use hooks? These allow you to run scripts on the client or server at
certain points - for deployment you might want a post-receive hook:

http://git-scm.com/book/en/Customizing-Git-Git-Hooks

Paul

--
Paul Waring
http://www.phpdeveloper.org.uk

Adam Westbrook

unread,
Oct 12, 2014, 5:42:53 AM10/12/14
to ph...@googlegroups.com

We started using Bamboo a few months ago and it's been a god send - https://www.atlassian.com/software/bamboo

We have a similar set up to yours -- local dev, a staging server and 4 production servers. We have it set up to monitor our Bitbucket repos on certain branches (master and release/x) and build/test automatically when it sees changes. We can then deploy those builds to staging or production as we need.

The other CI option we considered was Jenkins but I don't think it has the dedicated 'deployment' side that Bamboo does.

Regards,
Adam

--
--
You received this message because you are subscribed to the Google
Groups "PHPNW" group.
Post to list: ph...@googlegroups.com
Unsubscribe: phpnw+un...@googlegroups.com
Archive: http://groups.google.com/group/phpnw?hl=en

PHPNW Website: http://phpnw.org.uk/
twitter: http://twitter.com/PHPNW
Events: http://upcoming.yahoo.com/group/4709/
LinkedIn: http://www.linkedin.com/e/gis/112906/3FCE41597A1B
Facebook: http://www.facebook.com/group.php?gid=17897252075
IRC: #phpnw (irc.freenode.net)

---
You received this message because you are subscribed to the Google Groups "PHPNW" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpnw+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Proffitt

unread,
Oct 13, 2014, 8:47:01 AM10/13/14
to ph...@googlegroups.com
Hi

There are a number of different deployment methods out there. As already mentioned, Bamboo is one which is built nicely into the CI platform. You can orchestrate releases with Jenkins using the release plugin (https://wiki.jenkins-ci.org/display/JENKINS/Release+Plugin) but it does require a little work to set-up. An alternate solution would be to use something like XLDeploy http://xebialabs.com/products/xl-deploy/

I would not recommend using pure git-hooks for this unless you are triggering the hooks from your CI platform. The problem with hooks directly is you can end up with development code being accidentally released onto your live platform without it going through your QA pipeline. 

Hypothetically in your scenario using git-hooks, if someone pulls code onto dev, the hook will see the changes and trigger the pull to staging which in turn triggers a pull to live before any QA could be carried out (unless you use a blocking commit).

Hope this helps

Martin

John Davies

unread,
Oct 18, 2014, 5:12:17 PM10/18/14
to ph...@googlegroups.com
Hi,

Thanks everybody for your help. I have this week been exploring the deployment systems mentioned above, and I think I'm quite liking the look of Bamboo. 

The documentation looks quite comprehensive, but due to my inexperience with things like this, I'm not sure how best to do it.

The setup I have is Git installed on the 3 different servers. Occasionally external developers may do a minor tweak to the site, or the client adds a file using FTP or say Wordpress media uploader on to the live site. So what I do prior to a pull on the Live site is do GIT commit/push etc. Then do the GIT Pull.

Can this build scenario be catered for using deployment systems or should I disable FTP access and require all changes to go through the deployment process and use some sort of Symlink scenario on the Wordpress uploads/plugins folder?

John




John Davies

Azizur Rahman

unread,
Oct 19, 2014, 6:02:22 AM10/19/14
to ph...@googlegroups.com
At work we have slightly more complicated deployment. I will try to explain here. No doubt I may miss some details.

Dev <-> SCM (GIT) <- Jenkins (build and generate rpms then pushed into rpm repo) -> deploy into INT.

Once the application is deployed into INT it can be rolled forward to TEST by testers.
Once a release is in TEST and we have done a demo and signed off we may push to LIVE.

Given almost all of our applications are SOA (Service Orientated Architecture) they do not store any data.

For those applications deals with UGC (user generated content (for example you mention: WordPress uploads)). Some applications will upload the UGC into S3 buckets and use that. RPM generated above will have all details for connecting to S3 and other systems.


Kind Regards,
Azizur Rahman

----
Do you need cost-effective web hosting solution and Domain name try http://prodevstudio.com

Missed the last Friday Khutbah, try catchup a Khutbah on-line now at http://fridaykhutbah.com

Adam Westbrook

unread,
Oct 19, 2014, 6:14:37 AM10/19/14
to ph...@googlegroups.com

Hi John,

Your final paragraph is about right, doing everything through git/Bamboo obviously has the added advantages of seeing who added what and keeping all your devs in sync, but also allows you (or whoever you trust) to control what is deployed where, handy if you expand the number of devs you work with!

I've not worked with WordPress plugins in a long time, I'm presuming you have to include the plugins with your project files (rather than using something like Composer)? If so I would install plugins on local/dev, build and package everything up in Bamboo then push the whole thing out to your other servers. Ideally you want to avoid adding new code (i.e installing plugins) on production servers and having to sync it back down. Obviously if you need clients or devs to install plugins on live sites that might not be doable, but its not an ideal set up.

Thanks,
Adam

Azizur Rahman

unread,
Oct 19, 2014, 6:36:18 AM10/19/14
to ph...@googlegroups.com
In regards to managing WordPress Plugins I normally test the plugins on dev env. If everything is good I'll make those plugins as subtree (not submodule) in my git project that way I can easily upgrade them by pulling from respective plugin developer repo.

The reason I use subtree because its means I'll have all the files part of the parent project. where as submodule the parent project will need to init those submodules to get the files.

Kind Regards,
Azizur Rahman

----
Do you need cost-effective web hosting solution and Domain name try http://prodevstudio.com

Missed the last Friday Khutbah, try catchup a Khutbah on-line now at http://fridaykhutbah.com

John Davies

unread,
Nov 22, 2014, 5:14:45 PM11/22/14
to ph...@googlegroups.com
Hi,

Thanks to everyone who helped me with this topic, it was very useful to hear the different suggestions.

Thanks
John
--

John Davies

John White

unread,
Nov 25, 2014, 9:25:26 AM11/25/14
to ph...@googlegroups.com
Hi,

Another option could be circleci, I've been using it for the last few months and I'm very impressed.

https://circleci.com/

They also made their base plan free last week so you can't go wrong (includes private repos).

John.

Matthew Setter

unread,
Sep 30, 2015, 6:44:28 AM9/30/15
to PHPNW
Hi John, 

I'm not decrying the deployment solutions recommended so far, but do you need that? Or could a more manual process help? One tool I've been playing with recently is deployer (http://deployer.org/). It's similar to capistrano and phing, in that you write or make use of existing deploy tasks, which are then run on the remote server(s). The tool clones a nominated git repository and can run a number of tasks, such as composer install, checking for the presence of directories and so on. It's also handy in that it can maintain several releases, in case you need to quickly rollback.

Matt
Reply all
Reply to author
Forward
0 new messages