Skip to content

Commit d18141b

Browse files
authored
Buildpack Updates (#132)
* add support for versioned patchfiles * update pgbouncer url * use -build image for make shell * build pgbouncer 1.12 with heroku-18 * mv from 1.12 to 1.13 * run 1.13 on heroku-16 * add stack to archive name * build 1.13 for heroku-16 * set default to 1.13 * move patch to 1.7 from default * update changelog * our changelog is lowercased
1 parent 17e5510 commit d18141b

15 files changed

+56
-45
lines changed

.github/workflows/check_changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
- uses: actions/checkout@v1
1111
- name: Check that CHANGELOG is touched
1212
run: |
13-
cat $GITHUB_EVENT_PATH | jq .pull_request.title | grep -i '\[\(\(changelog skip\)\|\(ci skip\)\)\]' || git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
13+
cat $GITHUB_EVENT_PATH | jq .pull_request.title | grep -i '\[\(\(changelog skip\)\|\(ci skip\)\)\]' || git diff remotes/origin/${{ github.base_ref }} --name-only | grep Changelog.md

Changelog.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## unreleased
2-
3-
* Updates development tooling
2+
* Updates pgbouncer to 1.13 for Heroku-18
3+
* Updates pgbouncer to 1.13 for Heroku-16
4+
* Updates to Buildpack tooling
45

56
## v0.3.4 (January 2, 2015)
67

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ build-cedar-14:
66

77
build-heroku-16:
88
@echo "Building pgbouncer in Docker for heroku-16..."
9-
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-16" -e "PGBOUNCER_VERSION=1.7.2" -w /buildpack heroku/heroku:16-build support/pgbouncer-build
9+
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-16" -w /buildpack heroku/heroku:16-build support/pgbouncer-build
1010

1111
build-heroku-18:
1212
@echo "Building pgbouncer in Docker for heroku-18..."
13-
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-18" -e "PGBOUNCER_VERSION=1.8.1" -w /buildpack heroku/heroku:18-build support/pgbouncer-build
13+
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-18" -w /buildpack heroku/heroku:18-build support/pgbouncer-build
1414

1515
shell:
1616
@echo "Opening heroku-18 shell..."
17-
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-18" -e "PORT=5000" -w /buildpack heroku/heroku:18 bash
17+
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-18" -e "PORT=5000" -w /buildpack heroku/heroku:18-build bash

bin/compile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ unset GIT_DIR
1212

1313
# config
1414
if [ "$STACK" == "heroku-18" ]; then
15-
PGBOUNCER_VERSION="1.8.1-heroku"
15+
PGBOUNCER_VERSION="1.13.0"
1616
STUNNEL_VERSION=""
1717
elif [ "$STACK" == "heroku-16" ]; then
18-
PGBOUNCER_VERSION="1.7.2-heroku"
18+
PGBOUNCER_VERSION="1.13.0"
1919
else
20-
PGBOUNCER_VERSION="1.7-heroku"
20+
PGBOUNCER_VERSION="1.7"
2121
fi
2222

2323
# parse and derive params
@@ -48,7 +48,7 @@ VENDORED_PGBOUNCER="vendor/pgbouncer"
4848
PATH="$BUILD_DIR/$VENDORED_PGBOUNCER/bin:$PATH"
4949
echo "-----> Fetching and vendoring pgbouncer into slug"
5050
mkdir -p "$BUILD_DIR/$VENDORED_PGBOUNCER"
51-
tar xzf pgbouncer-${PGBOUNCER_VERSION}.tgz -C ${BUILD_DIR}/${VENDORED_PGBOUNCER}
51+
tar xzf pgbouncer-${PGBOUNCER_VERSION}-${STACK}.tgz -C ${BUILD_DIR}/${VENDORED_PGBOUNCER}
5252

5353
echo "-----> Moving the configuration generation script into app/bin"
5454
mkdir -p $BUILD_DIR/bin

pgbouncer-1.13.0-heroku-16.tgz

715 KB
Binary file not shown.

pgbouncer-1.13.0-heroku-18.tgz

685 KB
Binary file not shown.

pgbouncer-1.7-cedar-14.tgz

586 KB
Binary file not shown.

pgbouncer-1.7-heroku.tgz

-587 KB
Binary file not shown.

pgbouncer-1.7.2-heroku.tgz

-595 KB
Binary file not shown.

pgbouncer-1.8.1-heroku.tgz

-574 KB
Binary file not shown.

support/0001-Disable-SIGTERM.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- src/main.c 2019-09-26 21:37:14.000000000 +0000
2+
+++ src/main.c 2020-03-20 20:43:20.876976754 +0000
3+
@@ -425,9 +425,7 @@
4+
5+
static void handle_sigterm(evutil_socket_t sock, short flags, void *arg)
6+
{
7+
- log_info("got SIGTERM, fast exit");
8+
- /* pidfile cleanup happens via atexit() */
9+
- exit(1);
10+
+ log_info("Got SIGTERM, ignoring!");
11+
}
12+
13+
static void handle_sigint(evutil_socket_t sock, short flags, void *arg)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- src/main.c 2020-03-20 20:11:32.046384770 +0000
2+
+++ src/main_patched.c 2020-03-20 20:14:02.436366750 +0000
3+
@@ -402,9 +402,7 @@
4+
5+
static void handle_sigterm(int sock, short flags, void *arg)
6+
{
7+
- log_info("Got SIGTERM, fast exit");
8+
- /* pidfile cleanup happens via atexit() */
9+
- exit(1);
10+
+ log_info("Got SIGTERM, ignoring!");
11+
}
12+
13+
static void handle_sigint(int sock, short flags, void *arg)

support/patchfiles/default/.gitkeep

Whitespace-only changes.

support/pgbouncer-build

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set -e
44

5-
PGBOUNCER_VERSION=${PGBOUNCER_VERSION-1.7.2}
5+
PGBOUNCER_VERSION=${PGBOUNCER_VERSION-1.13.0}
66

7-
pgbouncer_tarball_url=https://pgbouncer.github.io/downloads/files/${PGBOUNCER_VERSION}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz
7+
pgbouncer_tarball_url=http://www.pgbouncer.org/downloads/files/${PGBOUNCER_VERSION}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz
88

99
temp_dir=$(mktemp -d /tmp/pgbouncer.XXXXXXXXXX)
1010

@@ -14,12 +14,23 @@ echo "Temp dir: $temp_dir"
1414
echo "Downloading $pgbouncer_tarball_url"
1515
curl -L $pgbouncer_tarball_url | tar xzv
1616

17+
if [ -d "/buildpack/support/patchfiles/${PGBOUNCER_VERSION}" ]
18+
then
19+
PATCHFILES=$(find /buildpack/support/patchfiles/${PGBOUNCER_VERSION} -name '*.patch')
20+
else
21+
PATCHFILES=$(find /buildpack/support/patchfiles/default -name '*.patch')
22+
fi
23+
1724
(
18-
cd pgbouncer-${PGBOUNCER_VERSION}
19-
git apply /buildpack/support/0001-Disable-SIGTERM.patch
20-
./configure \
21-
--prefix=/tmp/pgbouncer
22-
make -j 2 install
25+
cd pgbouncer-${PGBOUNCER_VERSION}
26+
for f in $PATCHFILES
27+
do
28+
patch -p0 < $f
29+
done
30+
31+
./configure \
32+
--prefix=/tmp/pgbouncer
33+
make -j 2 install
2334
)
2435

25-
tar -zcvf /buildpack/pgbouncer-${PGBOUNCER_VERSION}-heroku.tgz -C /tmp/pgbouncer .
36+
tar -zcvf /buildpack/pgbouncer-${PGBOUNCER_VERSION}-${STACK}.tgz -C /tmp/pgbouncer .

0 commit comments

Comments
 (0)