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

Improve vagrantfile and provision script. #41

Open
davmillar opened this issue Oct 18, 2016 · 8 comments · May be fixed by #91
Open

Improve vagrantfile and provision script. #41

davmillar opened this issue Oct 18, 2016 · 8 comments · May be fixed by #91

Comments

@davmillar
Copy link
Owner

No description provided.

@devdrops
Copy link

Hi @davmillar! Could you please provide more details on the subject? Like what exactly is required for the environment, like:

  • OS
  • PHP version
  • PHP extensions
  • Tools
  • Extras

@davmillar
Copy link
Owner Author

Hey @devdrops! To be totally honest, I've only really learned about devops enough to stumble my way through this in the last year or two.

I forgot I had previously made a working Vagrantfile and provisioning bash script, but last night I discovered the provisioning script wasn't quite working like it used to, or there may've been manual steps I never remembered to document or automate. There is a copy of it in the repo here. The main needs were something *nix-y, PHP 5.something, MySQL, and Apache.

Any help making it more stable would be much appreciated! And if there's any other info you need about the hosting I use, let me know.

@devdrops
Copy link

@davmillar awesome! Let me get deeper on everything you have here and I'll provide an approach for this issue ;)

@davmillar davmillar changed the title Set up a vagrantfile and provision script. Improve vagrantfile and provision script. Mar 20, 2017
@beporter
Copy link

beporter commented Oct 23, 2021

I'd like to take on some improvements here. A couple Q's:

  • Is PHP v5.x still the target? If the source code is compatible, I'd gently (but strongly) recommend trying for v8+.
  • Vagrant setups can get pretty advanced/flexible... if it's okay with you @davmillar maybe an iterative approach is best? Multiple small, useful improvements till we reach a point of diminishing returns?
  • The bootstrap example you have seems like a perfectly reasonable starting point to me (if maybe a wee bit out of date for 2021). I'm a fan of letting automation take you as far as it can, so I'd like to propose converting it from an example to "official" so that it will work with Vagrant out of the box. (For example: If we're setting up a mysql server inside vagrant, why not provision the app's cgi-bin/db_start.php to default to a vagrant-compatible config that is properly isolated to the developer's local computer?) Objections?
  • Can you please provide an .sql file that contains only the schema (no data) needed for the application? Part of the provisioning process should be to load this schema and any appropriate development data. I can't find anything like this in the codebase though.

@davmillar
Copy link
Owner Author

davmillar commented Oct 24, 2021 via email

@beporter
Copy link

Gotcha. Shared hosting should take care of most of the necessary environment, but I'll try to structure the bootstrap file so it could potentially be reusable between vagrant and a cloud server instance (EC2) or a VPS like linode.

I also meant to include this yesterday, but the mysql schema command should end up looking something like this, btw (replace the variables as appropriate):

mysqldump -h $SERVER -u$USER -p$PASS --no-data $DBNAME > schema_only.sql

@beporter
Copy link

Oh and I noticed that the apache virtual host config mentioned in the .vagrant/bootstrap.sh.example doesn't seem to exist in the repo either. I'm going to write a basic one, but if there are any customizations in there, those will need a second pass.

@beporter beporter linked a pull request Oct 24, 2021 that will close this issue
@davmillar
Copy link
Owner Author

Reviewing the PR branch now.

Regarding PHP, the current version the production site uses is 7.3 and it appears 7.4 is the highest version currently supported from my shared hosting plan.

I want to say the apache virtual host config in the bootstrap example was already in existence in the machine originally so I just edited or appended to it as necessary, but that may have changed since the older versions of the packages have been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants