-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENG-191: Create alternate sandbox script which copies Starter FE into…
… app Goal ---- As a `solidus_starter_frontend` contributor I want an alternate sandbox script which copies Starter FE into the sandbox application So that I have an easy way to confirm if the Starter FE can generate a working frontend for a Rails app. Previous implementations ------------------------ * Fix sandbox script #166. Relevant links -------------- #167 (comment) - discussion on having two strategies for generating the sandbox app: one with the Starter FE running as an engine and other where Starter FE is generated into the app.
- Loading branch information
Showing
4 changed files
with
59 additions
and
8 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 |
---|---|---|
|
@@ -16,6 +16,7 @@ pkg | |
spec/dummy | ||
spec/examples.txt | ||
/sandbox | ||
/sandbox-generated | ||
.rvmrc | ||
.ruby-version | ||
.ruby-gemset | ||
|
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,16 @@ | ||
#!/usr/bin/env ruby | ||
|
||
app_root = 'sandbox-generated' | ||
|
||
unless File.exist? "#{app_root}/bin/rails" | ||
warn "Creating the #{app_root} app..." | ||
Dir.chdir "#{__dir__}/.." do | ||
system "GENERATE_FRONTEND=1 #{__dir__}/sandbox" or begin | ||
warn "Automatic creation of the #{app_root} app failed" | ||
exit 1 | ||
end | ||
end | ||
end | ||
|
||
Dir.chdir app_root | ||
exec 'bin/rails', *ARGV |
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
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 |
---|---|---|
|
@@ -26,8 +26,15 @@ require 'solidus_starter_frontend/factories' | |
``` | ||
|
||
### Running the sandbox | ||
To run this extension in a sandboxed Solidus application, you can run | ||
`bin/sandbox`. The path for the sandbox app is `./sandbox` and `bin/rails` will | ||
|
||
You can create two kinds of Solidus applications to test this project: an app | ||
where this gem runs as an engine, and an app where the storefront is generated | ||
with this gem. | ||
|
||
#### App with gem running as engine | ||
|
||
To run this extension as an engine in a sandboxed Solidus application, you can run | ||
`bin/sandbox`. The path for the sandbox app is `./sandbox` and `bin/rails` will | ||
forward any Rails commands to `sandbox/bin/rails`. | ||
|
||
Here's an example: | ||
|
@@ -42,6 +49,18 @@ Use Ctrl-C to stop | |
|
||
Default username and password for admin are: `[email protected]` and `test123`. | ||
|
||
#### App with storefront generated by the gem | ||
|
||
To create a sandboxed Solidus application where the storefront is generated with | ||
this gem, run `GENERATE_FRONTEND=1 bin/sandbox`. The path for the sandbox app | ||
is `./sandbox-generated`. Unlike the previous `./sandbox` app, you'll need to | ||
`cd` to the `./sandbox-generated` directory in order to run the application. | ||
|
||
As a shortcut, you can run `bin/rails-sandbox-generated` to create the app and | ||
then run the Rails server. | ||
|
||
|
||
|
||
### Updating the changelog | ||
Before and after releases the changelog should be updated to reflect the | ||
up-to-date status of the project: | ||
|