-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup-travis.sh
executable file
·62 lines (47 loc) · 1.44 KB
/
setup-travis.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
#!/bin/bash
set -o errexit
KONG_VERSION=$1
echo "Installing Kong version: $KONG_VERSION"
# Installing other dependencies
sudo apt-get update
sudo apt-get install -y git curl make pkg-config unzip libpcre3-dev apt-transport-https
####################
# Install Postgres #
####################
# Create PG user and database
psql -U postgres <<EOF
\x
CREATE USER kong;
CREATE DATABASE kong OWNER kong;
CREATE DATABASE kong_tests OWNER kong;
EOF
################
# Install Kong #
################
echo Fetching and installing Kong...
wget -q -O kong.deb https://github.com/Mashape/kong/releases/download/$KONG_VERSION/kong-$KONG_VERSION.trusty_all.deb
sudo apt-get update
sudo apt-get install -y netcat openssl libpcre3 dnsmasq procps perl
sudo dpkg -i kong.deb
rm kong.deb
# Adjust PATH
export PATH=$PATH:/usr/local/bin:/usr/local/openresty/bin
# Prepare path to lua libraries
ln -sfn /usr/local $HOME/.luarocks
# Set higher ulimit
sudo bash -c 'echo "fs.file-max = 65536" >> /etc/sysctl.conf'
sudo sysctl -p
sudo bash -c "cat >> /etc/security/limits.conf" << EOL
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
EOL
# Workaround for lua
sudo chown -R $USER /usr/local
#############
# Finish... #
#############
# Adjust LUA_PATH to find the plugin dev setup
export LUA_PATH="/kong-plugin/?.lua;/kong-plugin/?/init.lua;;"
echo "Successfully Installed Kong version: $KONG_VERSION"