SlideShare a Scribd company logo
WordPress  and  
                      Version  Control
                           A Workflow

                           $ Aaron Holbrook
                             A7 Web Design, Owner
                                aaron@a7web.com




Monday, June 11, 12
aaron@a7web.com

                           @aaronjholbrook

                                a7web.com


   #wcmke #wpgit

Monday, June 11, 12
overview
               Background
               Disclaimer
               Assumptions
               Local Development
               Version Control (Git)
               Using WordPress & Git together
               Deployment
               Some demos
               Ask questions!

   #wcmke #wpgit

Monday, June 11, 12
have you ever...
               Wanted to make your changes live with the push of a
               button?
               Hated dragging files into FTP and wished for a better way?
               Been editing via FTP, made a change, closed the editor
               and immediately realized you shouldn’t have closed it?
               Lost code and didn’t have a backup?
               Had a backup, but it was too old?
               Had a site become corrupt, infected or lost with no way to
               recover it?

   #wcmke #wpgit

Monday, June 11, 12
a little history
               I had 10+ WordPress sites to maintain
               Sites were similar in layout and style
               differing only by color scheme
               Needed a way to quickly push out
               changes across all the sites
               Really wanted to utilize version control

   #wcmke #wpgit

Monday, June 11, 12
disclaimer!
                          ma y vary)
                   ileage
      YMMV (your m




               This workflow is something that I’ve
               refined to suit my needs, feel free to
               adjust it to suit yours




   #wcmke #wpgit

Monday, June 11, 12
assumptions
               You’re aware of how important Version Control is,
               but have not fully integrated it into your workflow
               You have some familiarity with the command line
               Your live server environment supports SSH
                        (most hosts support SSH, sometimes you have to ask)


               You have a local development environment that
               you prefer to work within
               You’d like to have seamless, simple deployments

   #wcmke #wpgit

Monday, June 11, 12
the workflow
               Start local, develop some functionality
               Set up deployment system to your live
               server
               Deploy your changes with the press of a
               button!


   #wcmke #wpgit

Monday, June 11, 12
things you’ll need

               Terminal
               Git
               SSH




   #wcmke #wpgit

Monday, June 11, 12
legend

               Whenever you see $ command here
               Everything after the $ is what you should
               type




   #wcmke #wpgit

Monday, June 11, 12
“A civilized tool for a civilized age”
                                           - Si, stack overflow




Monday, June 11, 12
git 101

               You can define a Git repository in any
               directory simply by typing: $ git init
               Via the terminal, navigate to the root of
               your local site directory and type $ git init



   #wcmke #wpgit

Monday, June 11, 12
.gitignore
               .DS_Store
               wp-config.local.php
               .htaccess
          Optional - ignore user uploads

               wp-content/uploads/
          Optional - ignore live cache

               wp-content/cache/

   #wcmke #wpgit

Monday, June 11, 12
git 102

               In your git repo, add all files $ git add .
               Commit! $ git commit -m “Commit Message”
                Success!           -m allows an i
                                                  nline commit m
                                                                 essage




   #wcmke #wpgit

Monday, June 11, 12
Deploy
Monday, June 11, 12
this
                                                                       file
                                                                              is t


                      wp-config.local.php
                                                                                   he m
                                                                                        agic
                                                                                             key




               1. Define local variables without
                  contaminating the server
               2. Add a call to wp-config.php to check for
                  this file and load it if it exists



                                                 Credit to Mark Jaquith who came up with this idea
   #wcmke #wpgit             http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/

Monday, June 11, 12
this
                                            file
                                                   is t


                      wp-config.local.php
                                                        he m
                                                             agic
                                                                  key




   #wcmke #wpgit

Monday, June 11, 12
wp-config.php

               1. Test for   wp-config.local.php

               2. If it doesn’t exist, then use live server
                  connection information




   #wcmke #wpgit

Monday, June 11, 12
wp-config.php




   #wcmke #wpgit

Monday, June 11, 12
ssh 101

               1.     $ ssh login@server.com

               2. Enter password
               3.     success




   #wcmke #wpgit

Monday, June 11, 12
HUB & PRIME

               On the server, we will create two
               repositories
                      HUB   will be the main collaborator
                      PRIME   will be the live site repository


                                                                      Major props to Joe Maller
   #wcmke #wpgit                           http://joemaller.com/990/a-web-focused-git-workflow/

Monday, June 11, 12
hub
                                                 HUB
               Create hub as a bare repository
                      I generally put it right above the site’s html root in a ‘git-hub’* folder


                       /domains/site.com/html

                       /domains/site.com/git-hub


              $ git init --bare


                                                        * Not to be confused with the fantastic GitHub website
   #wcmke #wpgit                                                                           https://github.com/

Monday, June 11, 12
HUB hook

               We’ll want PRIME to auto-update when we
               push our changes up to H HUB

               So let’s set up a hook!




   #wcmke #wpgit

Monday, June 11, 12
HUB hook
                      /git-hub/hooks/post-update




   #wcmke #wpgit

Monday, June 11, 12
PRIME
               1. Create as regular repo
                      $ git init


               2. Add remote to       HUB
                      $ git remote add hub /domains/site.com/git-hub




   #wcmke #wpgit

Monday, June 11, 12
and finally

               Set up our local remote to                 HUB

                $ git remote add hub ssh://login@host.com/home/domains/site.com/git-hub


                 Success!




   #wcmke #wpgit

Monday, June 11, 12
3...2...1... blast off!
               Make sure that our repository is clean
                      $ git add .

                      $ git commit -am “Updated header to include nav links”

               ...wait for it...
                      $ git push hub master

               We’ve deployed!                hooray!



   #wcmke #wpgit

Monday, June 11, 12
push & pull
               Occasionally you will need to commit on
               the server and pull down to your local
               repository
               All you need to do (from local machine)
                      $ git pull hub master




   #wcmke #wpgit

Monday, June 11, 12
caution!
               The uploads folder can change quite
               frequently, which may cause your repos to
               get out of sync, necessitating a need for
               frequent pulldowns to keep repos in
               check
               Depending on situation, you can ignore
               uploads/* directory or sync repos
                /uploads/*
               frequently

   #wcmke #wpgit

Monday, June 11, 12
take away
               Start local, develop some functionality
               Set up deployment system to your live
               server
               Deploy your changes with the press of a
               button!


   #wcmke #wpgit

Monday, June 11, 12
a7web.com


                             @aaronjholbrook

                      aaron@a7web.com
   #wcmke #wpgit

Monday, June 11, 12

More Related Content

Viewers also liked

Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
Aaron Irizarry
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Wordpress version control
Wordpress version controlWordpress version control
Wordpress version controlDavid Doolin
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and Git
Rob Miller
 
WordPress and Git
WordPress and GitWordPress and Git
WordPress and Git
Rob Miller
 
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)Japheth Thomson
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPress
Josh Lee
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow
Roman Rus
 
Every project is a story applying storytelling to your client interactions (1)
Every project is a story  applying storytelling to your client interactions (1)Every project is a story  applying storytelling to your client interactions (1)
Every project is a story applying storytelling to your client interactions (1)
Dwayne McDaniel
 
Fictionalised biopics –
Fictionalised biopics –Fictionalised biopics –
Fictionalised biopics –
lukedan33
 
BADCamp 2012- Drupal Support
BADCamp 2012- Drupal SupportBADCamp 2012- Drupal Support
BADCamp 2012- Drupal Support
meghsweet
 
Ejercicio 9 carta
Ejercicio 9 cartaEjercicio 9 carta
Ejercicio 9 carta
aitoor1234
 
Wp cli- intro and basics
Wp cli- intro and basicsWp cli- intro and basics
Wp cli- intro and basics
Dwayne McDaniel
 

Viewers also liked (17)

Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Wordpress version control
Wordpress version controlWordpress version control
Wordpress version control
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and Git
 
WordPress and Git
WordPress and GitWordPress and Git
WordPress and Git
 
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPress
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow
 
Every project is a story applying storytelling to your client interactions (1)
Every project is a story  applying storytelling to your client interactions (1)Every project is a story  applying storytelling to your client interactions (1)
Every project is a story applying storytelling to your client interactions (1)
 
RdF - Unitranche
RdF - UnitrancheRdF - Unitranche
RdF - Unitranche
 
Fictionalised biopics –
Fictionalised biopics –Fictionalised biopics –
Fictionalised biopics –
 
BADCamp 2012- Drupal Support
BADCamp 2012- Drupal SupportBADCamp 2012- Drupal Support
BADCamp 2012- Drupal Support
 
Ejercicio 9 carta
Ejercicio 9 cartaEjercicio 9 carta
Ejercicio 9 carta
 
Wp cli- intro and basics
Wp cli- intro and basicsWp cli- intro and basics
Wp cli- intro and basics
 

Similar to WordPress & Version Control: A Workflow

Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
TO THE NEW | Technology
 
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
WP Engine
 
At Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsAt Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in Operations
Mandi Walls
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїТарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
LEDC 2016
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studio
deWeb
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015
Terell Moore
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edge
ericholscher
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
JLP Community
 
Maven
MavenMaven
Bundling Client Side Assets
Bundling Client Side AssetsBundling Client Side Assets
Bundling Client Side AssetsTimothy Oxley
 
Frontend Engineer Toolbox
Frontend Engineer ToolboxFrontend Engineer Toolbox
Frontend Engineer Toolbox
Ynon Perek
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
Stewart Ritchie
 
XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013
Tim Clark
 
How to be a distribution-friendly project
How to be a distribution-friendly projectHow to be a distribution-friendly project
How to be a distribution-friendly project
Donnie Berkholz
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
Dana Luther
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
mpvanwinkle
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
Promet Source
 
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
bridgetkromhout
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
Sadayuki Furuhashi
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 

Similar to WordPress & Version Control: A Workflow (20)

Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
 
At Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsAt Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in Operations
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїТарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studio
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edge
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Maven
MavenMaven
Maven
 
Bundling Client Side Assets
Bundling Client Side AssetsBundling Client Side Assets
Bundling Client Side Assets
 
Frontend Engineer Toolbox
Frontend Engineer ToolboxFrontend Engineer Toolbox
Frontend Engineer Toolbox
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
 
XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013
 
How to be a distribution-friendly project
How to be a distribution-friendly projectHow to be a distribution-friendly project
How to be a distribution-friendly project
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

WordPress & Version Control: A Workflow

  • 1. WordPress  and   Version  Control A Workflow $ Aaron Holbrook A7 Web Design, Owner aaron@a7web.com Monday, June 11, 12
  • 2. aaron@a7web.com @aaronjholbrook a7web.com #wcmke #wpgit Monday, June 11, 12
  • 3. overview Background Disclaimer Assumptions Local Development Version Control (Git) Using WordPress & Git together Deployment Some demos Ask questions! #wcmke #wpgit Monday, June 11, 12
  • 4. have you ever... Wanted to make your changes live with the push of a button? Hated dragging files into FTP and wished for a better way? Been editing via FTP, made a change, closed the editor and immediately realized you shouldn’t have closed it? Lost code and didn’t have a backup? Had a backup, but it was too old? Had a site become corrupt, infected or lost with no way to recover it? #wcmke #wpgit Monday, June 11, 12
  • 5. a little history I had 10+ WordPress sites to maintain Sites were similar in layout and style differing only by color scheme Needed a way to quickly push out changes across all the sites Really wanted to utilize version control #wcmke #wpgit Monday, June 11, 12
  • 6. disclaimer! ma y vary) ileage YMMV (your m This workflow is something that I’ve refined to suit my needs, feel free to adjust it to suit yours #wcmke #wpgit Monday, June 11, 12
  • 7. assumptions You’re aware of how important Version Control is, but have not fully integrated it into your workflow You have some familiarity with the command line Your live server environment supports SSH (most hosts support SSH, sometimes you have to ask) You have a local development environment that you prefer to work within You’d like to have seamless, simple deployments #wcmke #wpgit Monday, June 11, 12
  • 8. the workflow Start local, develop some functionality Set up deployment system to your live server Deploy your changes with the press of a button! #wcmke #wpgit Monday, June 11, 12
  • 9. things you’ll need Terminal Git SSH #wcmke #wpgit Monday, June 11, 12
  • 10. legend Whenever you see $ command here Everything after the $ is what you should type #wcmke #wpgit Monday, June 11, 12
  • 11. “A civilized tool for a civilized age” - Si, stack overflow Monday, June 11, 12
  • 12. git 101 You can define a Git repository in any directory simply by typing: $ git init Via the terminal, navigate to the root of your local site directory and type $ git init #wcmke #wpgit Monday, June 11, 12
  • 13. .gitignore .DS_Store wp-config.local.php .htaccess Optional - ignore user uploads wp-content/uploads/ Optional - ignore live cache wp-content/cache/ #wcmke #wpgit Monday, June 11, 12
  • 14. git 102 In your git repo, add all files $ git add . Commit! $ git commit -m “Commit Message” Success! -m allows an i nline commit m essage #wcmke #wpgit Monday, June 11, 12
  • 16. this file is t wp-config.local.php he m agic key 1. Define local variables without contaminating the server 2. Add a call to wp-config.php to check for this file and load it if it exists Credit to Mark Jaquith who came up with this idea #wcmke #wpgit http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/ Monday, June 11, 12
  • 17. this file is t wp-config.local.php he m agic key #wcmke #wpgit Monday, June 11, 12
  • 18. wp-config.php 1. Test for wp-config.local.php 2. If it doesn’t exist, then use live server connection information #wcmke #wpgit Monday, June 11, 12
  • 19. wp-config.php #wcmke #wpgit Monday, June 11, 12
  • 20. ssh 101 1. $ ssh login@server.com 2. Enter password 3. success #wcmke #wpgit Monday, June 11, 12
  • 21. HUB & PRIME On the server, we will create two repositories HUB will be the main collaborator PRIME will be the live site repository Major props to Joe Maller #wcmke #wpgit http://joemaller.com/990/a-web-focused-git-workflow/ Monday, June 11, 12
  • 22. hub HUB Create hub as a bare repository I generally put it right above the site’s html root in a ‘git-hub’* folder /domains/site.com/html /domains/site.com/git-hub $ git init --bare * Not to be confused with the fantastic GitHub website #wcmke #wpgit https://github.com/ Monday, June 11, 12
  • 23. HUB hook We’ll want PRIME to auto-update when we push our changes up to H HUB So let’s set up a hook! #wcmke #wpgit Monday, June 11, 12
  • 24. HUB hook /git-hub/hooks/post-update #wcmke #wpgit Monday, June 11, 12
  • 25. PRIME 1. Create as regular repo $ git init 2. Add remote to HUB $ git remote add hub /domains/site.com/git-hub #wcmke #wpgit Monday, June 11, 12
  • 26. and finally Set up our local remote to HUB $ git remote add hub ssh://login@host.com/home/domains/site.com/git-hub Success! #wcmke #wpgit Monday, June 11, 12
  • 27. 3...2...1... blast off! Make sure that our repository is clean $ git add . $ git commit -am “Updated header to include nav links” ...wait for it... $ git push hub master We’ve deployed! hooray! #wcmke #wpgit Monday, June 11, 12
  • 28. push & pull Occasionally you will need to commit on the server and pull down to your local repository All you need to do (from local machine) $ git pull hub master #wcmke #wpgit Monday, June 11, 12
  • 29. caution! The uploads folder can change quite frequently, which may cause your repos to get out of sync, necessitating a need for frequent pulldowns to keep repos in check Depending on situation, you can ignore uploads/* directory or sync repos /uploads/* frequently #wcmke #wpgit Monday, June 11, 12
  • 30. take away Start local, develop some functionality Set up deployment system to your live server Deploy your changes with the press of a button! #wcmke #wpgit Monday, June 11, 12
  • 31. a7web.com @aaronjholbrook aaron@a7web.com #wcmke #wpgit Monday, June 11, 12