Skip to content

Commit

Permalink
Adding tutorial 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelAlvarado committed Jan 14, 2017
0 parents commit fbe6e8f
Show file tree
Hide file tree
Showing 12 changed files with 1,557 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
streamsets/data/pipelines/
streamsets/data/runInfo/
streamsets/data/sdc.id
streamsets/data/tutorial_data/ccsample
.idea
7 changes: 7 additions & 0 deletions build-es-index/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Inserting data
FROM alpine:3.3
MAINTAINER Angel Alvarado "angel.angelio@gmail.com"
COPY ./start.sh /
RUN apk update
RUN apk add curl
RUN chmod +x /start.sh
24 changes: 24 additions & 0 deletions build-es-index/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#/bin/sh

sleep 15
echo "Creating ElasticSearch index"
ElasticActive=0
while [ $ElasticActive -eq 0 ]
do
wget elasticsearch:9200 -O - > /bin/null
isESactive=$?
wget elasticsearch:9200/logs -O - > /bin/null
isLogsIndex=$?
if [ $isESactive -eq 0 -a $isLogsIndex -ne 0 ]
then
echo "Creating ElasticSearch cclogs index"
curl -XPUT 'elasticsearch:9200/cclogs' -d '{"mappings":{"cclogs":{"properties":{"transaction_date":{"type":"date"},"card_expiry_date":{"type":"string","index":"not_analyzed"},"card_number":{"type":"string","index":"not_analyzed"},"card_security_code":{"type":"integer","index":"not_analyzed"},"description":{"type":"string","index":"not_analyzed"},"purchase_amount":{"type":"integer","index":"not_analyzed"}}}}}'
ElasticActive=1
elif [ $isESactive -eq 0 -a $isLogsIndex -eq 0 ]
then
echo "cclogs index already in ElasticSearch"
ElasticActive=1
else
echo "Trying to insert ElasticSearch logs Index"
fi
done
Loading

0 comments on commit fbe6e8f

Please sign in to comment.