Skip to content

Commit 0f7e01b

Browse files
committed
try travis without docker
1 parent f2f47f7 commit 0f7e01b

11 files changed

+185
-283
lines changed

Diff for: .travis.yml

+46-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,60 @@
11
os: linux
22

3-
dist: bionic
3+
dist: jammy
44

55
language: c
66

7-
services:
8-
- docker
7+
cache: ccache
8+
9+
addons:
10+
apt:
11+
packages:
12+
- sudo
13+
- libc-dev
14+
- bison
15+
- flex
16+
- libreadline-dev
17+
- zlib1g-dev
18+
- libzstd-dev
19+
- libssl-dev
20+
- perl
21+
- libperl-dev
22+
- libdbi-perl
23+
- cpanminus
24+
- locales
25+
- python3
26+
- python3-dev
27+
- python3-pip
28+
- libicu-dev
29+
- libgss-dev
30+
- libkrb5-dev
31+
- libxml2-dev
32+
- libxslt1-dev
33+
- libldap2-dev
34+
- tcl-dev
35+
- diffutils
36+
- gdb
37+
- gettext
38+
- lcov
39+
- openssh-client
40+
- openssh-server
41+
- libipc-run-perl
42+
- libtime-hires-perl
43+
- libtimedate-perl
44+
- libdbd-pg-perl
945

1046
before_install:
11-
- cp travis/* .
47+
- sudo travis/before-install.sh
1248

1349
install:
14-
- ./make_dockerfile.sh
15-
- docker-compose build
50+
- travis/install.sh
51+
52+
before_script:
53+
- sudo travis/before-script.sh
54+
- travis/before-script-user.sh
1655

1756
script:
18-
- docker-compose run tests
19-
# - docker-compose run $(bash <(curl -s https://codecov.io/env)) tests
20-
# - docker run -v $(pwd):/tests --rm centos:7 /tests/travis/backup_restore.sh
57+
- travis/script.sh
2158

2259
notifications:
2360
email:

Diff for: travis/Dockerfile.in

-30
This file was deleted.

Diff for: travis/backup_restore.sh

-66
This file was deleted.

Diff for: travis/before-install.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -xe
4+
5+
mkdir /pg
6+
chown travis /pg

Diff for: travis/before-script-user.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -xe
4+
5+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ""
6+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
7+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts

Diff for: travis/before-script.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -xe
4+
5+
/etc/init.d/ssh start
6+
7+
# Show pg_config path (just in case)
8+
echo "############### pg_config path:"
9+
which pg_config
10+
11+
# Show pg_config just in case
12+
echo "############### pg_config:"
13+
pg_config
14+
15+
# Show kernel parameters
16+
echo "############### kernel params:"
17+
cat /proc/sys/kernel/yama/ptrace_scope
18+
sudo sysctl kernel.yama.ptrace_scope=0
19+
cat /proc/sys/kernel/yama/ptrace_scope

Diff for: travis/docker-compose.yml

-17
This file was deleted.

Diff for: travis/install.sh

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env bash
2+
3+
set -xe
4+
5+
if [ -z ${PG_VERSION+x} ]; then
6+
echo PG_VERSION is not set!
7+
exit 1
8+
fi
9+
10+
if [ -z ${PG_BRANCH+x} ]; then
11+
echo PG_BRANCH is not set!
12+
exit 1
13+
fi
14+
15+
if [ -z ${PTRACK_PATCH_PG_BRANCH+x} ]; then
16+
PTRACK_PATCH_PG_BRANCH=OFF
17+
fi
18+
19+
# fix
20+
sudo chown -R travis /home/travis/.ccache
21+
22+
export PGHOME=/pg
23+
24+
# Clone Postgres
25+
echo "############### Getting Postgres sources:"
26+
git clone https://github.com/postgres/postgres.git -b $PG_BRANCH --depth=1
27+
28+
# Clone ptrack
29+
if [ "$PTRACK_PATCH_PG_BRANCH" != "OFF" ]; then
30+
git clone https://github.com/postgrespro/ptrack.git -b master --depth=1 postgres/contrib/ptrack
31+
export PG_PROBACKUP_PTRACK=ON
32+
else
33+
export PG_PROBACKUP_PTRACK=OFF
34+
fi
35+
36+
# Compile and install Postgres
37+
echo "############### Compiling Postgres:"
38+
cd postgres # Go to postgres dir
39+
if [ "$PG_PROBACKUP_PTRACK" = "ON" ]; then
40+
git apply -3 contrib/ptrack/patches/${PTRACK_PATCH_PG_BRANCH}-ptrack-core.diff
41+
fi
42+
CC='ccache gcc' CFLAGS="-Og" ./configure --prefix=$PGHOME \
43+
--cache-file=~/.ccache/configure-cache \
44+
--enable-debug --enable-cassert --enable-depend \
45+
--enable-tap-tests --enable-nls
46+
make -s -j$(nproc) install
47+
make -s -j$(nproc) -C contrib/ install
48+
49+
# Override default Postgres instance
50+
export PATH=$PGHOME/bin:$PATH
51+
export LD_LIBRARY_PATH=$PGHOME/lib
52+
export PG_CONFIG=$(which pg_config)
53+
54+
if [ "$PG_PROBACKUP_PTRACK" = "ON" ]; then
55+
echo "############### Compiling Ptrack:"
56+
make -C contrib/ptrack install
57+
fi
58+
59+
# Get amcheck if missing
60+
if [ ! -d "contrib/amcheck" ]; then
61+
echo "############### Getting missing amcheck:"
62+
git clone https://github.com/petergeoghegan/amcheck.git --depth=1 contrib/amcheck
63+
make -C contrib/amcheck install
64+
fi
65+
66+
pip3 install testgres

Diff for: travis/make_dockerfile.sh

-37
This file was deleted.

0 commit comments

Comments
 (0)