{"id":1837,"date":"2017-02-02T11:18:04","date_gmt":"2017-02-02T11:18:04","guid":{"rendered":"http:\/\/2017.london.wordcamp.org\/?post_type=wcb_session&#038;p=1837"},"modified":"2017-09-11T12:35:28","modified_gmt":"2017-09-11T11:35:28","slug":"wordpress-dev-ops-for-beginners","status":"publish","type":"wcb_session","link":"https:\/\/london.wordcamp.org\/2017\/session\/wordpress-dev-ops-for-beginners\/","title":{"rendered":"WordPress Dev Ops for Beginners"},"content":{"rendered":"<p>A run through of dev ops for beginners covering some basics to get your started:<\/p>\n<ol>\n<li>Git &amp; Version Control<\/li>\n<li>Dependence Management<\/li>\n<li>\u00a0Automation<\/li>\n<li>Deployments<\/li>\n<\/ol>\n<hr \/>\n<section id=\"slides\" class=\"session--slides\">\n<h2>Slides<\/h2>\n<iframe src='https:\/\/www.slideshare.net\/slideshow\/embed_code\/66721408' width='604' height='495' sandbox=\"allow-popups allow-scripts allow-same-origin allow-presentation\" allowfullscreen webkitallowfullscreen mozallowfullscreen><\/iframe>\n<\/section>\n<section id=\"video\" class=\"session--video\">\n<h2>Video<\/h2>\n<div id=\"v-ShIfuKnR-1\" class=\"video-player\"><iframe title='VideoPress Video Player' aria-label='VideoPress Video Player' width='604' height='338' src='https:\/\/videopress.com\/embed\/ShIfuKnR?hd=1&amp;cover=1&amp;loop=0&amp;autoPlay=0&amp;permalink=1&amp;muted=0&amp;controls=1&amp;playsinline=0&amp;useAverageColor=0&amp;preloadContent=metadata' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/s0.wp.com\/wp-content\/plugins\/video\/assets\/js\/next\/videopress-iframe.js'><\/script><\/div>\n<\/section>\n<section id=\"transcription\" class=\"session--transcription\">\n<h2>Transcription<\/h2>\n<\/section>\n<p><strong>SAM:<\/strong> \u00a0\u00a0Hi, welcome to track C.<\/p>\n<p>I won&#8217;t do much announcements now seeing as we had the opening remarks. \u00a0The luggage room is still open if you have luggage in here now, that is open before 10:00\u00a0o&#8217;clock.<\/p>\n<p>You might want to get rid of that first.<\/p>\n<p>If you are tweeting about this session, use the hashtag WCLDN I think that is it.<\/p>\n<p>First up, Stewart Ritchie, the lead developer of Powered by Coffee.<\/p>\n<p>Part of Stewart&#8217;s job setting up and managing the DevOps for his company, welcome Stewart. \u00a0(APPLAUSE).<\/p>\n<p><strong>STEWART RITCHIE:<\/strong> Thank you very much.<\/p>\n<p>So this is dead cheesy, before we get started, can we get a big round of applause for all the volunteers who put WordCamp together? \u00a0Everyone any other T. shirt has been here from 6 this morning, be kind to them, they are here to help.<\/p>\n<p>So as Sam said, I am going turn on my slides, how do I get this back on?<\/p>\n<p>There we go.<\/p>\n<p>This talk is on DevOps for beginners, I run tiny organisation called Powered by Coffee. \u00a0We are two people and some contractors, you don&#8217;t need to be massive for any of this to apply to you, we use the tools all day, everyday this is how we work.<\/p>\n<p>Furthermore, this is not a tutorial. \u00a0If you are a dev looking for code samples and examples of how to do this, you are going to be disappointed. \u00a0This is really an introduction, we will look at the high level concepts of DevOps this is for junior, and managers what want to know what they are talking about with some of these things and for business owners who want to understand the business case around them.<\/p>\n<p>What is DevOps it isn&#8217;t a tech knowledge or particular platform it is a state of mind in a concept. \u00a0It has become a bit of a buzz word since I put this talk together originally. \u00a0Doing lots of monitoring and skilling elastic, deployments, that is not what we are going to talk about. \u00a0We will go to the start and look at the basic concepts at the beginning of getting started with this.<\/p>\n<p>It is not a technology, a cure all to all of your problems but it is process. \u00a0It is a means of identifying problems before they happen and putting processes in place that stop them happening again. \u00a0Using either straight up management or other pieces of software, to manage the larger development process. \u00a0The operations that your developers do.<\/p>\n<p>I like to think of it as investment that you are putting some time in now to save hundreds of hours in the future.<\/p>\n<p>Yes so why is it important?<\/p>\n<p>Developers, it is going the make you a better developer, going to help you understand to better collaboration with other developers, and avoid the risk of trying new techniques, the overall quality of your code, as you write smaller and smaller pieces of code across projects and tested in automated ways. \u00a0So you are saving time writing more code and better code.<\/p>\n<p>It helps you bring new people into projects quickly, a standard set of projects and tools that, so you can bring a new developer on to the project quickly, rather than hoking around looking for tweak that is can go wrong.<\/p>\n<p>If you are a project manager it will help you deliver better work to your clients, so one of the things we do internally is we have an automated deployment system, so when we have something new to show to a client we can go from working on that locally to having that visible to them to display in a staging environment in about 3 minutes should we need to. \u00a0So if there is a critical bug or a change we want to see, we can make the change quickly and promptly show them. \u00a0It is great for very, very fast iterative cycles when we work with the clients that they will come back with feedback or a bug that needs changing quickly, can show them and put that in the issue tracking it is finished.<\/p>\n<p>Finally for the WordPress Community, kind of what I am going to talk about today is kind of just really great development practices and development processes. \u00a0WordPress I think has been missing this in a lot of our kind of agencies for a long time and it is starting to come along and people are doing more and more of it. \u00a0WordPress developed a reputation of not being a serious content management system, just a little blogging engine sites. \u00a0Once we put in scalable, more easily testable, we start to become a contender for larger sites and critical sites, DevOps helps us move the community to bigger and better communities.<\/p>\n<p>Overall, how does it help? \u00a0Collaboration between developers, co-chairing in projects and automation to stream things out when you are working on projects.<\/p>\n<p>So first off, collaboration. \u00a0As teams grow, more and more developers get added to projects, projects get bigger. \u00a0But developer collaboration is hard. \u00a0You know, if you are not using a system to manage this, there is a couple of different ways it tends to happens of varying degrees of disaster potential.<\/p>\n<p>The worst way is a shared FTP server, you have multidevelopers, one is editing\u00a0 &#8212; both save the files, single page finishes faster, dev opens simple post, you have saved your work in the meantime, but your work got wiped because the latest takes precedence.<\/p>\n<p>A little bit better, maybe you are doing it operate a shared server in an office, verbally kind of going back and forth, I am doing this, that. \u00a0There is still potential for disaster to come there as peoples work gets overwritten, time is wasted, bla, bla, bla. \u00a0But this is a solved problem and there has been software around for years and years to do this. \u00a0It is called version control. \u00a0Our particular favourite version is git. \u00a0It gives us a great way to manage code. \u00a0Lets us look at an audible trail of code. \u00a0Yes. \u00a0Excuse me sorry.<\/p>\n<p>Like I like to do code as a shared resource on a project and it shouldn&#8217;t just be changed and messed with willy-nilly. \u00a0There should be audible trails, looking who made changes to code.<\/p>\n<p>The way git works a process called commit, you have got your projects, local version of it. \u00a0Make some changes, you produce a commit from those changes that commit consists of just the changes you have made. \u00a0So over time your project breaks down into a list of commits, when you layer the commits on top of each other, they form the entire project. \u00a0As you like one on top of another on top of another. \u00a0Changes editions, changes edition, removing. \u00a0You get the overall project. \u00a0The overall code base, so you can go back in time to look at any given point. \u00a0So as a commit I like to think of a commit as a useful piece of work. \u00a0Something that you can describe in a single sentence and get it out there and into kind of your central, central repository of it. \u00a0That might be a big fix it might be adding a small part of a feature, so if you added like a custom post type to your theme, that would be a good commit, that is one discernible piece of work.<\/p>\n<p>Commits are really, really useful because it gives us this time line that we can see. \u00a0So every commit when layered up on top of each other forms a whole picture, we can go back in time to any one of the commits. \u00a0If I wanted to go back to here, I can revert to that commit ID, without having to unpick all of the files, if we weren&#8217;t using version control and I decided that we are going to work on a new feature, I have got two ways, either create a back up of a folder, do my feature work in there, do all my new feature work in there, decide I don&#8217;t like my new feature work and throw the folder away. \u00a0The chances are didn&#8217;t do that. \u00a0Who has been in the situation where they have been working on some code base and or someone in the team has been working on the code base and they have made all the changes and then it wasn&#8217;t working and they didn&#8217;t have a back up of the code before they made changes and they had to start going through undoing all the work piece by piece by piece by piece to get a back to where it originally was before they started doing the work.<\/p>\n<p>Version control help us go past that, I can revert to the good commit. \u00a0We have got the concepts of commit. \u00a0We have another concept in version control called merging and branches.<\/p>\n<p>It is kind of the real power of version control is that it lets us maintain different versions of a code base, almost everybody here works on websites I guess?<\/p>\n<p>But, how many, how often do you think of the different versions of the websites exist, where you will have a production version of that website that public is hitting. \u00a0So that is a site that is active, maybe e-commerce store maybe taking orders. \u00a0Maybe have a staging version of that site that your client is testing, that you are doing your work on to make sure it is all right. \u00a0Doing your BugFixs in there, probably another version of that site, adding a new feature or continuing to work on stuff that is not ready for the client. \u00a0They are 3 different versions of your code base, software, 3 different versions of your website. \u00a0Version control branches help us to manage this.<\/p>\n<p>So we have got a little sort of example in that we have got a master branch and we are doing commits so we commit, commit, commit, commit deploy. \u00a0That is fine. \u00a0It is only one developer working on the project, we don&#8217;t need another branch, we keep, commit, commit, fine. \u00a0What we could have done instead is create a new branch when we deployed, we did this to make sure that our master branch reflects what is in production and there is a good reason for that. \u00a0I will show you now.<\/p>\n<p>So disaster strikes and we find a massive bug in our branch. \u00a0This is not taking store or payments, that needs to be fixed immediately. \u00a0So the version control, if it is just a single branch we could revert back to where we did the deploy, we have the commit ID, excluding some of the extra work we have done. \u00a0Because we branched here, we have that as a saved point in the code. \u00a0So we can create a new branch from that, our big fix branch, make that BugFix, test it, check it, merge it back to master, so when we merge we take the changes that happened in this branch and push them into the master branch and deploy that again.<\/p>\n<p>So now we have the BugFix code in the master branch deployed into production, the site is taking payments again. \u00a0We still have a problem in our develop branch where that bug still exists so what we can do is then merge master back into develop. \u00a0So it has the BugFix, so we can do all the testing we need there, to make sure that our new features work with our BugFix. \u00a0We continue to work on our new development branch until it is ready, that is merged into master and deployed again. \u00a0So again, master always matches what is in production.<\/p>\n<p>Then the reason for that is if we ever need to make an emergency change to a branch of something in production, we have access to that code base easily, quickly without having to do other work.<\/p>\n<p>We can add another layer of complexity to this, say we bring in another developer on the project, working on something specific. \u00a0Commerce example. \u00a0Perhaps working on a membership to the site. \u00a0It is a big piece and risky, different ways of approaching it, we want to work on it independently, create a new branch off of develop called future X. \u00a0The developer work withs on it, commits, commits, commits, commits, misses the dead line we were going for to get it to our major merge and deploy on the develop branch that is fine, keeps going, keeps going, eventually when it is ready to be tested gets merged to the develop branch, QA, tested then that is ready to be approved merged to the deploy branch so it goes on to, on to production and accesses to the world. \u00a0So I will take a wee drink.<\/p>\n<p>So to move on to code sharing.<\/p>\n<p>Every project has code that people didn&#8217;t create in it. \u00a0Everybody project has code that people didn&#8217;t create in it. \u00a0So all this and it is called dependencies, everybody in the room massively dependencies, how many have &#8230;<\/p>\n<p>This is quite an important distinction this is not like a WordPress project, you are building a site of which WordPress is a component. \u00a0But WordPress has its own dependencies, there is software inside of WordPress that they didn&#8217;t create. \u00a0Using libraries to do particular things. \u00a0You have got some examples of this, dif which powers the editor, MP 3 tag information, BackBone and underscores, java script libraries that do the interactive stuff on the admin Panel. \u00a0Those are quite, those are developer ones, libraries and stuff but php mysql, the independent versions of this, they are independent pieces of software that WordPress depends on to run. \u00a0In turn are written in C, which depends on other libraries on your server to run as well. \u00a0Dependencies all the way down. \u00a0We won&#8217;t look at the php side of it but software, other libraries of code that other developers putting together. \u00a0The problem is dependencies, they can change. \u00a0If you write software that relies on other peoples software it is inherently risky, we have got a bit of a push in WordPress to always be using the latest version of everything, update X, Y always use the latest.<\/p>\n<p>But that is not always a great idea. \u00a0As versions change and increase, features get added and features get taken away. \u00a0New bugs get introduced, bugs and things that shouldn&#8217;t have been in the library, that you were relying on get taken out and fixed. \u00a0End up in the group situation where you are relying on a bug. \u00a0When your versions change, if they change unexpectedly without you noticing, the whole thing can come down. \u00a0So, what about within your own project? \u00a0Already mentioned WordPress is a dependency of your project but if you are using, if you are building a theme custom theme for a client that theme probably depends on plug ins. \u00a0Depends on word press, depends on other php libraries to do particular things. \u00a0If you are, are doing some XML parsing or some other kind of utility library you are using to make it work. \u00a0These are all dependencies. \u00a0But the problem we end up having is that your dependencies in turn have dependencies.<\/p>\n<p>So, again to go back to our theme example, this is kind of a java script one, if you want to use masonry, to produce one of the lovely block layouts in your layout. \u00a0Masonry, depends on images loads, on jquery and events to run properly, underlying changes in the libraries can screw up masonry JS and which will screw up your theme.<\/p>\n<p>So we have an example of a time when we built our site, debranded to protect the innocent.<\/p>\n<p>So our dependency management completely broke down during the process of building this site for a variety of reasons, what happened was, this site was originally built on WordPress 4.4. \u00a0Updated to 4.5, no problems, updated to 4.6 and the whole thing collapses. \u00a0Reverted it back to 4.5 everything is fine.<\/p>\n<p>Go back to 4.6 whole thing collapses again, so something has clearly changed as we move to 4.6. \u00a0So we could have just pegged the version that it will always run at 4.5 and use the patch updates, the client didn&#8217;t want to do that, that is fair enough.<\/p>\n<p>What happened? \u00a0In WordPress 4.6 there is a new library added,\u00a0 &#8212; &#8230; is laughing at me\u00a0 &#8212; that is fine, introduced into WordPress, what happened was with us, was that we were using a library called twig that does templating with a plug in called timber that controls that. \u00a0Because our dependency management broken down, all to version control, including the dependencies, they are little things that help us develop the site. \u00a0The developer dependencies wpci, it also includes the request library, in an earlier version, because it was loading earlier in the system, php was assuming that is what we wanted to use, when it made a request to something it looked for a method that didn&#8217;t exist. \u00a0The whole thing happens.<\/p>\n<p>We had that remove all the extraneous dependencies, it could have been avoided if we had proper management in place.<\/p>\n<p>You might be thinking, this all sounds like a nightmare and you are right, it is, I hate this, I hate having to like be sure that I have got the right version of this library and that library. \u00a0There is a way of working with this and it is called composer.<\/p>\n<p>Composer is the php dependency management package manager, basically lets you run a few commands in the command line terminal to add new packages to the project, a JSON file, that lists the project and then installs them every time you need to do deployment or want to do a rebuild of the project. \u00a0Allows you to peg things to particular versions if you do update something and break it you have a logable audible list of here are the things we know this works with. \u00a0So get back to here, at least get things running again.<\/p>\n<p>Composer and WordPress don&#8217;t really play hugely well together we like to break out our packages as composer calls them plug ins, we list them out. \u00a0All the different libraries on the external tools and things as part of the composer json and let them install it. \u00a0The problem is it gets something from packagist, some clever people wrote a clone of Packagist for WordPress that lets you install things from the WordPress plugin repository via Packagist so that will let you access anything on WP.org. \u00a0Maybe you have custom or pre purchase plug ins &#8211; some very clever people wrote a plugin for WordPress called SatisPress &#8211; our own {inaudible} owns as part of the maintaining team. \u00a0So that let&#8217;s you sort of upload your own version of things you can distribute that and access it across your various projects.<\/p>\n<p>Composer and WordPress don&#8217;t play well together at the moment but there are very interesting core tickets about getting an auto loader into WordPress which is part of composer and making it a composer package which I think there is going to be a talk on later on today as well.<\/p>\n<p>If you don&#8217;t do a lot of PHP development and are more of a JavaScript person then Bower is something similar. \u00a0Bower installs masonry, it&#8217;s clever, it knows masonry requires 3 or 4 libraries I mentioned, goes and installs them all and manages them and I don&#8217;t have to worry about it, I know you want masonry. \u00a0It deals with the underlying part of that.<\/p>\n<p>Dependency management because it relies on often external internet connections can bite you if you get say S 3 going down then you can&#8217;t build your site or if somebody removes something you depend on from public access.<\/p>\n<p>There is a very famous things where leftpad, a node library, got removed from MHM so when people went to build their sites their applications again that day for a new changes and things to get out, everything broke. \u00a0It is a really tiny library but was used everywhere, a great utility. \u00a0So always be prepared, always have a back up, always have a cache. \u00a0A couple of easy ways to get started looking at version control and dependency management start to break your own reusable code into independent plugins and share them across your version versions of those, across your site, across your project sorry via composer. \u00a0So a couple of examples of that is if you look at the Powered by Coffee hub we have a drop in drop into virtually every project that writes all of our WP mail through mail gun. \u00a0All you need to do is add WP config variable and that&#8217;s fine. \u00a0We have something that is accessible, XM LPC across projects but we find it preferable to work this way rather than copying stuff back and fore between projects because we can control the versions like in this project we&#8217;re using version 2 of our mail gun thing but in this project we need to use version 3 and it let&#8217;s us get track of that mental overload and burden of being this project has version 2 so let&#8217;s copy it out of there and this project has version 3. \u00a0We have a stated version, a stated accessible version of that we can use at all times.<\/p>\n<p>So the third thing we&#8217;re going to talk about is automation. \u00a0Automation is incredible. \u00a0It can cause a lot of problems in the wider world and there is a political discussion but it&#8217;s not for today. \u00a0Automation is great because repetition sucks. \u00a0If you are a developer, designer, writer, PM, business owner, you are a creative smart person and you probably don&#8217;t like to do the same thing over and over and over again. \u00a0It&#8217;s really dull. \u00a0It makes people unhappy. \u00a0It&#8217;s ultimately part of what can cause people to move away from jobs if they&#8217;re unhappy in their workplace because they&#8217;re just not doing something that excites them. \u00a0And mistakes get made. \u00a0Whereas often times tiny little things can be scripted and things that take a couple of minutes to do every day or things that are easily forgotten to happen can be scripted and make it happen. \u00a0So need to do it twice I think you should automate it.<\/p>\n<p>A rule of thumb for me is if it takes 2 minutes and you do it twice a day you should look at automating that so that&#8217;s 4 minutes a day, 25 minutes a week, 2.5 hours &#8211; it adds up over time.<\/p>\n<p>And there are some really good candidates for automation. \u00a0Deployments, which I will talk about a bit more, compiling assets which is something a lot of you are already doing if you are building your themes using sauce or less or stylist or coffee script you are probably compiling these assets down automatically using something like SAS and watching the files. \u00a0Image optimisation everyone knows you should optimise images but it often gets forgotten so why bother, just write a script that will watch the folder and do it for you. \u00a0Setting up servers we&#8217;ll talk about in a bit and installing WordPress. \u00a0WordPress is a 5 minute install. \u00a0I do it may be 3 times a week for various bits of projects. \u00a0With something like wp-cli that is down to 35 seconds so a big saving there.<\/p>\n<p>Let&#8217;s talk about deployments.<\/p>\n<p>I hate ftp &#8211; I hate it with the fire of a thousand sons {laughter}. \u00a0Every time I open ftp it is a bad day. \u00a0Something very, very wrong has happened if I have to open ftp. \u00a0Show of hands who has had a site deployment go badly wrong whenever they&#8217;ve tried to do it over ftp? \u00a0A couple of hands at the front. \u00a0My 2 favourites is when it only decides to up load half a file and spits out code every time someone uses the page or more insidious half a JavaScript file so you are in the Panel and suddenly stuff stops working. \u00a0Nothing in your air log but gravity forums doesn&#8217;t work and you can&#8217;t edit anything. \u00a0That&#8217;s a nightmare.<\/p>\n<p>So because I hate ftp so much that we work to do automated deployments.<\/p>\n<p>No more slow field ftp transfers. \u00a0It easily ties into our version control. \u00a0If we make a change to our develop branch that can be automatically deployed on to our staging server without anyone worrying about it. \u00a0Same as production if we change our master branch deployed in production without anyone thinking about it saving more time, stuff we don&#8217;t have to think about, don&#8217;t we want to think about, tough we have automated so we don&#8217;t have to worry. \u00a0It&#8217;s easy to undo a mistake. \u00a0If a bug gets into production our deployment let&#8217;s us roll back to previous our version quickly so disaster recovery time goes from half an hour to 30 seconds because rather than try and debug it we see what is wrong and roll back.<\/p>\n<p>To do our deployments we use an open sauce tool called Capistrano. \u00a0Capistrano is scriptable and self installed, written in ruby, and like WordPress it&#8217;s sort of set up around tasks. \u00a0You&#8217;ve got these various tasks as it goes through &#8211; deploy start, deploy finish, finishing, rolling back, and you can write new tasks that hook into this so you can script it to do whatever you want over time.<\/p>\n<p>One of the things we do is tell it to compile our assets. \u00a0We try to not commit to our version control our CSS files, we commit the source files our dot SAS files and whenever we set up the server do a deployment it regenerates those in their optimised versions that are all minimised as they need to be.<\/p>\n<p>It is incredibly powerful and flexible and we&#8217;ve got a standard set up we use on every project. \u00a0We just need to go in and tell Capistrano how to log into various servers it needs to. \u00a0Often production and staging and if you are running it on multiple servers it can set it up to deploy to 100 servers at once if it needs to be.<\/p>\n<p>It&#8217;s quite hard to set up. \u00a0You need some experience but there are alternatives. \u00a0Deployable, \u00a0Buddy and Deploy HQ. \u00a0These are SAS applications where you give them their server logins and it works the same way. \u00a0All these tools you give them a log into your server tell them to do the same thing, they log in, does pull from your version control to get the code it needs and run the tasks you tell it to run. \u00a0These are multiple different ways of approaching the same problem. \u00a0These are nice GOIs you pay for to do it Capistrano is hard to use but very customisable.<\/p>\n<p>So the next thing we want to talk about for automation is getting rid of a whole class of problems through standardising environments.<\/p>\n<p>Who has ever had a problem where they have built a site or a site that their agency or team has built, works fantastically in local, works fantastically on staging then it comes to launch day, you deploy it on to the customer&#8217;s web hosting, the whole thing collapses and doesn&#8217;t work? \u00a0Yes. \u00a0Handful of hands going up around the place again.<\/p>\n<p>We used to have that happen regularly. \u00a0One that would always get us is MySQL versions changing and there being incompatibilities between them and various versions of WordPress, UTF &#8211; MB 4 changes? \u00a0No &#8230;<\/p>\n<p>By standardising environments we can stop this happening.<\/p>\n<p>We want to use a virtual machine to make sure that everything always matches on every environment that is going to be deployed to.<\/p>\n<p>My preferred way of doing this is controlling the hosting because then we can build something tightly integrated and know exactly what we&#8217;re building against but sometimes we don&#8217;t have that luxury, sometimes the client has their own web hosting and they&#8217;re tied in do legacy vendor so in that instance we&#8217;ll find out everything we can about their hosting and build a virtual machine that matches it exactly.<\/p>\n<p>So if you don&#8217;t know what a virtual machine is it&#8217;s specifically a little fake hidden computer that runs on your desktop or lap-top as a virtual version of itself. \u00a0An example that&#8217;s common is something like parallels that runs on a Mac to let you run windows except we use it to run different versus of Linux on our Macs; this one is running 3 separate VMs for the minute for different projects I&#8217;ve never got round to shutting down.<\/p>\n<p>So the way we want to run our virtual machines is we&#8217;ll find out everything about that system that is going to be deployed upon, come back, match it in the staging environment then match it on the development environments. \u00a0So that we have these scalable repeatable systems.<\/p>\n<p>So to do that we use a tool called Vagrant. \u00a0Vagrant is okay. \u00a0Vagrant exists purely so people don&#8217;t have to use a tool called virtual box. \u00a0Vagrant is CLI to virtual box and virtual box takes care of creating virtual machines for you; you feed it a disk image of the operating system you&#8217;d like it to run and it goes off and does that and it can be as quick as Vagrantup. \u00a0A couple of minutes later and you&#8217;ll have a VM running that has most of what you need on it.<\/p>\n<p>That&#8217;s only half the story. \u00a0We&#8217;ve got the operating system. \u00a0We&#8217;ve gone to centre west or red hat or whatever we need there but the other half of the story is matching all software versions so if we have a particular version of PHP we need, have a particular version of MySQL we need, a particular set of extensions to PHP we need, we need a way of installing all of that. \u00a0Because I only want to do it once, I&#8217;m going to script that. \u00a0I&#8217;m going to use a couple of tools. \u00a0We use Ansible but Chef and Puppet are great as well. \u00a0They&#8217;re task based; you feed them a list of things you want them to install and they go and install them, so it becomes re-useable. So if I have {inaudible} running on this Mac in front of me, I can use Ansible to install PHP 7.1, MySQL point 2, running everything, that&#8217;s great; we&#8217;ll then use exactly the same script on our staging environment to make sure they exactly match and because we base that on the clients version they will all exactly match.<\/p>\n<p>I am quickly running out of time so to conclude this is going to take a while if you don&#8217;t know too much about it and you&#8217;re trying to learn it will slow you down to start with but when it saves you, it will save you big, you will save hours and hours when this eventually saves you. \u00a0Take the time get to learn it and know the best practices and absorb it all.<\/p>\n<p>Furthermore, these aren&#8217;t strictly WordPress skills. \u00a0These are professional development skills. \u00a0Every software development agents in the world kind of works like this and if we pass on that and skip on that then we miss out on helping ourselves be respected as developers but furthermore WordPress won&#8217;t be around for ever and there are a lot of WordPress developers in this room {laughter} &#8211; yes, fair enough like. \u00a0A room full &#8211; technology comes and goes. \u00a0Like people never thought that VGA would go away. \u00a0At the time it was perfect but it&#8217;s eventually on its way out everything will go eventually.<\/p>\n<p>Where do you go next? are you going to be unemployed because you learned to be a WordPress developer rather than a professional developer? \u00a0Think about that.<\/p>\n<p>Finally where to go next. \u00a0If you want to learn more about this some topics to look into are automated testing, visual regression testing. \u00a0Visual regression testing if you make SHS change you can {inaudible} BBC multiple screen sizes and compare them visually so you can see if you&#8217;ve got unexpected changes. \u00a0Coquality checks. \u00a0To make sure people don&#8217;t commit bad code and stuff against your style guide and doing notifications and things like that so everyone knows, like pushing into slack and stuff like that, so people know when you are working and when your deployments are done.<\/p>\n<p>That&#8217;s me. I&#8217;m getting time up notifications so I&#8217;m going to stop there.<\/p>\n<p>{Applause}.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>SAM:<\/strong> Thank you, Stewart. \u00a0Do we have time for a question or do we want to go straight to break? \u00a0Has anyone got an urgent burning question that must be answered?<\/p>\n<p><strong>FROM THE FLOOR:<\/strong> Any hints on syncing database?<\/p>\n<p><strong>STEWART RITCHIE:<\/strong> There are some good tools for moving databases around. \u00a0My tip is DB Pro. \u00a0Obviously they have to be immutable; you move that entire database. You can move parts of it but you&#8217;re not going to move the changes, but I believe that same team is working on a product that does that like syncing versis for databases, mergebot.<\/p>\n<p><strong>SAM:<\/strong> Any other questions?<\/p>\n<p><strong>FROM THE FLOOR:<\/strong> I think it&#8217;s just an addition. \u00a0Good to know you had the same problem with request. We destroyed the GitHub like with comments when we have that problem. \u00a0You haven&#8217;t mentioned you also can install WordPress with composer so if you search composer WordPress on Google you&#8217;ll get the routes of your web-site and there is a way to stop from {inaudible} so when we deploy we don&#8217;t have WordPress on the server, just go via composer and everything goes altogether.<\/p>\n<p><strong>STEWART RITCHIE:<\/strong> We pull everything from Composer. \u00a0We don&#8217;t use the roots IO stuff but it&#8217;s similar how it does it and there are great tutorials on the internet how to do it if you want to read more Google using WordPress with Composer.<\/p>\n<p><strong>SAM:<\/strong> Anyone else? \u00a0We&#8217;re good. \u00a0Okay. \u00a0So now we have the first break of the day. \u00a0Your nearest drink station is back through the way you came into the graduate centre and upstairs. \u00a0There is a space called the junction and there is a bar there serving drinks.<\/p>\n<p>While you are up there, there are sponsors up there. \u00a0Please go and speak to them. \u00a0You&#8217;ve got about half an hour to go and get some drinks. \u00a0Talk to the people around you, people that are in the queue, get to know some people. \u00a0And we are back here at 10 to 11 with Crispin Read who will be talking about object orientated user experience. \u00a0Make sure you come in. \u00a0Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A run through of dev ops for beginners covering some basics to get your started: Git &amp; Version Control Dependence Management \u00a0Automation Deployments Slides Video Transcription SAM: \u00a0\u00a0Hi, welcome to track C. I won&#8217;t do much announcements now seeing as we had the opening remarks. \u00a0The luggage room is still open if you have luggage &hellip; <a href=\"https:\/\/london.wordcamp.org\/2017\/session\/wordpress-dev-ops-for-beginners\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">WordPress Dev Ops for Beginners<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":8958347,"featured_media":0,"template":"","meta":{"jetpack_post_was_ever_published":false,"_wcpt_session_time":1489830000,"_wcpt_session_duration":3000,"_wcpt_session_type":"session","_wcpt_session_slides":"","_wcpt_session_video":"","_wcpt_speaker_id":[1788],"footnotes":""},"session_track":[643127],"session_category":[],"class_list":["post-1837","wcb_session","type-wcb_session","status-publish","hentry","wcb_track-track-c"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p833Rb-tD","session_date_time":{"date":"18\/03\/2017","time":"09:40"},"session_speakers":[{"id":"1788","slug":"stewart-ritchie","name":"Stewart Ritchie","link":"https:\/\/london.wordcamp.org\/2017\/speaker\/stewart-ritchie\/"}],"session_cats_rendered":null,"_links":{"self":[{"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions\/1837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions"}],"about":[{"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/types\/wcb_session"}],"version-history":[{"count":5,"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions\/1837\/revisions"}],"predecessor-version":[{"id":3669,"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions\/1837\/revisions\/3669"}],"speakers":[{"embeddable":true,"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/speakers\/1788"}],"author":[{"embeddable":true,"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wporg\/v1\/users\/stewarty"}],"wp:attachment":[{"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/media?parent=1837"}],"wp:term":[{"taxonomy":"wcb_track","embeddable":true,"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/session_track?post=1837"},{"taxonomy":"wcb_session_category","embeddable":true,"href":"https:\/\/london.wordcamp.org\/2017\/wp-json\/wp\/v2\/session_category?post=1837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}