Add all files needed to bring up VM and run agaric.com locally

This commit is contained in:
benjamin melançon 2018-08-20 10:45:20 -04:00
parent 52c8b60bac
commit 4d2bc0ee24
742 changed files with 24037 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# Example Scripts for Drupal VM
## Post-Provision Scripts
Drupal VM allows you to run extra shell scripts at the end of the provisioning process, in case you need to do extra custom setup, configure your environment, or install extra software outside the purview of Drupal VM.
To use an extra script, configure the path to the script (relative to `provisioning/playbook.yml`) in `config.yml`:
```yaml
post_provision_scripts:
- "../examples/post-provision.sh"
```
The above example results in the example `post-provision.sh` script running after the main Drupal VM setup is complete. Note that this script would run _every_ time you provision the environment (e.g. once when you run `vagrant up`, then again every time you run `vagrant provision` again).
You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"../examples/post-provision.sh --option"`).
Generally, you should place your post-provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without accidentally overwriting your scripts.

View file

@ -0,0 +1,38 @@
#!/bin/bash
#
# Example shell script to run post-provisioning.
#
# This script configures the default Apache Solr search core to use one of the
# Drupal Solr module's configurations. This shell script presumes you have
# `solr` in the `installed_extras`, and is currently set up for the D8 versions
# of Apache Solr Search or Search API Solr.
SOLR_CORE_NAME="d8"
SOLR_SETUP_COMPLETE_FILE="/etc/drupal_vm_solr_config_complete_$SOLR_CORE_NAME"
# Search API Solr module.
SOLR_DOWNLOAD="http://ftp.drupal.org/files/projects/search_api_solr-8.x-1.x-dev.tar.gz"
SOLR_DOWNLOAD_DIR="/tmp"
SOLR_MODULE_NAME="search_api_solr"
SOLR_VERSION="5.x"
SOLR_CORE_PATH="/var/solr/data/$SOLR_CORE_NAME"
# Check to see if we've already performed this setup.
if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then
# Download and expand the Solr module.
wget -qO- $SOLR_DOWNLOAD | tar xvz -C $SOLR_DOWNLOAD_DIR
# Copy new Solr collection core with the Solr configuration provided by module.
sudo su - solr -c "/opt/solr/bin/solr create -c $SOLR_CORE_NAME -d $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/$SOLR_VERSION/"
# Adjust the autoCommit time so index changes are committed in 1s.
sudo sed -i 's/\(<maxTime>\)\([^<]*\)\(<[^>]*\)/\11000\3/g' $SOLR_CORE_PATH/conf/solrconfig.xml
# Restart Apache Solr.
sudo service solr restart
# Create a file to indicate this script has already run.
sudo touch $SOLR_SETUP_COMPLETE_FILE
else
exit 0
fi

View file

@ -0,0 +1,55 @@
#!/bin/bash
#
# Example shell script to set up PAReview.sh.
#
# You also need to adjust your `config.yml` to add in some other dependencies.
#
# ```
# post_provision_scripts:
# - "../examples/scripts/pareview.sh"
#
# composer_global_packages:
# - { name: hirak/prestissimo, release: '^0.3' }
# - { name: drupal/coder, release: '^' }
#
# nodejs_version: "6.x"
# nodejs_npm_global_packages:
# - eslint
# ```
#
# After running `vagrant provision`, `pareview.sh` should be available anywhere
# in your Vagrant user's $PATH, so you can run commands like:
#
# $ pareview.sh /path/to/my/module
# $ pareview.sh http://git.drupal.org/project/rules.git 8.x-1.x
#
# See: https://github.com/klausi/pareviewsh
PAREVIEW_SETUP_COMPLETE_FILE="/etc/drupal_vm_pareview_config_complete"
HOME_PATH="/home/vagrant"
# Check to see if we've already performed this setup.
if [ ! -e "$PAREVIEW_SETUP_COMPLETE_FILE" ]; then
# Register the `Drupal` and `DrupalPractice` Standard with PHPCS.
$HOME_PATH/.composer/vendor/bin/phpcs --config-set installed_paths $HOME_PATH/.composer/vendor/drupal/coder/coder_sniffer
# Download DrupalSecure.
git clone --branch master https://git.drupal.org/sandbox/coltrane/1921926.git /opt/drupalsecure_code_sniffs
# Move the DrupalSecure directory into the PHPCS Standards.
sudo ln -sv /opt/drupalsecure_code_sniffs/DrupalSecure $HOME_PATH/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards
# Install Codespell.
sudo apt-get install -y python-pip
pip install codespell
# Install PAReview script.
sudo wget -O /opt/pareview.sh https://raw.githubusercontent.com/klausi/pareviewsh/7.x-1.x/pareview.sh
sudo chmod +x /opt/pareview.sh
sudo ln -s /opt/pareview.sh /usr/local/bin
# Create a file to indicate this script has already run.
sudo touch $PAREVIEW_SETUP_COMPLETE_FILE
else
exit 0
fi