Skip to content

Instantly share code, notes, and snippets.

@psychemedia
Last active February 5, 2016 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psychemedia/e78eb635ec6060006678 to your computer and use it in GitHub Desktop.
Save psychemedia/e78eb635ec6060006678 to your computer and use it in GitHub Desktop.
sandstorm.io openrefine
#!/bin/bash
set -euo pipefail
# This script is run in the VM each time you run `vagrant-spk dev`. This is
# the ideal place to invoke anything which is normally part of your app's build
# process - transforming the code in your repository into the collection of files
# which can actually run the service in production
#
# Some examples:
#
# * For a C/C++ application, calling
# ./configure && make && make install
# * For a Python application, creating a virtualenv and installing
# app-specific package dependencies:
# virtualenv /opt/app/env
# /opt/app/env/bin/pip install -r /opt/app/requirements.txt
# * Building static assets from .less or .sass, or bundle and minify JS
# * Collecting various build artifacts or assets into a deployment-ready
# directory structure
# By default, this script does nothing. You'll have to modify it as
# appropriate for your application.
sudo apt-get install -y wget unzip openjdk-7-jre-headless
#Download OpenRefine
wget --no-check-certificate https://github.com/OpenRefine/OpenRefine/releases/download/v2.6-rc1/openrefine-linux-2.6-rc1.tar.gz
#Unpack OpenRefine and tidy up
tar -xzf openrefine-linux-2.6-rc1.tar.gz -C /opt/app && rm openrefine-linux-2.6-rc1.tar.gz
#mkdir -p /var/refine
#/opt/refine/openrefine-2.6-rc1/refine -p 8000 -i 0.0.0.0 -d /var/refine
cd /opt/app
exit 0
#!/bin/bash
set -euo pipefail
# This script is run every time an instance of our app - aka grain - starts up.
# This is the entry point for your application both when a grain is first launched
# and when a grain resumes after being previously shut down.
#
# This script is responsible for launching everything your app needs to run. The
# thing it should do *last* is:
#
# * Start a process in the foreground listening on port 8000 for HTTP requests.
#
# This is how you indicate to the platform that your application is up and
# ready to receive requests. Often, this will be something like nginx serving
# static files and reverse proxying for some other dynamic backend service.
#
# Other things you probably want to do in this script include:
#
# * Building folder structures in /var. /var is the only non-tmpfs folder
# mounted read-write in the sandbox, and when a grain is first launched, it
# will start out empty. It will persist between runs of the same grain, but
# be unique per app instance. That is, two instances of the same app have
# separate instances of /var.
# * Preparing a database and running migrations. As your package changes
# over time and you release updates, you will need to deal with migrating
# data from previous schema versions to new ones, since users should not have
# to think about such things.
# * Launching other daemons your app needs (e.g. mysqld, redis-server, etc.)
# By default, this script does nothing. You'll have to modify it as
# appropriate for your application.
mkdir -p /var/refine
cd /opt/app
openrefine-2.6-rc1/refine -p 8000 -i 0.0.0.0 -d /var/refine
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment