Code Monkey home page Code Monkey logo

Comments (5)

markjaquith avatar markjaquith commented on September 13, 2024

For updating WordPress core, you'd point the submodule to a new commit SHA. Like so:

cd wp
git fetch
git fetch --tags
git checkout 3.4
cd ../
git add wp
git commit -m 'Update to WordPress 3.4'
git push

You might even make that a bash script that you can run, like wpup 3.4

For themes, I'd actually recommend that you put them in your repo, as they are sometimes updated outside of a WordPress release. Symlinking to the core ones is a bit of a shortcut just to get you started.

Once in your repo, you could use a local development checkout to have WordPress update the themes. Then just git add --all the theme directory, git commit -m 'Updating {name} theme', and git push.

from wordpress-skeleton.

dcalhoun avatar dcalhoun commented on September 13, 2024

Thanks for the quick response, Mark. This is just what I'm needing.

However, you referenced deploying with Capistrano. I'm attempting the same with whiskey_disk. It seems that after running the commands you provided to update WordPress core to a specific tag, you would have to run those same commands on the production server after deploying. For example, after running:

...
git commit -m 'Update to WordPress 3.4'
git push
cap production deploy

It seems you would still have to SSH into the production server and run:

cd wp
git fetch --tags
cd ..
git submodule update

Are you doing this to deploy a WordPress core update to your production server? Is there a way around this? Are you using a post deploy bash script to do this?

from wordpress-skeleton.

markjaquith avatar markjaquith commented on September 13, 2024

I have it built in to my Capistrano scripts. And I'll be releasing that as a separate "sister project" very soon. But here's the git submodule tags code:

# Enable Submodules in Capistrano
set :git_enable_submodules, 1

# Task to update submodule tags
namespace :git do
    desc "Updates git submodule tags"
    task :submodule_tags do
        run "if [ -d #{shared_path}/cached-copy/ ]; then cd #{shared_path}/cached-copy/ && git submodule foreach --recursive git fetch origin --tags; fi"
    end
end

# Schedule this task to happen BEFORE deploy
before( "deploy", "git:submodule_tags" )

BOOM, HEADSHOT!

from wordpress-skeleton.

dcalhoun avatar dcalhoun commented on September 13, 2024

:) Very cool. Thanks again.

from wordpress-skeleton.

markjaquith avatar markjaquith commented on September 13, 2024

Postscript: the "sister project" I mentioned is WP Stack.

from wordpress-skeleton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.