-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ship It script setup and ready to help push builds to production envi…
…ronments
- Loading branch information
Showing
16 changed files
with
433 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 SkyPress, LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Customer Experience API | ||
This repo holds the build and local development functions for the CX API | ||
|
||
v0.1.0-alpha | ||
|
||
Requires: | ||
|
||
* Node | ||
* NPM | ||
* Yarn | ||
* NG-CLI | ||
* Composer | ||
* Docker | ||
* Docker Compose | ||
|
||
## First steps | ||
|
||
* Clone this repo | ||
* Run `docker-compose up -d` | ||
* `composer install` in `/wordpress/wp-content/plugins/cx-api` | ||
* `composer install` in `/wordpress/wp-content/themes/cx-ng-theme` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# NG WAR Theme | ||
This is the pre-build structure of an Angular project. The following adjustments compliment our workflow for creating a WordPress theme based on Angular. | ||
|
||
## First Steps | ||
|
||
### Install additional packages | ||
|
||
``` | ||
ng new [name] | ||
ng set --global packageManager=yarn | ||
yarn add @skypress/wp-client@latest | ||
``` | ||
|
||
Optional | ||
|
||
``` | ||
yarn add ng-packagr@latest --dev | ||
yarn add @ng-bootstrap/ng-bootstrap | ||
``` | ||
|
||
### Edit Config Files | ||
|
||
Edit the value of `outDir` in your new `.angular-cli.json`: | ||
|
||
``` | ||
"outDir": "../../wordpress/wp-content/themes/ng-war-theme/src", | ||
``` | ||
|
||
Optional: | ||
|
||
You can change the `prefix` as well to something other than `app`. | ||
|
||
Set these `ng-cli` defaults if you'd like: | ||
|
||
``` | ||
"defaults": { | ||
"styleExt": "css", | ||
"component": { | ||
"spec": false, | ||
"inlineStyle": true, | ||
"inlineTemplate": true | ||
}, | ||
"directive": { | ||
"spec": false | ||
}, | ||
"module": { | ||
"spec": false | ||
}, | ||
"service": { | ||
"spec": false | ||
}, | ||
"class": { | ||
"spec": false | ||
} | ||
} | ||
``` | ||
|
||
If you installed `ng-packagr` then add new scripts to your `package.json`: | ||
|
||
``` | ||
"build:<package name>": "ng-packagr -p src/app/<package name>/package.json" | ||
``` | ||
|
||
Then, in `src/app/<package name>` make sure to have a `package.json` file: | ||
|
||
``` | ||
{ | ||
"name": "", | ||
"version": "", | ||
"keywords": [], | ||
"author": "", | ||
"license": "", | ||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", | ||
"ngPackage": { | ||
"lib": { | ||
"entryFile": "index.ts" | ||
}, | ||
"dest": "<path relative to>/<package.json>" | ||
} | ||
} | ||
``` | ||
|
||
See https://www.npmjs.com/package/ng-packagr for more help |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3' | ||
|
||
services: | ||
wordpress: | ||
image: wordpress:latest | ||
links: | ||
- mysqldb:mysql | ||
volumes: | ||
- ./wordpress/wp-content:/var/www/html/wp-content | ||
ports: | ||
- 8080:80 | ||
environment: | ||
WORDPRESS_DB_USER: wordpress | ||
WORDPRESS_DB_PASSWORD: wordpress | ||
|
||
mysqldb: | ||
image: mysql:latest | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: secretpress | ||
MYSQL_DATABASE: wordpress | ||
MYSQL_USER: wordpress | ||
MYSQL_PASSWORD: wordpress | ||
|
||
phpmyadmin: | ||
image: phpmyadmin/phpmyadmin:latest | ||
links: | ||
- mysqldb:mysql | ||
ports: | ||
- 8181:80 | ||
environment: | ||
PMA_HOST: mysql | ||
|
||
volumes: | ||
db_data: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
#Author: BMO | ||
#Version: 0.1.0-alpha | ||
|
||
if [[ -n ${2} ]]; then | ||
root=${2} | ||
else | ||
root="/usr/local/bin/composer" | ||
fi | ||
|
||
if [[ -n ${1} ]]; then | ||
current_branch=$(git rev-parse --abbrev-ref HEAD) | ||
echo -e "Splitting out WordPress into temporary branch" | ||
git subtree split --prefix=wordpress -b shipit && git checkout shipit | ||
echo -e "Running composer install for plugins and themes" | ||
find wp-content -maxdepth 3 -iname "composer.json" -type f -execdir php ${root} install --no-dev --prefer-source -o \; | ||
find wp-content -iname ".git" -type d -exec rm -rf "{}" \; | ||
echo -e "Pushing temporary branc" | ||
git add . --all && git commit -am "Pre-ship commit" && git push -f ${1} shipit:master | ||
echo -e "Cleaning up after ourselves" | ||
git checkout ${current_branch} && git branch -D shipit | ||
rm -rf ./wp-content | ||
exit 0 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
wp-content/**/.git* | ||
**/.git | ||
**/.git* | ||
!.gitignore | ||
angular | ||
wordpress |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CUSTOM WAR PLUGIN | ||
|
||
* Rename plugin directory and `my-api.php` file | ||
* Edit description block in (new) `my-api.php` file | ||
* `composer install` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"minimum-stability": "dev", | ||
"require": { | ||
"skypress/war-api-plugin": "dev-master" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Plugin Name: My Api | ||
* Plugin URI: PLUGIN SITE HERE | ||
* Description: PLUGIN DESCRIPTION HERE | ||
* Author: YOUR NAME HERE | ||
* Author URI: YOUR SITE HERE | ||
* Text Domain: my-api | ||
* Domain Path: /languages | ||
* Version: 0.1.0 | ||
* | ||
* @package My_Api | ||
*/ | ||
|
||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
use WAR\Api as WAR_Api; | ||
|
||
function my_init(){ | ||
// Init the WAR Api | ||
$war_api = new WAR_Api; | ||
$war_api->init(); | ||
} | ||
|
||
// Extend the War API | ||
add_action( 'plugins_loaded', 'my_init' ); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CUSTOM WAR THEME | ||
|
||
* Rename theme directory | ||
* Edit description block in `style.css` | ||
* `composer install` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"minimum-stability": "alpha", | ||
"require": { | ||
"skypress/war-ng-theme": "^0.1.0@alpha" | ||
} | ||
} |
Oops, something went wrong.