forked from snowplow/snowplow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·52 lines (41 loc) · 1.65 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
WORKDIR="$(dirname "$0")"
JAR_FILE="2-collectors/scala-stream-collector/kinesis/target/scala-2.11/snowplow-stream-collector-kinesis-0.15.0.jar"
cd "$WORKDIR"
mkdir -p target/common
# TODO: include ivy-cache
# change into scala-stream-collector directory
cd 2-collectors/scala-stream-collector
# build jar
if [ -z "$1" ]
then
sbt "project kinesis" assembly
else
sbt -Dsbt.ivy.home=$1 "project kinesis" assembly
fi
cd ../..
cp -R $JAR_FILE target/common/snowplow-stream-collector.jar
echo "jar copied to target/common"
cp -r scripts target/common/
mkdir -p target/us/collectorApp/config
mkdir -p target/sit/collectorApp/config
cp -R target/common/* target/us/collectorApp/
# Using the tmp direcotry creation so that it works on MacOs and Linux
sed -e 's/collector-THISWILLCHANGE-stdout.log/collector-usprod-stdout.log/g' target/us/collectorApp/scripts/start_collector.sh >tmp_1.sh
mv tmp_1.sh target/us/collectorApp/scripts/start_collector.sh
cp config/collector-us.conf target/us/collectorApp/config/collector.conf
cp appspec.yml target/us/
cp deploy_aws_code_deploy_revision.sh target/us/
cd target/us
tar -cvf ../collector-us.zip *
cd ../..
cp -R target/common/* target/sit/collectorApp/
# Using the tmp direcotry creation so that it works on MacOs and Linux
sed -e 's/collector-THISWILLCHANGE-stdout.log/collector-ausit-stdout.log/g' target/sit/collectorApp/scripts/start_collector.sh >tmp_1.sh
mv tmp_1.sh target/sit/collectorApp/scripts/start_collector.sh
cp config/collector-sit.conf target/sit/collectorApp/config/collector.conf
cp appspec.yml target/sit/
cp deploy_aws_code_deploy_revision.sh target/sit/
cd target/sit
tar -cvf ../collector-sit.zip *
cd ../..