Skip to content

Instantly share code, notes, and snippets.

@strukturedkaos
Created June 29, 2015 14:06
Show Gist options
  • Save strukturedkaos/4bb854e000f2e42727da to your computer and use it in GitHub Desktop.
Save strukturedkaos/4bb854e000f2e42727da to your computer and use it in GitHub Desktop.
Elasticsearch Codeship
# Sets up elasticsearch in Codeship build
set -e
CACHED_DOWNLOAD="${HOME}/cache/elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz"
mkdir -p "${ELASTICSEARCH_DIR}"
wget --continue --output-document "${CACHED_DOWNLOAD}" "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz"
tar -xaf "${CACHED_DOWNLOAD}" --strip-components=1 --directory "${ELASTICSEARCH_DIR}"
echo "http.port: ${ELASTICSEARCH_PORT}" >> ${ELASTICSEARCH_DIR}/config/elasticsearch.yml
# Copy elasticsearch scripts to elasticsearch config
mkdir ${ELASTICSEARCH_DIR}/config/kevy
cp elasticsearch-scripts/*.groovy ${ELASTICSEARCH_DIR}/config/kevy/
# Make sure to use the exact parameters you want for ElasticSearch and give it enough sleep time to properly start up
nohup bash -c "${ELASTICSEARCH_DIR}/bin/elasticsearch 2>&1" &
sleep "${ELASTICSEARCH_WAIT_TIME}"
echo elasticsearch -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment