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

Fixes #1264: Make post-provision.sh script more flexible. #1266

Merged
merged 1 commit into from
Mar 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions scripts/drupal-vm/post-provision.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/usr/bin/env bash
#!/bin/bash

# This command is run as sudo, '~' will expand to '/root'.
VAGRANT_MACHINE_NAME=$(grep vagrant_machine_name: /vagrant/box/config.yml | cut -d' ' -f 2)
REPO_ROOT=/var/www/${VAGRANT_MACHINE_NAME}
cd ${REPO_ROOT}
CONFIG_FILE="/vagrant/box/config.yml"
if [ -f "$CONFIG_FILE" ]
then
VAGRANT_MACHINE_NAME=$(grep vagrant_machine_name: "$CONFIG_FILE" | cut -d' ' -f 2)
REPO_ROOT=/var/www/${VAGRANT_MACHINE_NAME}
cd ${REPO_ROOT}
fi

# Add blt alias to front of .bashrc so that it applies to non-interactive shells.
grep -q -F 'blt' /home/vagrant/.bashrc || (cat ./vendor/acquia/blt/scripts/blt/alias /home/vagrant/.bashrc > temp && mv temp /home/vagrant/.bashrc)

curl https://cloud.acquia.com/pipeline-client/download > /usr/local/bin/pipelines
chmod 755 /usr/local/bin/pipelines
BLT_ALIAS_FILE="./vendor/acquia/blt/scripts/blt/alias"
if [ -f "$BLT_ALIAS_FILE" ]
then
grep -q -F 'blt' /home/vagrant/.bashrc || (cat "$BLT_ALIAS_FILE" /home/vagrant/.bashrc > temp && mv temp /home/vagrant/.bashrc)
else
echo "Make sure you're in the project root and have run composer install."
exit 1
fi