Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Add build-gutenpack.sh script in repo (#147)
Browse files Browse the repository at this point in the history
* Add build-gutenpack sh script
* Update npm ci command to npx lerna bootstrap --ci
  • Loading branch information
brbrr authored and oskosk committed Dec 10, 2018
1 parent 0a13296 commit d81df1f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 18 deletions.
24 changes: 24 additions & 0 deletions bin/build-gutenpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

CALYPSO_BRANCH="${1:-master}"
JETPACK_DIRNAME="${2:-jetpack}"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 10

echo "Getting wp-calypso branch $CALYPSO_BRANCH"
cd $HOME \
&& git clone https://github.com/automattic/wp-calypso --depth=1 -b "$CALYPSO_BRANCH" \
&& cd wp-calypso \
&& npx lerna bootstrap --ci \
&& echo "Building jetpack-editor for wp-calypso branch $CALYPSO_BRANCH" \
&& npm run sdk -- gutenberg client/gutenberg/extensions/presets/jetpack \
--output-dir=$HOME/apps/$USER/public/wp-content/plugins/"$JETPACK_DIRNAME"/_inc/blocks \
&& echo -e "\nadd_filter( 'jetpack_gutenberg', '__return_true', 10 );\n" >> $HOME/apps/$USER/public/wp-content/plugins/companion/companion.php \
&& echo -e "add_filter( 'jetpack_gutenberg_cdn', '__return_false', 10 );\n" >> $HOME/apps/$USER/public/wp-content/plugins/companion/companion.php \
&& cd $HOME/apps/$USER/public \
&& rm -rf $HOME/wp-calypso \
&& rm -rf $HOME/.npm
49 changes: 32 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
version: "3"
services:
db:
container_name: jn_mysql
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
volumes:
- ./jndb:/var/lib/mysql
ports:
- "${PORT_MYSQL:-3306}:3306"
env_file:
- ../jetpack/docker/default.env
- ../jetpack/docker/.env

wordpress:
image: wordpress
container_name: jn_wordpress
depends_on:
- db
build: ../jetpack/docker
image: jn_wordpress:localbuild
ports:
- 80:80
- "${PORT_WORDPRESS:-80}:80"
env_file:
- ../jetpack/docker/default.env
- ../jetpack/docker/.env
environment:
WORDPRESS_DB_PASSWORD: wordpress
XDEBUG_CONFIG: remote_host=10.0.1.19
- HOST_PORT=${PORT_WORDPRESS}
- WORDPRESS_DB_PASSWORD=wordpress
- XDEBUG_CONFIG=_host=10.0.1.19
volumes:
- ../jetpack:/var/www/html/wp-content/plugins/jetpack
- ../wordpress-develop:/tmp/wordpress-develop
- ../jetpack/docker/wordpress:/var/www/html
- ../jetpack/docker/logs/apache2:/var/log/apache2
- ../jetpack/docker/logs/php:/var/log/php
- ../jetpack/docker/bin:/var/scripts
- ../jetpack/docker/wordpress-develop:/tmp/wordpress-develop
- ../errors:/var/www/html/wp-content/plugins/errors
- ./:/var/www/html/wp-content/plugins/jurassic.ninja
- ../jurassic.ninja-ext:/var/www/html/wp-content/plugins/jurassic.ninja-ext
- ../jetpack-beta:/var/www/html/wp-content/plugins/jetpack-beta-master
links:
- wordpressdb
- wordpressdb:mysql

wordpressdb:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
volumes:
- ./jndb:/var/lib/mysql

2 changes: 1 addition & 1 deletion features/gutenpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
} );

function add_gutenpack( $branch, $jetpack_dir = 'jetpack' ) {
$cmd = 'curl https://gist.githubusercontent.com/oskosk/1b821e70548b065cef1d9c8e6f786089/raw/build-gutenpack.sh --output build-gutenpack.sh'
$cmd = 'curl https://raw.githubusercontent.com/Automattic/jurassic.ninja/fix/gutenpack-build/bin/build-gutenpack.sh --output build-gutenpack.sh'
. " && source build-gutenpack.sh $branch $jetpack_dir";
add_filter( 'jurassic_ninja_feature_command', function ( $s ) use ( $cmd ) {
return "$s && $cmd";
Expand Down

0 comments on commit d81df1f

Please sign in to comment.