Skip to content

Commit

Permalink
Improve after.sh documentation
Browse files Browse the repository at this point in the history
The lack of documentation makes this script, that is run after homestead
was brought up for the first time (rudimentary provisioning script),
very hard to maintain. Already some constructions raise questions:

1. Do we want to install nvm from githubusercontent.com? Or can we pull
it from a trusted repository (apt?)
2. Why is node pinned to version 8.9.1? Maybe make this configurable?
3. Why was the xon statement used?

Story short, Ansible might be a good replacement here?
  • Loading branch information
MKodde committed Nov 28, 2019
1 parent 4448878 commit 3b2edc1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions homestead/after.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,32 @@
# to apply, you may also create user-customizations.sh,
# which will be run after this script.

# Start by updating the apt dependencies making the base box up to date
sudo apt update
DEBIAN_FRONTEND=noninteractive sudo apt upgrade -y
DEBIAN_FRONTEND=noninteractive sudo apt install plantuml -y

cd /home/vagrant/code
# Install the plantuml dependency (used to generate UML diagrams in the markdown files
DEBIAN_FRONTEND=noninteractive sudo apt install plantuml -y

# Use our onw PHP.ini
sudo cp /home/vagrant/code/homestead/php.ini /etc/php/7.2/mods-available/custom.ini

# Use PHP 7.2 by default in our environment
sudo phpenmod -v 7.2 custom


# Aplly the following changes in the code directory
cd /home/vagrant/code

# Install composer dependencies
COMPOSER_MEMORY_LIMIT=-1 composer install

xon

# On successive logins to the vagrant box, automatically CD to the code directory
echo 'cd /home/vagrant/code' >> ~/.profile

# Download and install NVM (ability to switch node/npm versions)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Expand Down

0 comments on commit 3b2edc1

Please sign in to comment.