Your SlideShare is downloading. ×
0
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
MODXpo - Continuous Integration and Deployment
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

MODXpo - Continuous Integration and Deployment

1,607

Published on

Just over a year ago we (Adido) decided to adopt MODX as our primary CMS in favour of our in-house platform Dub3 - one that we'd been using for almost 10 years. …

Just over a year ago we (Adido) decided to adopt MODX as our primary CMS in favour of our in-house platform Dub3 - one that we'd been using for almost 10 years.

As a full-service Digital Agency servicing over 300 clients both in the UK and Europe we faced a number of challenges, whilst also giving ourselves the opportunity to revisit our methods of Continuous Integration & Deployment.

We've learned a number of lessons along the way working with MODX, from continuously building new features within teams of multiple developers to deploying to scalable server farms.

Jenkins, RunDeck and Rackspace; if you're a fan of these then you'll have an insight into what we'll be exploring in this session, and what our guys at Adido are up to.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,607
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
19
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Introduce AdidoThe team I’m going to talk about today…. (CHANGE)
  • The Studio & Support
  • This is not **THE** solution
  • POLL – Who doesn’t use some form of Version Control
  • POLL – Who doesn’t use git?POLL – Who uses GitHub over BitBucket?
  • POLL – Who doesn’t **write** tests (manually tests)
  • POLL – Who’s accidently left a config file pointing to the demo site?
  • Steve will expand on this…
  • Transcript

    • 1. Continuous Integration & Deployment Chris Cherrett @chrischerrett chris.cherrett@adi.do Bournemouth, UK
    • 2. 30+ employees Marketing, Web Build & Support Creative Studio Tom Project Manager Laura Designer Chris Developer Mark PHP Developer Thom Frontend Developer Bournemouth, UK
    • 3. Creative Studio Support 1 x Project Manager 1 x Designer 3 x Developers 1 x Support Manager 2 x Developers
    • 4. Confession We used to be a .NET agency (and we built a CMS)
    • 5. • Built in-house • Our primary platform for almost 10 years • 300+ websites Time to move on…
    • 6. • Community • Customisation • Easier for clients
    • 7. Opportunities to review How we build websites How we deploy websites
    • 8. The .NET days • SVN for version control (hosted internally) • Local IIS or Visual Studio Server • rsync to single ‘demo’ or ‘live’ site
    • 9. rsync • .bat files initiate sync • Diff local repo with remote before sync • If local version out of date, stop and update • • Checkout, merge (cross fingers) Possible to sync and never commit • Review sync.log on server to identify offender • Edit .bat to change destination or source DB
    • 10. Remote Desktop • The devil on your shoulder • Direct access to files on server • Quick fixes • Sync would overwrite edits • Short term fix, long term headaches • All developers had access
    • 11. Dedicated Servers • Not immediately scalable • Expensive
    • 12. This worked fine for a long time Room for human error Required an inherent knowledge of our infrastructure Not great for growth
    • 13. New ideas! Mark @markwillis82
    • 14. “create and configure lightweight, reproducible and portable development environments” Wrapper around VirtualBox, Chef, & Puppet (now also works with VMware)
    • 15. Files sync with host Every developer works with exactly the same environment, irrespective of their chosen OS Centrally configured with Puppet
    • 16. > vagrant up
    • 17. > vagrant up
    • 18. /dev/Vagrantfile
    • 19. CI Server • Puppet localhost:2002 localhost:2000 localhost:2004 > cd dev > vagrant up
    • 20. Live Servers CI Server • localhost:2002 localhost:2000 localhost:2004 > cd dev > vagrant up Puppet
    • 21. Alternative Method DNS wildcards
    • 22. http://******.chris nginx config http:// project1.chris CI Server • Puppet project2.chris project3.chris project4.chris project5.chris
    • 23. Ok... What’s next ?...
    • 24. Version Control Keep your work safe
    • 25. • Free Private Repos • (Potentially) more reliable than GitHub
    • 26. Local Environment • Vagrant (VirtualBox) • git • IDE independent
    • 27. Let’s use those… …to go one step further
    • 28. Continuous Integration • Prevent integration problems • Merging can be a scary thing • Automated testing • Run periodically or after every commit • …report results – email, HipChat
    • 29. Continuous Integration • Branch every feature • Write tests for that feature • Commit and Push • CI server is waiting for you… Jenkins
    • 30. Jenkins • ‘Detects’ new commit (actually, BitBucket tells him) https://bitbucket.org/adido/jenkins-bitbucket-connector/ • runJobs() or createNewJobs() • A set of jobs for Master, and every branch • Parent jobs • Child jobs
    • 31. Tests • phplint • unit tests • behat
    • 32. Behat “Behat is a tool that makes behavior driven development (BDD) possible. With BDD, you write human-readable stories that describe the behavior of your application. These stories can then be autotested against your application. And yes, it’s as cool as it sounds!”
    • 33. Behat Feature: Your first feature In order to start using Behat As a manager or developer I need to try Scenario: Successfully describing scenario Given there is something When I do something Then I should see something
    • 34. Behat Feature: A MODX website with multiple contexts Scenario: Successfully loading the correct context When am on "/" Then I should see "Venues & Centres" And I change to "littledown" context Then I should see "Membership" And I should see ”Swimming" Then I change to "web" context And I should see ”About Us"
    • 35. Behat /** * @When /^I change to "([^"]*)" context$/ */ public function iChangeToContext($newContext) { $currentUrl = $this->getSession()->getCurrentUrl(); // store the current url as the correct context if($newContext !== "web") { $this->defaultContext = $currentUrl; $newUrl = str_replace("http://", "http://$newContext.", $currentUrl); } else { $newUrl = $this->defaultContext; // switch back to the original url } $this->getSession()->visit($newUrl); }
    • 36. Jenkins • Not just for testing, but also… • Serving multiple demo sites
    • 37. Jenkins • Browse every branch on the CI server • http://feature-1.project.ci-server.com • http://feature-2.project.ci-server.com • Requires wildcard DNS administration
    • 38. What about databases? What can we do there?
    • 39. Database /core/config/config.inc.php $database_type = 'mysql'; $database_server = 'db.server'; $database_user = ’db_user'; $database_password = ’xxxx-xxxx-xxxx'; $database_connection_charset = 'utf8'; $dbase = ’modx_database_name'; $table_prefix = 'modx_'; $database_dsn ='mysql:host=db.server;dbname=modx_database_name;charset=utf8';
    • 40. Database • Sync database differences • Compare schema • Compare data • MySQL Workbench, among others • Case-by-case basis
    • 41. Merge & Deploy Let’s push this feature live!
    • 42. • Use BitBucket to create pull requests • Feature is reviewed • Branch is merged with master, and closed • Master tests run • On success, site is deployed using Jenkins • RunDeck • Abstracts out deployment
    • 43. This sounds like a lot of work… Can we automate this some more?
    • 44. So, to Finish Let’s go back to the start…
    • 45. New Projects Node.js app: “toolbelt”
    • 46. New Projects • • • • • • Clone base MODX repo to local machine Create new BitBucket repo (API) Remove remote origin from local repo Add new BitBucket origin to local repo Create hook (API) Push repo • Jenkins creates Jobs
    • 47. Thank you #MODXpo

    ×