#!/usr/bin/env bash

# Check s3://test-bathymetry-logs to see the stout/sterr of a boot strap action
# Where the bootstrapping occurs;
# /emr/instance-controller/lib/bootstrap-actions/1

echo pwd
pwd
echo home
echo $HOME

sudo yum install emacs -y
sudo yum install git -y

# installing maven
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven

# Installing geomesat
export VERSION=2.0.2
set -e
wget -S -T 10 -t 5 "https://repo.locationtech.org/content/repositories/geomesa-releases/org/locationtech/geomesa/geomesa-hbase-dist_2.11/${VERSION}/geomesa-hbase-dist_2.11-${VERSION}-bin.tar.gz"
sudo tar -xzf geomesa-hbase-dist_2.11-${VERSION}-bin.tar.gz -C /opt
sudo /opt/geomesa-hbase_2.11-${VERSION}/bin/bootstrap-geomesa-hbase-aws.sh
