-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add commands to easily setup and start dummy app
Use bin/setup to setup local dev env and bin/start to start the dummy app for local testing.
- Loading branch information
Showing
3 changed files
with
56 additions
and
4 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
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,37 @@ | ||
#!/usr/bin/env ruby | ||
require "fileutils" | ||
|
||
# path to dummy application root. | ||
APP_ROOT = File.expand_path("../spec/dummy", __dir__) | ||
|
||
# path to alchemy gem | ||
GEM_ROOT = File.expand_path("../", __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
FileUtils.chdir GEM_ROOT do | ||
puts "\n== Linking Admin JS package ==" | ||
system! "yarn link" | ||
puts "== Installing dependencies ==" | ||
system! "yarn install" | ||
system! "gem install bundler --conservative" | ||
system("bundle check") || system!("bundle install") | ||
end | ||
|
||
FileUtils.chdir APP_ROOT do | ||
puts "\n== Installing Alchemy into dummy app ==" | ||
system!("bin/rails javascript:install:esbuild") | ||
system!("bin/rails g alchemy:install --skip --skip-demo-files --auto-accept") | ||
|
||
puts "\n== Link Alchemy admin package ==" | ||
system! "yarn link @alchemy_cms/admin" | ||
system! "yarn install" | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! "bin/rails log:clear tmp:clear" | ||
end | ||
|
||
puts "\n== Alchemy is ready 🎉 ==" | ||
puts "Start server by typing:\n\n bin/start" |
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,17 @@ | ||
#!/usr/bin/env ruby | ||
require "fileutils" | ||
|
||
# path to dummy application root. | ||
APP_ROOT = File.expand_path("../spec/dummy", __dir__) | ||
|
||
# path to alchemy gem | ||
GEM_ROOT = File.expand_path("../", __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
FileUtils.chdir APP_ROOT do | ||
puts "\n== Starting dummy app ==" | ||
system! "bin/dev" | ||
end |