Skip to content

Commit

Permalink
Merge pull request #160 from whikloj/sprint-002-thinCollection
Browse files Browse the repository at this point in the history
Sprint 003 Thin Collection Controller
  • Loading branch information
ruebot committed Mar 24, 2016
2 parents b79d216 + 3b98597 commit 72d17f7
Show file tree
Hide file tree
Showing 27 changed files with 3,078 additions and 130 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tests/test_config.ini
install/.vagrant
install/downloads
site/
installer
composer.phar
vendor

services/ResourceService/composer.lock

services/ResourceServiceProvider/composer.lock
1 change: 0 additions & 1 deletion camel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

<modules>
<module>sync</module>
<module>services</module>
<module>component</module>
<module>karaf</module>
</modules>
Expand Down
2 changes: 2 additions & 0 deletions install/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat
config.vm.network :forwarded_port, guest: 8181, host: 8181 # Karaf
config.vm.network :forwarded_port, guest: 8282, host: 8282 # Islandora Microservices
config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL
config.vm.network :forwarded_port, guest: 5432, host: 5432 # PostgreSQL

Expand All @@ -70,4 +71,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :path => "./scripts/islandora-karaf-components.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/config.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/post-install.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/islandora-microservices.sh", :args => home_dir
end
47 changes: 47 additions & 0 deletions install/configs/001-microservices.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<VirtualHost *:8282>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /opt/islandora/services/src

<Directory /opt/islandora/services/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase /src
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /index.php [QSA,L]
</IfModule>

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
#LogLevel info rewrite:trace3
LogLevel info

ErrorLog ${APACHE_LOG_DIR}/services-error.log
CustomLog ${APACHE_LOG_DIR}/services-access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
2 changes: 0 additions & 2 deletions install/configs/karaf/watch.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
bundle:watch --start mvn:ca.islandora.camel.component/islandora-camel-component/0.0.1-SNAPSHOT
bundle:watch --start mvn:ca.islandora.camel.sync/islandora-sync-gateway/0.0.1-SNAPSHOT
bundle:watch --start mvn:ca.islandora.camel.services/islandora-collection-service/0.0.1-SNAPSHOT
bundle:watch --start mvn:ca.islandora.camel.services/islandora-basic-image-service/0.0.1-SNAPSHOT
logout
18 changes: 18 additions & 0 deletions install/scripts/align_branches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# whikloj - 2016-03-22
#
# Changes the version for islandora/resource-service or
# islandora/transaction-service to 'dev-<current branch>'

# Currently selected branch in git
CURRENT_BRANCH=$(git branch | grep '*' | cut -d' ' -f2)
# List of directories to change composer.json in
AFFECTS_DIR=". CollectionService TransactionService"

echo "Altering composer.json to use branch 'dev-${CURRENT_BRANCH}'..."
for i in $AFFECTS_DIR; do
mv $i/composer.json $i/composer.json_bkup
awk -v BRANCH=$CURRENT_BRANCH '/islandora\/(resource|transaction|collection)/ { print gensub(/(.+):\s*"dev-[^"]+/, "\\1: \"dev-"BRANCH, 1)} !/islandora\/(resource|transaction|collection)/ { print $0}' $i/composer.json_bkup > $i/composer.json
done
echo "Done"

Empty file modified install/scripts/drupal.sh
100644 → 100755
Empty file.
6 changes: 0 additions & 6 deletions install/scripts/islandora-karaf-components.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ fi

echo "Installing Islandora Sync Gateway"
$KARAF_CLIENT -f $KARAF_CONFIGS/islandora_sync_gateway.script
sleep 10
echo "Installing Islandora Basic Image Service"
$KARAF_CLIENT -f $KARAF_CONFIGS/islandora_basic_image.script
sleep 10
echo "Installing Islandora Collection Service"
$KARAF_CLIENT -f $KARAF_CONFIGS/islandora_collection.script
28 changes: 28 additions & 0 deletions install/scripts/islandora-microservices.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
echo "Installing Composer and Islandora Microservices"

HOME_DIR=$1
if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

ln -s "$HOME_DIR/islandora" "/opt/islandora"

cp "$HOME_DIR/islandora/install/configs/001-microservices.conf" "/etc/apache2/sites-enabled/"

if [ $(grep -c 'Listen 8282' /etc/apache2/ports.conf) != 1 ]; then
echo "Adding Listen 8282 to Apache ports.conf"
sed -i '/Listen 80$/a \Listen 8282' /etc/apache2/ports.conf
fi

/etc/init.d/apache2 restart

cp "$HOME_DIR/islandora/install/scripts/align_branches.sh" "/opt/islandora/services"
cd /opt/islandora/services
./align_branches.sh

php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '41e71d86b40f28e771d4bb662b997f79625196afcca95a5abf44391188c695c6c1456e16154c75a211d238cc3bc5cb47') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar update
11 changes: 10 additions & 1 deletion services/CollectionService/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
"repositories": [{
"type": "path",
"url": "../ResourceService"
},
{
"type": "path",
"url": "../TransactionService"
}],
"require": {
"islandora/chullo": "^0.0",
"islandora/resource-service" : "dev-sprint-002",
"islandora/resource-service" : "dev-sprint-002-working-vagrant",
"islandora/transaction-service" : "dev-sprint-002-working-vagrant",
"silex/silex": "^1.3",
"symfony/config": "^3.0",
"twig/twig": "^1.23",
Expand All @@ -22,6 +27,10 @@
{
"name": "Diego Pino Navarro",
"email": "dpino@krayon.cl"
},
{
"name": "Jared Whiklo",
"email": "jwhiklo@gmail.com"
}
]
}
23 changes: 12 additions & 11 deletions services/CollectionService/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions services/CollectionService/config/settings.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ islandora:
apiVersion: 0.0.1
fedoraProtocol: http
fedoraHost: "localhost:8080"
fedoraPath: /rest
fedoraPath: /fcrepo/rest
tripleProtocol: http
tripleHost: "localhost:9999"
tripleHost: "localhost:8080"
triplePath: /bigdata/sparql
resourceIdRegex: "(?:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?"
# This domain is used as namespace (hashed) when generating UUID V5 identifiers, replace with your own
Expand Down
Loading

0 comments on commit 72d17f7

Please sign in to comment.