-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Overhaul Vagrantfile and bootstrap.sh provisioner. #91
base: main
Are you sure you want to change the base?
Conversation
d4e9b78
to
40e5603
Compare
Builds on davmillar#91 to add the existing asset pipeline tooling to (only) the vagrant box. This work conflicts with davmillar#90 somewhat. In general, davmillar#90 is preferable as it moves things forward and this PR merely meets the project where it's at. If anything, I'd recommend merging this one first, then adapting davmillar#90 to: 1. Not use yarn. It's unnecessary. 2. Replace yarn.lock with package-lock.json. 3. Remove the unnecessary yui-compressor from the Vagrantfile provisioning block.
I've added the schema to the schema file and scrubbed/partial dumps for test data to the pull request. I am running into a 500 error on the main index page after bringing up the new vagrant box, but neither the new log locations nor the previous expected locations are showing me anything. Most of the changes look good, though, and I appreciate the work you've put in so far. :) |
Confirmed I'm still seeing a 500 as well-- same as before the schema load. The relevant log files are:
The error is:
This is due to the SQL query string declaring an expected database name in addition to table name: - $navdata = $pdo->query("SELECT url_slug, name FROM dmillar_cartography.artists ORDER BY name ASC");
+ $navdata = $pdo->query("SELECT url_slug, name FROM artists ORDER BY name ASC"); I've made this tweak, and I'm also updating the logging configs. |
@davmillar If I might humbly request: I want to be really transparent about this work having been done in the tradition of Hacktoberfest and while we've both worked on this as time presented itself over a few weeks, I'm a little anxious now that it's October 30th. 😅 I definitely don't expect the PR to get merged immediately if there are still things to tweak or testing to be done, but I'd be quite grateful if you'd be willing to add the |
Builds on davmillar#91 to add the existing asset pipeline tooling to (only) the vagrant box. This work conflicts with davmillar#90 somewhat. In general, davmillar#90 is preferable as it moves things forward and this PR merely meets the project where it's at. If anything, I'd recommend merging this one first, then adapting davmillar#90 to: 1. Not use yarn. It's unnecessary. 2. Replace yarn.lock with package-lock.json. 3. Remove the unnecessary yui-compressor from the Vagrantfile provisioning block.
Resolves #41 by overhauling the Vagrant environment.
There are a few
TODO
tags in the changed code that have been previously discussed (SQL schema for example.)The main goal here is to provide a more reliable, easier development platform from which people are able to contribute.
Testing
vagrant up
.info.php
file to the project root locally (did not commit) and put<?php phpinfo();
in it to test http://localhost:4069/info.phpvagrant reload --provision
to reboot the VM and re-run all provisioning of top of what's already been done in the VM.vagrant destroy -f
Details
.vagrant/
(toprovision/
) because most people will expect to have that entire folder in their global .gitignore..gitignore
file a bit to conform with general Vagrant expectations and to prevent sensitive DB credentials from accidentally being committed back to the repo.cgi-bin/.gitignore
(the root level gitignore covers sub-directories.)?>
tags from db_start.php and db_end.php as this is a PHP best practice.cgi-bin/db_start.php.example
the actual file copied into place for vagrant. This makes it a more practical example file.provision/schema.sql
to auto-load a starter schema into the DB in development (nobody else can really work on this project without the DB structure.)Vagrantfile
with:bento/ubuntu
was chosen because it provides boxes across all major Vagrant providers, so users with VMware benefit from the increased emulation speed compared to Virtualbox./var/www/daves-mapper
. This is where the folder will end up in production (typically) so it makes sense to make the dev environment match that as closely as possible./var/log/php_error.log
and/var/log/apache2/daves-mapper/error.log
for better debugging visibility.~/.my.cnf
file inside the VM (or on the production server) to greatly easymysql
command line use and avoid the use of passwords in typed command lines. This password is already stored in plaintext on the server in db_start.php so there is no significant increase in security risk by doing this, but there is a significant convenience factor.