Mustafa Uysal

I'm traveling light, it's au revoir…

Deploying from Git

This post has been outdated, probably the technique is still valid and works for most cases but there is a better way to manage plugin deployments with GitHub actions, use 10up deploy actions. Learn more.

I like to use git for my plugins and deploy them to WordPress.org’s svn from git. I’m using scribu’s scripts and I did small modifications on it  – https://github.com/mustafauysal/deploy-from-git

1) Directory Structure

I’m using my-plugins directory on Desktop and it looks like

my-plugins

2) Symlink to project

When I need to work on my plugins, just symlink to current WordPress’ plugins directory.

[UPDATE 2019] Symlink was a bad idea, I don’t touch those repositories until I’m ready to publish the update. When development is done, just switch the git repo, then git pull && plugin-deploy && plugin-tag 1.4.5 whatever

3) Deploy like a Boss

After work is done, just run “plugin-deploy” command. I’ve added “plugin-deploy” as an alias, you can add them to the export path as well.

[code]

alias plugin-deploy=’sh /Users/mustafauysal/scripts/plugin-deploy.sh’

alias plugin-tag=’sh /Users/mustafauysal/scripts/plugin-tag.sh’

[/code]

Tips:

1) Use WP-CLI to generate plugins
You can use wp scaffold plugin foo-bar to generate “foo-bar” plugin; these scripts will respect .distignore file (Your plugins will be clean on WordPress.org)

2) Don’t tag plugins which contain too many objects
Yeah, I made that mistake for my https://github.com/mustafauysal/compressed-emoji plugin and..

Interrupted 2-3 times. Yikes!
Interrupted 2-3 times. Yikes!

Cheers,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.