Skip to content

Commit

Permalink
Merge branch 'release/0.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmp85 committed Jun 19, 2017
2 parents a25fd12 + 6f043e5 commit 05740a8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### citustools v0.6.2 (June 19, 2017) ###

* Fixes bug causing early exit during first release of new package

* Adds support for building against PostgreSQL 10

* Adds caching logic for PostgreSQL source builds

### citustools v0.6.1 (May 12, 2017) ###

* Adds logic to apply PGDG's directory patches to custom builds
Expand Down
19 changes: 17 additions & 2 deletions travis/build_new_release
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ IFS=$'\n\t'
# constants
stderr=2
badusage=64
noservice=69

pkgflavor="${TRAVIS_BRANCH%%-*}"
pkgauth="${PACKAGECLOUD_API_TOKEN}:"
Expand Down Expand Up @@ -61,9 +62,23 @@ esac
pkgapiurl="https://packagecloud.io/api/v1/repos/citusdata/${PKG_REPOTYPE}"
pkgapiurl+="/package/${pkgflavor}/${TARGET_PLATFORM}/${pkgfull}/${pkgarch}/versions.json"

needrelease=$(curl -sf -u "${pkgauth}" "${pkgapiurl}?per_page=1000" | \
jq -r "${jqfilter} | index(\"${pkglatest}\") < 0")
response=$(curl -w '\n%{http_code}\n' -s -u "${pkgauth}" "${pkgapiurl}?per_page=1000")

httpcode=$(echo "${response}" | tail -n1)
case "${httpcode}" in
404)
httpbody='[]'
;;
200)
httpbody=$(echo "${response}" | sed '$d')
;;
*)
echo "$0: bad response code from packagecloud -- ${httpcode}" >&2
exit $noservice
;;
esac

needrelease=$(echo "${httpbody}" | jq -r "${jqfilter} | index(\"${pkglatest}\") < 0")
if [ "${needrelease}" == "true" ]; then
citus_package -p "${TARGET_PLATFORM}" 'local' release
mkdir -p pkgs/releases
Expand Down
39 changes: 27 additions & 12 deletions travis/install_custom_pg
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,40 @@ if [ -z "${USE_CUSTOM_PG:-}" ]; then
exit
fi

# in order for other PostgreSQL packages to operate correctly, we need
# to ensure our build uses the same directories as the PGDG build; un-
# fortunately, not all can be specified by ./configure, so we apply the
# version-specific packaging patch used for the PGDG builds
pkgingurl='https://anonscm.debian.org/git/pkg-postgresql/postgresql.git'
patchurl="${pkgingurl}/plain/debian/patches/50-per-version-dirs.patch"

# clone PostgreSQL
# if there is cached PostgreSQL build, just pull new updates, hopefuly
# there are no updates and we can skip the compiling PostgreSQL. Note
# that travis always creates caching directories. It will be just empty
# if there is no cache yet. We check whether the directory contains any
# files.
cd ~
git clone -b "REL${PGVERSION//./_}_STABLE" --depth 1 git://git.postgresql.org/git/postgresql.git
if [ "$(ls -A postgresql)" ]; then
git -C postgresql pull
else
if [ "${PGVERSION}" -eq '10' ]; then
gitref='master'
else
gitref="REL${PGVERSION//./_}_STABLE"
fi

git clone -b "${gitref}" --depth 1 git://git.postgresql.org/git/postgresql.git

# in order for other PostgreSQL packages to operate correctly, we need
# to ensure our build uses the same directories as the PGDG build; un-
# fortunately, not all can be specified by ./configure, so we apply the
# version-specific packaging patch used for the PGDG builds
pkgingurl='https://anonscm.debian.org/git/pkg-postgresql/postgresql.git'
patchurl="${pkgingurl}/plain/debian/patches/50-per-version-dirs.patch"

# apply patch
curl -sf "${patchurl}?h=${PGVERSION}" | git -C postgresql apply
fi

# we will use this to parallelize PostgreSQL compilation
procs="$(nproc)"
mjobs="$((procs + 1))"

# configure, apply patch, build, and install PostgreSQL
# configure, build, and install PostgreSQL
cd postgresql
curl -sf "${patchurl}?h=${PGVERSION}" | git apply

./configure --enable-cassert --enable-debug --with-openssl \
--mandir="/usr/share/postgresql/${PGVERSION}/man" \
--docdir="/usr/share/doc/postgresql-doc-${PGVERSION}" \
Expand Down

0 comments on commit 05740a8

Please sign in to comment.