Last active
April 28, 2022 15:05
-
-
Save ZachWatkins/840bc4e2599f7f93474670eb0287b766 to your computer and use it in GitHub Desktop.
Setup WordPress plugin or theme repository for continuous integration service's virtual machine environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RECOMMENDED BY WPENGINE | |
*~ | |
.DS_Store | |
.svn | |
.cvs | |
*.bak | |
*.swp | |
Thumbs.db | |
# large/disallowed file types | |
# a CDN should be used for these | |
*.hqx | |
*.bin | |
*.exe | |
*.dll | |
*.deb | |
*.dmg | |
*.iso | |
*.img | |
*.msi | |
*.msp | |
*.msm | |
*.mid | |
*.midi | |
*.kar | |
*.mp3 | |
*.ogg | |
*.m4a | |
*.ra | |
*.3gpp | |
*.3gp | |
*.mp4 | |
*.mpeg | |
*.mpg | |
*.mov | |
*.webm | |
*.flv | |
*.m4v | |
*.mng | |
*.asx | |
*.asf | |
*.wmv | |
*.avi | |
# Directories that may or may not exist in repo AND should not be on the server | |
package.json | |
bower.json | |
.bower.json | |
.bowerrc | |
config.rb | |
node_modules | |
.sass-cache | |
*.md | |
*.txt | |
*.ai | |
*.scss | |
*.coffee | |
.gitignore | |
LICENSE | |
LICENSE-MIT | |
gruntfile.js | |
Gruntfile.js | |
werker.yml | |
.editorconfig | |
css/src | |
js/src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build | |
composer install | |
npm install | |
grunt develop | |
# Check PHP against WordPress VIP standards | |
npm run checkwp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "agrilife/reponame", | |
"description": "Description", | |
"license": "GPL-2.0+", | |
"authors": [ | |
{ | |
"name": "Zachary Watkins", | |
"email": "[email protected]" | |
} | |
], | |
"minimum-stability": "stable", | |
"require": { | |
}, | |
"require-dev": { | |
"wp-coding-standards/wpcs": "^1.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Release | |
grunt release | |
# Deploy | |
git add --all :/ | |
git commit -m "DEPLOYMENT" | |
git push servers HEAD:refs/heads/master --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "reponame", | |
"version": "1.0.0", | |
"description": "description", | |
"main": "functions.php", | |
"scripts": { | |
"start": "composer install && npm install && grunt", | |
"checkwp": "npm run configphpcs && npm run checkphp", | |
"configphpcs": "vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs && vendor/bin/phpcs --config-set ignore_errors_on_exit 1 && vendor/bin/phpcs --config-set ignore_warnings_on_exit 1", | |
"checkphp": "vendor/bin/phpcs --standard=WordPress --report=source ./*.php ./src && vendor/bin/phpcs --standard=WordPress ./*.php ./src" | |
}, | |
"author": "Zachary Watkins", | |
"license": "GPL-2.0+", | |
"bugs": { | |
"url": "https://github.com/agrilife/reponame/issues", | |
"email": "[email protected]" | |
}, | |
"dependencies": { | |
"autoprefixer": "^9.1.5", | |
"foundation-sites": "^6.x", | |
"grunt": "^1.0.3", | |
"grunt-contrib-coffee": "^2.0.0", | |
"grunt-contrib-compress": "^1.4.3", | |
"grunt-contrib-concat": "^1.0.1", | |
"grunt-contrib-sass": "^1.0.0", | |
"grunt-postcss": "^0.9.0", | |
"jquery": "^3.3.1", | |
"underscore": "^1.9.1", | |
"what-input": "^5.1.2" | |
}, | |
"devDependencies": { | |
"grunt-contrib-watch": "^1.1.0", | |
"grunt-jsvalidate": "^0.2.2", | |
"grunt-sass-lint": "^0.2.4" | |
}, | |
"engines": { | |
"node": ">=6.0.0" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/agrilife/reponame.git" | |
}, | |
"homepage": "https://github.com/agrilife/reponame#readme" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get around shallow update restriction | |
if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi | |
# Add User Data | |
git config --global user.name "codeship-shortreponame" | |
git config --global user.email "[email protected]" | |
git config --global github.token RELEASE_KEY | |
# Combine remote git servers | |
git remote add servers $SERVERNAME_ENVIRONMENT | |
git remote set-url --add --push servers $SERVERNAME_ENVIRONMENT | |
git remote set-url --add --push servers $SERVERNAME2_ENVIRONMENT | |
# Install needed modules | |
rvm use 2.2.6 --install | |
npm install -g sass | |
# Move repo files to a named folder | |
mkdir $FOLDERNAME | |
shopt -s extglob | |
mv !($FOLDERNAME) $FOLDERNAME | |
# Move repo files whose name begins with a period | |
mv .sass-lint.yml $FOLDERNAME/.sass-lint.yml | |
# Exclude development-only files from commit | |
rm .gitignore | |
mv .codeshipignore $FOLDERNAME/.gitignore | |
# Move named folder into a structure identical to the root directory of a WordPress server | |
mkdir -p $DIRECTORY | |
mv $FOLDERNAME $DIRECTORY | |
cd $DIRECTORY/$FOLDERNAME/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment