-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
81 lines (71 loc) · 2.13 KB
/
setup.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
#=================================================================
# Pulsar-Test
#
#
# @description: Setup script for Pulsar-Test
# @author: Elisha Lai
# @version: 1.0 29/06/2017
#=================================================================
# Clean project directory
echo "Cleaning project directory..."
rm -rf bin
rm -rf conf
rm -rf data
rm -rf lib
rm -rf *.csv
# Download Pulsar distribution
echo "Downloading Pulsar distribution..."
wget https://github.com/apache/incubator-pulsar/releases/download/v1.18/pulsar-1.18-bin.tar.gz
# Unzip Pulsar distribution
echo "Unzipping Pulsar distribution..."
tar -xvzf pulsar-1.18-bin.tar.gz
# Move Pulsar binaries, configurations and libraries to the project directory
echo "Moving Pulsar binaries, configurations and libraries to the project directory..."
mv pulsar-1.18/bin bin
mv pulsar-1.18/conf conf
mv pulsar-1.18/lib lib
# Remove unnecessary files
echo "Removing unnecessary files..."
rm -rf pulsar-1.18-bin.tar.gz
rm -rf pulsar-1.18
# Install packages based on platform
OS="`uname`"
case $OS in
'Linux')
# Resynchronizing package index files from their sources
echo "Resynchronizing package index files from their sources..."
sudo apt-get update
# Install NTP package
echo "Installing NTP package..."
sudo apt-get install ntp
# Install Maven package
echo "Installing Maven package..."
sudo apt-get install maven
;;
'Darwin')
# Check if Homebrew is already installed
which -s brew
if [[ $? != 0 ]] ; then
# Installing Homebrew
echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install NTP package
echo "Installing NTP package..."
brew install ntp
# Install Maven package
echo "Installing Maven package..."
brew install maven
;;
*)
echo "Please consult documentation regarding installing Maven package for your platform."
;;
esac
# Validate project directory
echo "Validating project directory..."
mvn validate
# Cleaning project directory
echo "Cleaning project directory..."
mvn clean
echo "Setup complete."