GithubHelp home page GithubHelp logo

web5design / wp-plugin-in-github Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sudar/wp-plugin-in-github

0.0 3.0 0.0 393 KB

Collection of shell scripts that I am using to manage and deploy WordPress Plugins from github into svn

Home Page: http://sudarmuthu.com/blog/developing-wordpress-plugins-in-github

wp-plugin-in-github's Introduction

What is this?

Collection of bash scripts that I am using to manage and deploy my WordPress Plugins from GitHub into WordPress official repository svn.

Make sure you have git-svn installed. In Ubuntu you can do sudo apt-get install git-svn

  • clone-from-svn-to-git.sh - Use this script to clone your WordPress Plugins from SVN into git/github
  • deploy-plugin.sh - Use this script to push your WordPress Plugin updates to SVN from git/github
  • readme-converter.sh - Use this script to convert readme files between Github markdown and WordPress repo markdown format
  • create-archive.sh - Use this script to create a zip archive of the Plugin
  • update-version.sh - Use this script to update version string in all the files of the Plugin

Usage

Cloning existing Plugins from SVN into github

You can use the clone-from-svn-to-git.sh script to clone an existing Plugin from the official WordPress repository SVN into github.

.path/to/clone-from-svn-to-git.sh [-p plugin-name] [-a authors-file] [-u svn-username] [-g github-repo-url]

The following are the different options that you can pass to this script.

  • -p - The name of the Plugin
  • -a - The path to the authors file. You can find a sample authors file in the root directory of the repo.
  • -u - The svn username. It is same as your WordPress Plugin repo username.
  • -g - The url to the github repo. You should have push rights to this repo.

Deploying to SVN repo from Github

You can use the deploy-plugin.sh script to deploy your Plugins to SVN repo, from a git repo.

You don't need to have a copy of this script in every repo. You just need to have one copy of this script somewhere and then you can invoke it from multiple Plugin directories using the following options.

./path/to/deploy-plugin.sh [-p plugin-name] [-u svn-username] [-m main-plugin-file]
        [-a assets-dir-name] [-t tmp directory] [-i path/to/i18n] [-h history/changelog file]

The following are the different options that you can pass to this script.

  • -p - The name of the Plugin. The script can pick it up from the current directory name
  • -u - The svn username. It is same as your WordPress Plugin repo username.
  • -m - The name of the main Plugin file. By default it is plugin-name.php
  • -a - The name of the Plugin's assets directory. By default it is assumed to be assets-wp-repo
  • -t - Path to the temporary directory. By default /tmp is used
  • -i - Path to the WordPress i18n tools directory. By default ../i18n is used. You have to checkout a local copy of the i18n tools from http://i18n.svn.wordpress.org/tools/trunk/
  • -h - The name of the History or changelog file. By default HISTORY.md is used.

Convert readme file from md to txt format and vice versa

You can use the readme-converter.sh script to convert the readme file between WordPress Plugin format and github markdown format. This script also handles screenshots as well.

The deploy-script.sh script automatically does the conversion by using this script.

./path/to/readme-converter.sh [from-file] [to-file] [format to-wp|from-wp]

The following are the different options that you can pass to this script.

  • The first parameter is the path to the input file
  • The second parameter is the path to the output file
  • The third parameter specifies the format. You can use one of the following two.
    • to-wp - convert from Github markdown format to WordPress Plugin Readme format
    • from-wp - convert from WordPress Plugin Readme format to Github markdown format

Creating a zip archive of the Plugin

You can use the create-archive.sh script to quickly create a zip archive of the Plugin.

./path/to/create-archive.sh [-p plugin-name] [-o output-dir]

The following are the different options that you can pass to this script.

  • -p - The name of the Plugin. The script can pick it up from the current directory name
  • -o - Path to the output directory, where the zip file should be created

Update version string of the Plugin

You can use the update-version.sh script to quickly update the version string of all the files of the Plugin.

./path/to/update-version.sh [old_version] [new_version]

The following are the different options that you can pass to this script.

  • old_version - Old version string. This string should be escaped. eg: 1.2.3 and not 1.2.3
  • new_version - New version string. You don't have to escape this

Code Quality Status

The code is pretty stable and I currently use these script for deploying my WordPress Plugins without any major issues. I would however consider the code to be of beta quality status.

Contribution

All contributions (even documentation) are welcome :)

If you would like to contribute to this project, then just fork it in github and send a pull request.

If you are looking for ideas, then you can start with the below TODO list.

TODO

Here is the list of things that I want to implement. Pull requests are welcome :)

  • Delete files from svn that have been removed in the directory
  • Find ways to speed up things in the clone script
  • Add batch support in the clone script
  • Provide an option to specify the list of files that should be ignored while replacing version string
  • Ability to automatically show screenshots
  • Ability to auto update and generate .pot files
  • In the deploy script, add support for assets/ folder
  • In the deploy script, checkout only the trunk/ for the Plugin from svn
  • Make the readme.txt <-> readme.md translation better, so that Plugin readme files appear good in github.

License

The source code and the config files are released under "THE BEER-WARE" license.

I would, however, consider it a great courtesy if you could email me and tell me about your project and how this code was used, just for my own continued personal gratification :)

You can also find other ways to make me happy, if you liked this project ;)

wp-plugin-in-github's People

Contributors

acusti avatar nextgenthemes avatar shield-9 avatar sudar avatar wedi avatar

Watchers

 avatar  avatar  avatar

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.