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

Commit

Permalink
Add ability to launch with bleeding edge Gutenberg (master branch) (#143
Browse files Browse the repository at this point in the history
)

* Add ability to launch with Gutenberg from the master branch of its repository

* Bump version to 4.4
  • Loading branch information
oskosk authored Nov 16, 2018
1 parent 8536c89 commit 09e1c07
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
43 changes: 43 additions & 0 deletions features/gutenberg-master.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace jn;

add_action( 'jurassic_ninja_init', function() {
$defaults = [
'gutenberg-master' => false,
];

add_action( 'jurassic_ninja_add_features_before_auto_login', function( &$app = null, $features, $domain ) use ( $defaults ) {
$features = array_merge( $defaults, $features );
if ( $features['gutenberg-master'] ) {
debug( '%s: Adding bleeding edge Gutenberg plugin', $domain );
add_gutenberg_master();
}
}, 10, 3 );

add_filter( 'jurassic_ninja_rest_feature_defaults', function( $defaults ) {
return array_merge( $defaults, [
'gutenberg-master' => false,
] );
} );

add_filter( 'jurassic_ninja_rest_create_request_features', function( $features, $json_params ) {
if ( isset( $json_params['gutenberg-master'] ) ) {
$features['gutenberg-master'] = $json_params['gutenberg-master'];
}
return $features;
}, 10, 2 );

} );

/**
* Installs and activates the bleeding edge version of the Gutenberg plugin from GitHub.
*/
function add_gutenberg_master() {
$cmd = 'curl https://gist.githubusercontent.com/oskosk/0b7c45522c945a62309dd57103f94133/raw/build-gutenberg-master.sh --output build-gutenberg-master.sh'
. ' && source build-gutenberg-master.sh'
. ' && wp plugin activate gutenberg';
add_filter( 'jurassic_ninja_feature_command', function ( $s ) use ( $cmd ) {
return "$s && $cmd";
} );
}
2 changes: 1 addition & 1 deletion jurassic.ninja.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* Plugin Name: Jurassic Ninja
* Description: Launch ephemeral instances of WordPress + Jetpack using ServerPilot and an Ubuntu Box.
* Version: 4.3
* Version: 4.4
* Author: Automattic
**/

Expand Down
1 change: 1 addition & 0 deletions lib/stuff.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function require_feature_files() {
'/features/wp-debug-log.php',
'/features/gutenpack.php',
'/features/wordpress-5-beta.php',
'/features/gutenberg-master.php',
];

$available_features = apply_filters( 'jurassic_ninja_available_features', $available_features );
Expand Down

0 comments on commit 09e1c07

Please sign in to comment.