-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The problem
While easier and more flexible than our old installation via XAMPP, the current studycloud installation script and corresponding startup script that I developed in #112 are long and sometimes error-prone (especially on Mac OS). Also, they're not attached to the studycloud repository, so it can be hard to go back in git's version history and understand when a change to code in our repository required a change to our installation script. What's more: the installation script depends on package managers which are not always quick to provide the latest and greatest versions of our dependencies (ex: with MySQL 8 and #144). But worst of all, the installation script requires constant maintenance, since it sometimes breaks when the package managers decide to change stuff up (for example, when Homebrew decided to switch to MySQL 8 all of a sudden).
The solution
Create a new installation script and corresponding startup script in a folder in the studycloud repository.
The installation script will use Laradock to install our dependencies: MySQL, phpMyAdmin, composer, php, (git?), Laravel Envoy, and Elasticsearch. Since Laradock uses Docker, the installation script might need to check whether Docker is installed and install it otherwise.
The startup script will use Docker to start all of those services, just like the old startup command. In fact, if I can get this all set up fast enough, I may recommend it instead of editing the old startup command as in #171.
Before running the installation script, users will have to
- check if git is installed
- and install it somehow if it isn't - clone the studycloud repository and the Laradock submodule inside of it
- install Docker
- add the startup script to their
$PATH
The installation script will have to
- create the user's
.envfile (if not already created) - create the user's Laradock
.envfile (if not already created)- perhaps this could be copied from the repository root?
- run the
docker-compose upcommand to install all of our dependencies- MySQL
- phpMyAdmin
- Elasticsearch
- workspace
- run
php artisan key:generateinside the workspace image - run
php artisan storage:linkinside the workspace image - setup the studycloud database inside the mysql docker image
- run
php artisan migrate:fresh --seedinside the workspace image (with mysql running) - Set up docker-sync
The startup script will have to
either
- Startup the proper containers using
docker-compose exec {container-name} - Enter the workspace container by starting it up and typing
bashas an extra argument - Close the containers we opened before
or, if using docker-sync
- do these steps