-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-web-src
More file actions
executable file
·89 lines (75 loc) · 2.21 KB
/
install-web-src
File metadata and controls
executable file
·89 lines (75 loc) · 2.21 KB
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
set -eu
install_corto_fail() {
echo "Installation failed :("
}
clone_repo() {
if [ ! -d "$1" ]; then
echo "Cloning $1..."
git clone -q "https://github.com/cortoproject/${1}.git"
else
(
cd "$1"
echo "Reset $1..."
git fetch -q origin
git reset -q --hard origin/master
git clean -q -xdf
)
fi
}
install_corto () {
UNAME=$(uname)
INSTALL_TMPDIR="$HOME/bake/src"
# Check supported OS
if [ "$UNAME" != "Linux" ] && [ "$UNAME" != "Darwin" ]; then
>&2 echo "Sorry, this OS is not supported yet!"
exit 1
fi
if [ "$UNAME" = "Darwin" ]; then
if [ "i386" != "$(uname -p)" ] || [ "1" != "$(sysctl -n hw.cpu64bit_capable 2>/dev/null || echo 0)" ]; then
>&2 echo "corto: only 64-bit Intel processors are supported at this time!"
exit 1
fi
fi
if [ "$UNAME" = "Linux" ]; then
sudo apt-get -y install git build-essential libffi-dev libxml2-dev libcurl4-openssl-dev
elif [ "$UNAME" = "Darwin" ]; then
if ! pkgutil --pkg-info=com.apple.pkg.CLTools_Executables; then
echo "Looks like Xcode command-line tools are not installed. Run:"
echo " sudo xcode-select --install"
echo
echo "Then try installing corto again!"
exit -1
fi
fi
set -e
trap install_corto_fail EXIT
echo
echo "Installing corto web, this should just take a minute..."
# Create 'src' directory in corto
mkdir -p "$INSTALL_TMPDIR"
cd "$INSTALL_TMPDIR"
# Corto repository is now downloaded. Download remaining essential packages
echo "Cloning cortoweb packages"
clone_repo "corto-x"
clone_repo "base64"
clone_repo "corto-httpclient"
clone_repo "corto-httpserver"
clone_repo "corto-httprouter"
clone_repo "corto-httplogin"
clone_repo "corto-rest"
clone_repo "corto-ws"
clone_repo "corto-ui"
clone_repo "driver-ui-browser"
clone_repo "corto-js"
# Build projects
echo "Build projects"
bake
echo
corto --logo
echo
echo "Corto web packages successfully installed!"
echo
trap - EXIT
}
install_corto