-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New quickstart pattern #9
base: master
Are you sure you want to change the base?
Conversation
…ox-laravel into new-qs-pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, but I did have some thoughts. Left them inline.
boxfile.yml
Outdated
web.main: | ||
- php artisan migrate --force | ||
- mkdir -p storage/framework/{sessions,cache,views} | ||
# Use node/npm locally for mix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove reference to Elixir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mix is actually a Laravel asset compiler packaged with 5.5: https://laravel.com/docs/5.5/mix
boxfile.yml
Outdated
# add a MySQL database | ||
data.db: | ||
image: nanobox/mysql:5.6 | ||
# Load node modules and run mix tasks during your build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elixir reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
deploy.config: | ||
extra_steps: | ||
- mv .env.prod .env | ||
# Run mix tasks when deploying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elixir reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
quickstart/install.sh
Outdated
# * Should be added in your dashboard or through the nanobox cli\n\n" | ||
|
||
# Prepend .env.prod with documentation | ||
echo -e "$documentation$(cat .env.prod)" > .env.prod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop the cp .env .env.prod
line, and use cat .env
instead, here. Avoids race conditions from opening the redirect before the subshell, and has the same effect as the copy-then-modify is intended to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, great thought.
quickstart/install.sh
Outdated
cp quickstart/static/index.html resources/views/welcome.blade.php | ||
|
||
# Remove quickstart files and extra_step | ||
sed -i -e "1,4d; 38,39d" boxfile.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels a bit fragile to do this based on line number, but I'm not sure doing it by content would be any more stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thought and wondered how many would modify the boxfile before running the quickstart. I guess it's probably better to assume some will. I'll take another crack at this.
quickstart/install.sh
Outdated
# Comment out extra_steps if npm commands are still commented | ||
commentcheck=$(sed '36!d' boxfile.yml) | ||
if [[ $commentcheck = \#* ]]; then | ||
sed -i "35s/extra_steps/# extra_steps/" test-boxfile.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is supposed to be boxfile.yml
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely right.
Use line contents instead of addresses to make changes.
Update boxfile and install script
Update install script for GitHub review
This PR introduces a new pattern and method for generating quickstarts. A weakness of the current pattern is that often times, the pre-generated code base is out of date. With this new pattern, the quickstart will bootstrap a brand new project using the most recent version.