-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstallMac.sh
91 lines (71 loc) · 2 KB
/
installMac.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
82
83
84
85
86
87
88
89
#!/bin/bash
# (c) https://github.com/MontiCore/monticore
#
# Set "export SKIP_MVN=1" to skip the maven build at the end of this script
# Or call "SKIP_MVN=1 ./installMac.sh"
#
# Check if a command is available on this system
# Taken from https://get.docker.com/
command_exists() {
command -v "$@" > /dev/null 2>&1
}
# Check ARM
# if [ "$(uname -m)" = "arm64" ]
# Check Intel
# if [ "$(uname -m)" = "x86_64" ]
# Stop on first error
set -e
MONTITHINGS_DIRECTORY=$PWD
# Leave MontiThings Project for installing dependencies
[ -d dependencies ] || mkdir -p dependencies
cd dependencies
# Install SDKMAN
curl -s "https://get.sdkman.io" | bash
# Initialize environment vars of SDKMAN
source ~/.sdkman/bin/sdkman-init.sh
# Install Java, Maven, Gradle
sdk install java 8.0.312-zulu
sdk install maven
sdk install gradle 6.9.1
# Install Homebrew
if ! command_exists brew
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
export PATH=$PATH:/opt/homebrew/bin
fi
# Install Dependencies
brew install cmake ninja mosquitto terraform azure-cli conan python openssl
brew services start mosquitto
if ! command_exists docker
then
brew install --cask docker
fi
# Install NNG
if [ ! -d nng ]
then
git clone https://github.com/nanomsg/nng.git
cd nng
git checkout v1.3.0
mkdir build
cd build
cmake -G Ninja ..
ninja
ninja test || true # allowed to fail to enable GitPod builds
sudo ninja install
fi
cd $MONTITHINGS_DIRECTORY
rm -rf dependencies
if [ -z "${SKIP_MVN}" ] || [ "${SKIP_MVN}" != "1" ]
then
# Install MontiThings
mvn clean install -Dexec.skip
fi
echo "Installed successfully!"
echo '
_____ ___ __ _ ___________ _
/__ |/ / ___________ / /_(_) / ___ __/ /_ (_)___ ____ __
/ /|_/ / / __ \__/ __ \/ __/ / (_) / / / __ \/ / __ \/ __ `//_ \
/ / / /_/ /_/ / / / / / /_/ /_ __/ / / / / / / / / / /_/ /___) )_
/_/ /____\____/ /_/ /_/\__/___/ /___/ /_/ /_/_/_/ /_/\__, /(______/
/____/
'