xref: /OpenGrok/dev/before_install (revision 9f2d396b358b34c929f3602fb251d463abcd6628)
1aba5f4cfSVladimir Kotal#!/bin/bash
2aba5f4cfSVladimir Kotal
3aba5f4cfSVladimir Kotalif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
4aba5f4cfSVladimir Kotal	sudo apt-get update -qq
5df8ae9f1SVladimir Kotal	if [[ $? != 0 ]]; then
6df8ae9f1SVladimir Kotal		echo "cannot update"
7df8ae9f1SVladimir Kotal		exit 1
8df8ae9f1SVladimir Kotal	fi
9b4571310SVladimir Kotal
10fb84416eSVladimir Kotal	sudo apt-get install -qq \
11fb84416eSVladimir Kotal	    cvs \
12fb84416eSVladimir Kotal	    git \
13fb84416eSVladimir Kotal	    mercurial \
14fb84416eSVladimir Kotal	    cssc \
15fb84416eSVladimir Kotal	    bzr \
16fb84416eSVladimir Kotal	    subversion \
17fb84416eSVladimir Kotal	    monotone \
18fb84416eSVladimir Kotal	    rcs \
19fb84416eSVladimir Kotal	    rcs-blame \
20fb84416eSVladimir Kotal	    python3 \
21fb84416eSVladimir Kotal	    python3-venv \
22fb84416eSVladimir Kotal	    python3-pip \
2389259090SVladimir Kotal	    nodejs \
2489259090SVladimir Kotal	    jq
25df8ae9f1SVladimir Kotal	if [[ $? != 0 ]]; then
26df8ae9f1SVladimir Kotal		echo "cannot install extra packages"
27df8ae9f1SVladimir Kotal		exit 1
28df8ae9f1SVladimir Kotal	fi
29b4571310SVladimir Kotal
30519a8457SVladimir Kotal	# Bitkeeper install failure is not critical, so exit code is not checked.
318182cfb4SVladimir Kotal	sudo ./dev/install-bitkeeper.sh
32519a8457SVladimir Kotal
33519a8457SVladimir Kotal	sudo ./dev/install-python-packages.sh
34519a8457SVladimir Kotal	if [[ $? != 0 ]]; then
35519a8457SVladimir Kotal		echo "cannot install Python packages"
36519a8457SVladimir Kotal		exit 1
37519a8457SVladimir Kotal	fi
38*9f2d396bSVladimir Kotal
39*9f2d396bSVladimir Kotal	# We only need to preserve TRAVIS_OS_NAME but older sudo do not
40*9f2d396bSVladimir Kotal	# support argument to --preserve-env.
41*9f2d396bSVladimir Kotal	sudo --preserve-env ./dev/install-universal_ctags.sh
42*9f2d396bSVladimir Kotal	if [[ $? != 0 ]]; then
43*9f2d396bSVladimir Kotal		echo "cannot install Universal ctags"
44*9f2d396bSVladimir Kotal		exit 1
45*9f2d396bSVladimir Kotal	fi
46*9f2d396bSVladimir Kotal
47*9f2d396bSVladimir Kotal	# for API blueprint verification
48*9f2d396bSVladimir Kotal	npm install drafter
49aba5f4cfSVladimir Kotalelif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
5061569491SLubos Kosco#	brew update
5176041b3fSLubos Kosco        export HOMEBREW_NO_AUTO_UPDATE=1
52519a8457SVladimir Kotal
5389259090SVladimir Kotal	brew install cvs libgit2 jq
54519a8457SVladimir Kotal	if [[ $? != 0 ]]; then
55519a8457SVladimir Kotal		echo "cannot install extra packages"
56519a8457SVladimir Kotal		exit 1
57519a8457SVladimir Kotal	fi
58519a8457SVladimir Kotal
5988c623c9SLubos Kosco	brew install python3
60aba5f4cfSVladimir Kotal	brew upgrade python
61519a8457SVladimir Kotal
62b4571310SVladimir Kotal	./dev/install-python-packages.sh
63519a8457SVladimir Kotal	if [[ $? != 0 ]]; then
64519a8457SVladimir Kotal		echo "cannot install Python packages"
65519a8457SVladimir Kotal		exit 1
66519a8457SVladimir Kotal	fi
672a63f72dSVladimir Kotal
68*9f2d396bSVladimir Kotal	# We only need to preserve TRAVIS_OS_NAME but older sudo do not
69*9f2d396bSVladimir Kotal	# support argument to --preserve-env.
70*9f2d396bSVladimir Kotal	sudo --preserve-env ./dev/install-universal_ctags.sh
71171dfcf1SVladimir Kotal	if [[ $? != 0 ]]; then
72171dfcf1SVladimir Kotal		echo "cannot install Universal ctags"
73171dfcf1SVladimir Kotal		exit 1
74171dfcf1SVladimir Kotal	fi
75*9f2d396bSVladimir Kotalelif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
76*9f2d396bSVladimir Kotal	choco install jdk8 -params 'installdir=c:\\jdk' -y
77*9f2d396bSVladimir Kotal	export JAVA_HOME=${JAVA_HOME:-/c/jdk}
78*9f2d396bSVladimir Kotal	export PATH=${JAVA_HOME}/bin:${PATH}
79193b2204SVladimir Kotal
80*9f2d396bSVladimir Kotal	choco install maven
81*9f2d396bSVladimir Kotal
82*9f2d396bSVladimir Kotal	choco install universal-ctags
83*9f2d396bSVladimir Kotal	export PATH=${PATH}:/c/ProgramData/chocolatey/lib/universal-ctags/tools
84*9f2d396bSVladimir Kotal
85*9f2d396bSVladimir Kotal	choco install svn
86*9f2d396bSVladimir Kotal	export PATH=${PATH}:/c/Program\ Files\ \(x86\)/Subversion/bin
87*9f2d396bSVladimir Kotal
88*9f2d396bSVladimir Kotal	choco install python3
89*9f2d396bSVladimir Kotal	# needs to be before the default Python 2
90*9f2d396bSVladimir Kotal	export PATH=/c/Python38:${PATH}
91*9f2d396bSVladimir Kotalfi
92