Skip to content

Commit

Permalink
Now defaults to Sage 10. Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMoser committed Jan 20, 2022
1 parent ccf8018 commit 1f482e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Provides tasks to deploy Roots Sage theme.

Requirements:

- Roots Sage 9.0.*
- Roots Sage 10 (also supports Sage 9, see the included /examples/deploy.full-example.php on how to use with Sage 9)

Load into your deploy.php file with:

Expand Down
5 changes: 5 additions & 0 deletions examples/deploy.full-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
dirname( __FILE__ ) . '/web/app/uploads/' => '{{deploy_path}}/shared/web/app/uploads/',
] );

// With Sage 9 you will have to change the distribution files path to /dist
//set('sage/dist_path', '/dist');

// With Sage 9 you will have to change the build script command to "build:production"
//set('sage/build_command', 'build:production');

// Hosts

Expand Down
15 changes: 11 additions & 4 deletions recipe/sage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,31 @@

namespace Deployer;

// Set default path of distribution folder. This is /public with Sage 10,
// and /dist with Sage 9
set('sage/dist_path', '/public');

// Build script used. Will be "build" with Sage 10 or "build:production" with Sage 9
set('sage/build_command', 'build');

desc( 'Runs composer install on remote server' );
task( 'sage:vendors', function () {
run( 'cd {{release_path}}/{{theme_path}} && {{bin/composer}} {{composer_options}}' );
} );

desc( 'Compiles the theme locally for production' );
task( 'sage:compile', function () {
runLocally( "cd {{local_root}}/{{theme_path}} && yarn run build:production" );
runLocally( "cd {{local_root}}/{{theme_path}} && yarn run {{sage/build_command}}" );
} );

desc( 'Removes the /dist folder on the destination' );
desc( 'Removes the folder for distributed files on the destination' );
task( 'sage:clear_assets', function () {
run( 'rm -rf {{release_path}}/{{theme_path}}/dist' );
run( 'rm -rf {{release_path}}/{{theme_path}}{{sage/dist_path}}' );
} );

desc( 'Updates remote assets with local assets, but without deleting previous assets on destination' );
task( 'sage:upload_assets_only', function () {
upload( '{{local_root}}/{{theme_path}}/dist', '{{release_path}}/{{theme_path}}' );
upload( '{{local_root}}/{{theme_path}}{{sage/dist_path}}', '{{release_path}}/{{theme_path}}' );
} );

desc( 'Updates remote assets with local assets' );
Expand Down

0 comments on commit 1f482e7

Please sign in to comment.