Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

New quickstart pattern #9

wants to merge 17 commits into from

Conversation

sanderson
Copy link
Contributor

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.

Copy link

@danhunsaker danhunsaker left a 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove reference to Elixir?

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elixir reference

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elixir reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

# * 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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great thought.

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

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.

Copy link
Contributor Author

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.

# 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

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right.

danhunsaker and others added 4 commits January 8, 2018 11:04
Use line contents instead of addresses to make changes.
Update boxfile and install script
Update install script for GitHub review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants