Skip to content

Commit 2839f32

Browse files
committed
Base pkgflavor on TARGET_PLATFORM not on TRAVIS_BRANCH
1 parent ec05ee7 commit 2839f32

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

travis/build_new_nightly

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ stderr=2
99
badusage=64
1010

1111
latestpg="10"
12-
pkgflavor="${TRAVIS_BRANCH%%-*}"
12+
if [ "${TARGET_PLATFORM:-}" = "" ]; then
13+
echo TARGET_PLATFORM must be set
14+
exit $badusage
15+
fi
16+
17+
PLATFORM_TYPE="${TARGET_PLATFORM%%/*}"
1318
pkgauth="${PACKAGECLOUD_API_TOKEN}:"
1419
hubauth="Authorization: token ${GITHUB_TOKEN}"
1520

@@ -24,13 +29,13 @@ releasepg="${releasepg:-9.6,10}"
2429
nightlypg="${nightlypg:-${releasepg}}"
2530
latestpg=$(echo "${nightlypg}" | tr ',' '\n' | sort -t. -k1,1n -k2,2n | tail -n1)
2631

27-
case "${pkgflavor}" in
28-
debian)
32+
case "${PLATFORM_TYPE}" in
33+
debian|ubuntu)
2934
pkgflavor='deb'
3035
pkgfull="postgresql-${latestpg}-${pkgname}"
3136
pkgarch="amd64"
3237
;;
33-
redhat)
38+
el|ol)
3439
pkgflavor='rpm'
3540
pkgfull="${pkgname}_${latestpg//./}"
3641
pkgarch="x86_64"

travis/build_new_release

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ stderr=2
99
badusage=64
1010
noservice=69
1111

12-
pkgflavor="${TRAVIS_BRANCH%%-*}"
12+
if [ "${TARGET_PLATFORM:-}" = "" ]; then
13+
echo TARGET_PLATFORM must be set
14+
exit $badusage
15+
fi
16+
17+
PLATFORM_TYPE="${TARGET_PLATFORM%%/*}"
1318
pkgauth="${PACKAGECLOUD_API_TOKEN}:"
1419

1520
# populate variables from packaging metadata file
@@ -21,12 +26,12 @@ declare pkglatest # to make shellcheck happy
2126
hubproj="${hubproj:-${pkgname}}"
2227
nightlyref="${nightlyref:-master}"
2328
releasepg="${releasepg:-9.6,10}"
24-
nightlypg="${nightlypg:-${releasepg}}"
29+
nightlypg="${nightlypg:-}"
2530
latestpg=$(echo "${releasepg}" | tr ',' '\n' | sort -t. -k1,1n -k2,2n | tail -n1)
2631
versioning="${versioning:-simple}"
2732

28-
case "${pkgflavor}" in
29-
debian)
33+
case "${PLATFORM_TYPE}" in
34+
debian|ubuntu)
3035
pkgflavor='deb'
3136
pkgfull="postgresql-${latestpg}-${pkgname}"
3237

@@ -39,7 +44,7 @@ case "${pkgflavor}" in
3944
pkgarch="amd64"
4045
jqfilter='map(.version + "-" + .release)'
4146
;;
42-
redhat)
47+
el|ol)
4348
pkgflavor='rpm'
4449

4550
# add minor/major version to package name if using fancy versioning

0 commit comments

Comments
 (0)