-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from ZPascal/issue-74
feat: Add the possibility to specify the used PostgreSQL version
- Loading branch information
Showing
16 changed files
with
154 additions
and
19 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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
NEED_COMMIT=false | ||
|
||
set -euo pipefail | ||
|
||
echo "${PRIVATE_YML}" > postgres-release/config/private.yml | ||
|
||
pushd postgres-release | ||
CURRENT_BLOBS=$(bosh blobs) | ||
CURRENT_VERSION=$(cat ../yq-src/version) | ||
mv ../yq-src/yq_linux_amd64 ../yq-src/postgres-yq-${CURRENT_VERSION} | ||
BLOB_PATH=$(ls ../yq-src/postgres-yq-${CURRENT_VERSION}) | ||
FILENAME=$( basename ${BLOB_PATH} ) | ||
OLD_BLOB_PATH=$(cat config/blobs.yml | grep "postgres-yq-${MAJOR_VERSION}" | cut -f1 -d:) | ||
if ! echo "${CURRENT_BLOBS}" | grep "${FILENAME}" ; then | ||
NEED_COMMIT=true | ||
echo "adding ${FILENAME}" | ||
bosh add-blob --sha2 "${BLOB_PATH}" "yq/postgres-${FILENAME}" | ||
bosh remove-blob ${OLD_BLOB_PATH} | ||
bosh upload-blobs | ||
fi | ||
|
||
if ${NEED_COMMIT}; then | ||
echo "-----> $(date): Creating git commit" | ||
git config user.name "$GIT_USER_NAME" | ||
git config user.email "$GIT_USER_EMAIL" | ||
git add . | ||
|
||
git --no-pager diff --cached | ||
if [[ "$( git status --porcelain )" != "" ]]; then | ||
git commit -am "Bump packages" | ||
fi | ||
fi | ||
popd |
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,17 @@ | ||
--- | ||
platform: linux | ||
|
||
inputs: | ||
- name: yq-src | ||
|
||
outputs: | ||
- name: postgres-release | ||
|
||
run: | ||
path: postgres-release/ci/tasks/bump-yq-packages/task.sh | ||
|
||
params: | ||
PRIVATE_YML: | ||
MAJOR_VERSION: | ||
GIT_USER_NAME: CI Bot | ||
GIT_USER_EMAIL: bots@cloudfoundry.org |
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ packages: | |
- postgres-13 | ||
- postgres-15 | ||
- postgres-16 | ||
- postgres-yq-4 | ||
|
||
consumes: | ||
- name: database | ||
|
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
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,11 @@ | ||
postgresql: | ||
default: 16 | ||
major_version: | ||
16: | ||
minor_version: "16.3" | ||
15: | ||
minor_version: "15.6" | ||
13: | ||
minor_version: "13.14" | ||
11: | ||
minor_version: "11.22" |
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,17 @@ | ||
#!/bin/bash -exu | ||
|
||
function main() { | ||
install | ||
|
||
} | ||
|
||
function install() { | ||
|
||
echo "Install yq..." | ||
mkdir -p "${BOSH_INSTALL_TARGET}/bin" | ||
cp -a yq/postgres-yq-4.* "${BOSH_INSTALL_TARGET}/bin/yq" | ||
chmod +x "${BOSH_INSTALL_TARGET}/bin/yq" | ||
|
||
} | ||
|
||
main |
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 @@ | ||
--- | ||
name: postgres-yq-4 | ||
files: | ||
- yq/postgres-yq-4.* |
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