Skip to content

Instantly share code, notes, and snippets.

@BinaryMoon
Last active December 10, 2016 08:39
Show Gist options
  • Save BinaryMoon/f5a7f3b63d2d555e67fcdcfdd414bffd to your computer and use it in GitHub Desktop.
Save BinaryMoon/f5a7f3b63d2d555e67fcdcfdd414bffd to your computer and use it in GitHub Desktop.
WordPress Build Script
#! /usr/bin/env bash
# Reset timer
SECONDS=0
builddate=`date +"%B %e %Y"`
echo "Build begins: "$builddate
say Build process commenced $builddate
# Generate Granule documentation
rm -rf ./__granule-docs
apigen generate -s ./granule -d ./__granule-docs
say Granule documentation created
# Rebuild Granule SVG
gulp icon --theme granule
say Granule icons rebuilt
# Generate rtl.css
# should add all missing themes however they will need extensive testing for the new automated process
#gulp rtl --theme broadsheet
gulp rtl --theme carmack
#gulp rtl --theme chronicle
gulp rtl --theme label
gulp rtl --theme monet
gulp rtl --theme passenger
gulp rtl --theme puzzle
say Theme RTL files generated
# Check theme text domain
gulp checktextdomain --theme beacon
gulp checktextdomain --theme bexley
gulp checktextdomain --theme broadsheet
gulp checktextdomain --theme bromley
gulp checktextdomain --theme carmack
gulp checktextdomain --theme chronicle
gulp checktextdomain --theme exhibit
gulp checktextdomain --theme isca
gulp checktextdomain --theme kent
gulp checktextdomain --theme label
gulp checktextdomain --theme lens
gulp checktextdomain --theme mimbopro
gulp checktextdomain --theme mirror
gulp checktextdomain --theme monet
gulp checktextdomain --theme opti
gulp checktextdomain --theme passenger
gulp checktextdomain --theme puzzle
gulp checktextdomain --theme romero
gulp checktextdomain --theme traveler
gulp checktextdomain --theme vision
say Theme text domains checked
# Export theme to theme updater.
# Includes removing not required files, adding extra functionality, and zipping the thing.
gulp build-wporg --theme beacon
gulp build-wporg --theme bexley
gulp build-wporg --theme broadsheet
gulp build-wporg --theme bromley
gulp build-wporg --theme carmack
gulp build-wporg --theme chronicle
gulp build-wporg --theme exhibit
gulp build-wporg --theme isca
gulp build-wporg --theme kent
gulp build-wporg --theme label
gulp build-wporg --theme lens
gulp build-wporg --theme mimbopro
gulp build-wporg --theme mirror
gulp build-wporg --theme monet
gulp build-wporg --theme opti
gulp build-wporg --theme passenger
gulp build-wporg --theme puzzle
gulp build-wporg --theme romero
gulp build-wporg --theme traveler
gulp build-wporg --theme vision
say Themes built
# Generate Child theme zip files
gulp build-child-theme --in broadsheet,chronicle --out chronicle
say Child theme zips built
# Build themes bundle containing all themes
gulp build-theme-bundle
say Theme bundle created
# Deploy theme to demo.prothemedesign.com.
gulp deploy-theme --theme beacon
gulp deploy-theme --theme bexley
gulp deploy-theme --theme broadsheet
gulp deploy-theme --theme bromley
gulp deploy-theme --theme carmack
gulp deploy-theme --theme chronicle
gulp deploy-theme --theme exhibit
gulp deploy-theme --theme isca
gulp deploy-theme --theme kent
gulp deploy-theme --theme label
gulp deploy-theme --theme lens
gulp deploy-theme --theme mimbopro
gulp deploy-theme --theme mirror
gulp deploy-theme --theme monet
gulp deploy-theme --theme opti
gulp deploy-theme --theme puzzle
gulp deploy-theme --theme romero
gulp deploy-theme --theme traveler
gulp deploy-theme --theme vision
say Themes deployed to demo site
# Deploy theme packages to theme update server.
gulp deploy-theme-packages
say Themes packages deployed
# Update Granule github files
gulp update-granule
say Granule updated
# Update all pear packages - includes php_codesniffer
pear upgrade-all
say Pear packages updated
# Output time elapsed
duration=$SECONDS
echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
say Build completed in $(($duration / 60)) minutes and $(($duration % 60)) seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment