-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci-dev
More file actions
executable file
·118 lines (102 loc) · 3.25 KB
/
ci-dev
File metadata and controls
executable file
·118 lines (102 loc) · 3.25 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/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
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, this should just take a minute..."
# Create 'src' directory in corto
mkdir -p "$INSTALL_TMPDIR"
cd "$INSTALL_TMPDIR"
# Install bake
echo "Cloning bake repositories"
clone_repo "bake"
echo "Installing bake"
make -C bake/build-$UNAME
bake/bake setup
# Corto repository is now downloaded. Download remaining essential packages
echo "Cloning essential corto packages"
clone_repo "bake-corto"
clone_repo "corto-tool"
clone_repo "corto-util-argparse"
clone_repo "parson"
clone_repo "driver-tool-create"
clone_repo "driver-tool-test"
clone_repo "corto-util-cdiff"
clone_repo "corto-g"
clone_repo "driver-tool-pp"
clone_repo "c-binding"
clone_repo "driver-fmt-json"
clone_repo "driver-ext-json"
clone_repo "driver-fmt-xml"
clone_repo "driver-ext-xml"
clone_repo "antlr4-cpp"
clone_repo "corto-script-parser"
clone_repo "corto-script-ast"
clone_repo "corto-script-declare"
clone_repo "driver-ext-corto"
clone_repo "corto-test"
# Build projects
echo "build projects"
bake
echo
corto --logo
echo
echo "Corto \"$(/usr/local/bin/corto --minor)\" successfully installed!"
echo
echo "You have installed a development version. This means that corto has been"
echo "built with lots of features that spot errors early on, awesome! The downside"
echo "is that all this checking slows things down quite a bit. We recommend to"
echo "use a release version when you deploy corto apps. To install a"
echo "release version from source, do:"
echo " $ curl https://corto.io/install-release-src | sh"
echo
echo "Get started by creating your first project! Simply do:"
echo
echo " $ corto create myApp"
echo " $ myApp/myApp"
echo
trap - EXIT
}
install_corto