Code Monkey home page Code Monkey logo

wp-plugin-build's Introduction

plugin-build

Shell script we use to create builds of our WordPress plugins.

Features

  • Verifies that the version numbers in PHP files are correct
  • Reads a list of files to exclude from the build
  • Copies files to a folder and zips them up

Installation

Install the plugin-build script in one of the folders in your PATH. Make sure it has execute permissions (i.e. chmod +x plugin-build).

Usage

Go to your plugin folder on the command line and execute:

$ plugin-build <plugin-slug>[.php] <version>

Example:

$ plugin-build wp-migrate-db 0.6

build Folder

You need to create a build folder within your plugin folder. It houses configuration and hook files to customize the build. It also houses temporary files when running a build.

Inside the build folder, you need a config.php file. This can be empty but it must exist.

All of these following files are optional:

version-check.php - PHP array of regular expressions to check if version number given on the command line matches those in the plugin's PHP files.

$version_checks = array(
	"$plugin_slug.php" => array(
		'@Version:\s+(.*)\n@' => 'header'
	)
);

filter - List of files to exclude from the zip. rsync format. Example:

- .sass-cache
- .DS_Store
- /.git
- /.gitignore

filter.php - Customize your filtering files with some code. See the build-example folder in this repo for how we build the free and pro editions of WP Migrate DB.

pre-zip.php - Code to execute just before zipping up. See the build-example folder in this repo for an example of this and a way to make SVN deployment to WordPress.org and GitHub a part of the build process.

Example build Folder

For WP Migrate DB, we have one git repo for both editions: lite and pro. The build-example folder in this repo is the build folder we use for WP Migrate DB. It filters out certain files depending on the edition (lite or pro) and if it's the lite version, gives us the option of deploying to WordPress.org and a public GitHub repo.

wp-plugin-build's People

Contributors

a5hleyrich avatar bradt avatar gilbitron avatar ianmjones avatar polevaultweb avatar ptasker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wp-plugin-build's Issues

Should not use /usr/bin/php as script interpreter

Should use /usr/bin/env php for more universal support across operating systems, otherwise you'll get something like this...

builds/plugin-build: /usr/bin/php: bad interpreter: No such file or directory

... like I do on NixOS!

Any interest in adding to Packagist?

Seems like it might be nice to be able to require this as a dev dependency, so teams don't have to worry about making sure everyone has it installed, updated, etc.

Any interest in support for ignoring dev dependencies?

Currently, if using dev dependencies via composer, plugin-build results in a zip file with the dev dependencies included.

It would be nice if it were possible to exclude dev dependencies via a flag โ€“ or probably more useful, to only include them via a flag.

Is there any interest in a PR to do this?

I suppose the other way to approach this is to use plugin-build as part of a script that first does composer install --no-dev in a fresh checkout of the plugin repository โ€“ is that what's recommended?

Chance of license?

Hey folks. Any chance of licensing this software for free (as in freedom)?

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.