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

Install D8 and modules using composer #476

Merged
merged 7 commits into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ VirtualBox:
2. `cd CLAW`
2. `git submodule update --init --recursive`
3. `cd install`
4. `vagrant up`
4. Visit https://github.com/settings/tokens and get an oauth token (check the 'repos' checkbox when making it) and place it [here](https://github.com/dannylamb/CLAW/blob/c3d7c1c74560b8a130ab94f4660b44125a22e457/install/configs/variables#L21)
5. `vagrant up`

DigitalOcean:

Expand All @@ -51,7 +52,8 @@ DigitalOcean:
* `DIGITALOCEAN_TOKEN` -- Your DigitalOcean API token
* `DIGITALOCEAN_KEYNAME` -- Your DigitalOcean ssh key name
* `DIGITALOCEAN_KEYPATH` -- Path to your ssh keys that you've setup with DigitalOcean
7. `vagrant up --provider=digital_ocean`
7. Visit https://github.com/settings/tokens and get an oauth token (check the 'repos' checkbox when making it) and place it [here](https://github.com/dannylamb/CLAW/blob/c3d7c1c74560b8a130ab94f4660b44125a22e457/install/configs/variables#L21)
8. `vagrant up --provider=digital_ocean`

## Connect

Expand Down
1 change: 0 additions & 1 deletion install/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :path => "./scripts/solr.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/composer.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/drupal.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/drupal-console.sh", :args => home_dir, :privileged => false
config.vm.provision :shell, :path => "./scripts/fcrepo.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/blazegraph.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/karaf.sh", :args => home_dir
Expand Down
4 changes: 3 additions & 1 deletion install/configs/variables
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ CAMEL_VERSION=4.4.0
SOLR_VERSION=6.2.1
BLAZEGRAPH_VERSION=2.1.4
DRUPAL_HOME="/var/www/html/drupal"
DRUPAL_VERSION=8.2.2
DRUSH_CMD="$DRUPAL_HOME/vendor/drush/drush/drush -r $DRUPAL_HOME/web"
DRUPAL_CMD="$DRUPAL_HOME/vendor/drupal/console/bin/drupal --root=$DRUPAL_HOME/web"
FITS_VERSION=1.0.3
FITS_WS_VERSION=1.1.3
MYSQL_USER=root
MYSQL_PASS=islandora
MYSQL_CONNECTOR_VERSION=6.0.4
GITHUB_TOKEN=changeme
102 changes: 36 additions & 66 deletions install/scripts/drupal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,33 @@ fi
cd "$HOME_DIR"

# Drush and drupal deps
apt-get -y -qq install php7.0-gd php7.0-xml php7.0-mysql php7.0-curl php7.0-json php-stomp
cd /tmp && wget http://files.drush.org/drush.phar
chmod +x drush.phar
mv drush.phar /usr/local/bin/drush
apt-get -y -qq install php7.0-gd php7.0-xml php7.0-mysql php7.0-curl php7.0-json
a2enmod rewrite
service apache2 reload
cd /var/www/html

# Download Drupal
drush dl drupal-"$DRUPAL_VERSION" --drupal-project-rename=drupal
git clone https://github.com/Islandora-CLAW/drupal-project drupal
cd "$DRUPAL_HOME"
composer config -g github-oauth.github.com $GITHUB_TOKEN
composer install

# Permissions
chown -R www-data:www-data drupal
chmod -R g+w drupal
# Setup drush and drupal console aliases
touch "$HOME_DIR/.bash_aliases"
echo "alias drush=\"$DRUSH_CMD\"" >> "$HOME_DIR/.bash_aliases"
echo "alias drupal=\"$DRUPAL_CMD\"" >> "$HOME_DIR/.bash_aliases"

# Do the install
cd "$DRUPAL_HOME"
drush si -y --db-url=mysql://root:islandora@localhost/drupal8 --site-name=Islandora-CLAW
drush user-password admin --password=islandora
cd "$DRUPAL_HOME/web"
$DRUSH_CMD si -y --db-url=mysql://root:islandora@localhost/drupal8 --site-name=Islandora-CLAW
$DRUSH_CMD user-password admin --password=islandora

# Set document root
sed -i 's|DocumentRoot /var/www/html$|DocumentRoot /var/www/html/drupal|' /etc/apache2/sites-enabled/000-default.conf
sed -i 's|DocumentRoot /var/www/html$|DocumentRoot /var/www/html/drupal/web|' /etc/apache2/sites-enabled/000-default.conf

# Set override for drupal directory
# TODO Don't do this in main apache conf
sed -i '$i<Directory /var/www/html/drupal>' /etc/apache2/apache2.conf
sed -i '$i<Directory /var/www/html/drupal/web>' /etc/apache2/apache2.conf
sed -i '$i\\tOptions Indexes FollowSymLinks' /etc/apache2/apache2.conf
sed -i '$i\\tAllowOverride All' /etc/apache2/apache2.conf
sed -i '$i\\tRequire all granted' /etc/apache2/apache2.conf
Expand All @@ -46,7 +47,7 @@ sed -i '$i</Directory>' /etc/apache2/apache2.conf
rm /var/www/html/index.html

## Trusted Host Settings
cat >> "$DRUPAL_HOME"/sites/default/settings.php <<EOF
cat >> "$DRUPAL_HOME"/web/sites/default/settings.php <<EOF
\$settings['trusted_host_patterns'] = array(
'^localhost$',
);
Expand All @@ -56,74 +57,43 @@ EOF
service apache2 restart

#Enable Core modules
drush en -y rdf
drush en -y responsive_image
drush en -y syslog
drush en -y serialization
drush en -y basic_auth
drush en -y rest
$DRUSH_CMD en -y rdf
$DRUSH_CMD en -y responsive_image
$DRUSH_CMD en -y syslog
$DRUSH_CMD en -y serialization
$DRUSH_CMD en -y basic_auth
$DRUSH_CMD en -y rest

# Islandora dependencies

# Typed Data
drush dl typed_data
drush en -y typed_data

# Rules
drush dl rules
drush en -y rules

# RDF UI
drush dl rdfui --dev
drush en -y rdfui
drush en -y rdf_builder

# REST UI
drush dl restui
drush en -y restui

# Inline entity form
drush dl inline_entity_form
drush en -y inline_entity_form
$DRUSH_CMD en -y restui

# Media entity ecosystem
drush dl media_entity
drush en -y media_entity
$DRUSH_CMD en -y media_entity

drush dl media_entity_image
drush en -y media_entity_image
$DRUSH_CMD en -y media_entity_image

# Devel
drush dl devel
drush -y en devel
$DRUSH_CMD -y en devel

# Web Profiler
drush dl webprofiler
drush en -y webprofiler
$DRUSH_CMD en -y webprofiler

# Apache Solr
## https://www.drupal.org/node/2613470
drush dl search_api
drush -y pm-uninstall search
drush en -y search_api

# Copy new schema files and restart Tomcat
#cp -a "$DRUPAL_HOME"/sites/all/modules/apachesolr/solr-conf/solr-4.x/. "$SOLR_HOME"/collection1/conf/
#service tomcat7 restart

cd "$DRUPAL_HOME/modules"
git clone https://github.com/DiegoPino/claw-jsonld.git
drush en -y jsonld
$DRUSH_CMD -y pm-uninstall search
$DRUSH_CMD en -y search_api

git clone https://github.com/Islandora-CLAW/islandora.git
drush en -y islandora
$DRUSH_CMD en -y islandora
$DRUSH_CMD en -y islandora_collection

# Set default theme to bootstrap
drush -y dl bootstrap
drush -y en bootstrap
drush -y config-set system.theme default bootstrap
$DRUSH_CMD -y en bootstrap
$DRUSH_CMD -y config-set system.theme default bootstrap

# Permissions
cd /var/www/html
chown -R www-data:www-data drupal
chmod -R g+w drupal
chown -R www-data:www-data "$DRUPAL_HOME"
chmod -R g+w "$DRUPAL_HOME"
usermod -a -G www-data ubuntu

2 changes: 1 addition & 1 deletion install/scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ service karaf-service restart
sleep 60

# Clear drupal cache
drush -r "$DRUPAL_HOME" cache-rebuild
$DRUSH_CMD cache-rebuild