-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 11.7 support and improve scripts
- Loading branch information
Showing
10 changed files
with
81 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ branches: | |
- master | ||
|
||
script: | ||
- ./lint.sh --sh | ||
- ./dev/util/shellcheck.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,56 @@ | ||
#!/usr/bin/env sh | ||
|
||
alpine_version='3.8' | ||
legacy_image=false | ||
pg_major_version='10' | ||
pg_package_version='10.10' | ||
#------------------------------------------------------------------------------------ | ||
# Loop over arguments | ||
#------------------------------------------------------------------------------------ | ||
for arg in "$@"; do | ||
# [ -p | --package ] | ||
if [ -n "${package_flag}" ]; then | ||
package_flag='' | ||
package="${arg}" | ||
fi | ||
|
||
if [ "${arg}" = "-p" ] || [ "${arg}" = "--package" ]; then | ||
package_flag=true | ||
fi | ||
done | ||
|
||
#------------------------------------------------------------------------------------ | ||
# Exit on error | ||
#------------------------------------------------------------------------------------ | ||
if [ -z "${package}" ]; then | ||
echo '> Package file not specified: [-p <FILE>, --package <FILE>]' | ||
exit 127 | ||
fi | ||
|
||
if [ -f "./package/${package}.env" ]; then | ||
. "./package/${package}.env" | ||
else | ||
echo "> Package file not found: './package/${package}.env'" | ||
exit 127 | ||
fi | ||
|
||
builds=\ | ||
"${pg_package_version}_${pg_package_version}-r0_${alpine_version}",\ | ||
"${pg_major_version}_${pg_package_version}-r0_${alpine_version}" | ||
"${PG_FULL_VERSION}_${PG_FULL_VERSION}-r0_${ALPINE_VERSION}",\ | ||
"${PG_BASE_VERSION}_${PG_FULL_VERSION}-r0_${ALPINE_VERSION}" | ||
|
||
if [ "${legacy_image}" = 'false' ]; then | ||
builds="${builds}","latest_${pg_package_version}-r0_${alpine_version}" | ||
if [ "${PG_LATEST:-'false'}" = 'true' ]; then | ||
builds="${builds}","latest_${PG_FULL_VERSION}-r0_${ALPINE_VERSION}" | ||
fi | ||
|
||
echo $builds | tr ',' '\n' | while read build; do | ||
alpine_version=$(echo "${build}" | cut -d '_' -f 3) | ||
ALPINE_VERSION=$(echo "${build}" | cut -d '_' -f 3) | ||
pg_restore_from_s3_tag=$(echo "${build}" | cut -d '_' -f 1 ) | ||
pg_package_version=$(echo "${build}" | cut -d '_' -f 2) | ||
PG_FULL_VERSION=$(echo "${build}" | cut -d '_' -f 2) | ||
|
||
echo "" | ||
echo "--------------------------------" | ||
echo "POSTGRES-RESTORE-FROM-S3 TAG: ${pg_restore_from_s3_tag}" | ||
echo "POSTGRES PACKAGE VERSION: ${pg_package_version}" | ||
echo "POSTGRES PACKAGE VERSION: ${PG_FULL_VERSION}" | ||
echo "--------------------------------" | ||
|
||
echo docker build --tag bluedrop360/postgres-restore-from-s3:$pg_restore_from_s3_tag --build-arg pg_package_version=$pg_package_version --build-arg alpine_version="${alpine_version}" . | ||
eval docker build --tag bluedrop360/postgres-restore-from-s3:$pg_restore_from_s3_tag --build-arg pg_package_version=$pg_package_version --build-arg alpine_version="${alpine_version}" . || exit 1 | ||
echo docker build --tag bluedrop360/postgres-restore-from-s3:$pg_restore_from_s3_tag --build-arg pg_full_version=$PG_FULL_VERSION --build-arg alpine_version="${ALPINE_VERSION}" . | ||
eval docker build --tag bluedrop360/postgres-restore-from-s3:$pg_restore_from_s3_tag --build-arg pg_full_version=$PG_FULL_VERSION --build-arg alpine_version="${ALPINE_VERSION}" . || exit 1 | ||
echo docker push bluedrop360/postgres-restore-from-s3:$pg_restore_from_s3_tag | ||
eval docker push bluedrop360/postgres-restore-from-s3:$pg_restore_from_s3_tag || exit 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env sh | ||
|
||
printf '\n%s\n' "Checking shell scripts..." | ||
|
||
SHELLCHECK_OPTS="" | ||
|
||
RUN_SHELLCHECK="shellcheck ${ALLOW_EXTERNAL_SOURCE:-} ${SHELLCHECK_OPTS} {} +" | ||
eval "find ./*.sh -type f -exec ${RUN_SHELLCHECK}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALPINE_VERSION='3.8' | ||
PG_BASE_VERSION='10' | ||
PG_FULL_VERSION='10.12' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALPINE_VERSION='3.9' | ||
PG_LATEST=false | ||
PG_BASE_VERSION='11' | ||
PG_FULL_VERSION='11.7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALPINE_VERSION='3.6' | ||
PG_BASE_VERSION='9' | ||
PG_FULL_VERSION='9.6.13' |