Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/dev-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
-
name: Read image version
uses: bfren/read-file@v1
Expand All @@ -46,6 +50,9 @@ jobs:
with:
context: .
file: ./12/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
push: ${{ startsWith(github.ref, 'refs/heads/') }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dev-13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
-
name: Read image version
uses: bfren/read-file@v1
Expand All @@ -46,6 +50,9 @@ jobs:
with:
context: .
file: ./13/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
push: ${{ startsWith(github.ref, 'refs/heads/') }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dev-14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
-
name: Read image version
uses: bfren/read-file@v1
Expand All @@ -46,6 +50,9 @@ jobs:
with:
context: .
file: ./14/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
push: ${{ startsWith(github.ref, 'refs/heads/') }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/publish-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
-
name: Read PostgreSQL version - minor
uses: bfren/read-file@v1
Expand Down Expand Up @@ -61,6 +65,9 @@ jobs:
with:
context: .
file: ./12/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/publish-13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
-
name: Read PostgreSQL version - minor
uses: bfren/read-file@v1
Expand Down Expand Up @@ -61,6 +65,9 @@ jobs:
with:
context: .
file: ./13/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/publish-14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
-
name: Read PostgreSQL version - minor
uses: bfren/read-file@v1
Expand Down Expand Up @@ -61,6 +65,9 @@ jobs:
with:
context: .
file: ./14/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
Expand Down
5 changes: 4 additions & 1 deletion 12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM bfren/alpine-s6:alpine3.15-3.0.2
FROM bfren/alpine-s6:alpine3.15-3.1.1

ARG BF_IMAGE
ARG BF_VERSION

ENV \
# set to "1" to compress backup sql files
Expand Down
5 changes: 4 additions & 1 deletion 13/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM bfren/alpine-s6:alpine3.15-3.0.2
FROM bfren/alpine-s6:alpine3.15-3.1.1

ARG BF_IMAGE
ARG BF_VERSION

ENV \
# set to "1" to compress backup sql files
Expand Down
5 changes: 4 additions & 1 deletion 14/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM bfren/alpine-s6:alpine3.15-3.0.2
FROM bfren/alpine-s6:alpine3.15-3.1.1

ARG BF_IMAGE
ARG BF_VERSION

ENV \
# set to "1" to compress backup sql files
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ See [For Backups](#for-backups) for configuration variables.

### For Database

| Variable | Values | Description | Default |
| ----------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ----------------- |
| `POSTGRESQL_USERNAME` | string | Application username - will be used as database name if `POSTGRESQL_DATABASE` is not set. | *None* - required |
| `POSTGRESQL_PASSWORD` | string | Application password. | *None* - required |
| `POSTGRESQL_DATABASE` | string | Database name(s) - multiple databases can be separated by a comma. | *None* |
| Variable | Values | Description | Default |
| --------------------- | ------ | ----------------------------------------------------------------------------------------- | ----------------- |
| `POSTGRESQL_USERNAME` | string | Application username - will be used as database name if `POSTGRESQL_DATABASE` is not set. | *None* - required |
| `POSTGRESQL_PASSWORD` | string | Application password. | *None* - required |
| `POSTGRESQL_DATABASE` | string | Database name(s) - multiple databases can be separated by a comma. | *None* |

## Helper Functions

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.3.0
2 changes: 1 addition & 1 deletion VERSION_MINOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2
1.3
3 changes: 3 additions & 0 deletions overlay/etc/cont-init.d/10-env
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ bf-env "POSTGRESQL_BACKUP" "${POSTGRESQL_BACKUP}"

bf-env "POSTGRESQL_BACKUP_FILENAME" "dump"
bf-env "POSTGRESQL_RESTORE" "${POSTGRESQL_BACKUP}/restore.sql"

bf-env "POSTGRESQL_SERVER_VERSION" `cat /usr/libexec/postgresql/PG_VERSION`
[[ -f "/data/PG_VERSION" ]] && bf-env "POSTGRESQL_DATA_VERSION" `cat /data/PG_VERSION`
18 changes: 18 additions & 0 deletions overlay/etc/cont-init.d/12-postgresql-init
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ stop () {
}


#======================================================================================================================
# Check data version against server version.
#======================================================================================================================

[[ -f "/data/PG_VERSION" ]] && POSTGRESQL_DATA_VERSION=`cat /data/PG_VERSION`
POSTGRESQL_SERVER_VERSION=`cat /usr/libexec/postgresql/PG_VERSION`

if [[ -z "${POSTGRESQL_DATA_VERSION-}" ]] || [[ "${POSTGRESQL_DATA_VERSION}" = "${POSTGRESQL_SERVER_VERSION}" ]] ; then
bf-debug "Versions ok."
else
bf-notok "PostgreSQL server (v${POSTGRESQL_SERVER_VERSION}) does not match data (v${POSTGRESQL_DATA_VERSION})."
bf-notok "You must upgrade the data or use a version of this image that matches the data version."
bf-notok "Container will now quit."
s6-svscanctl -t ${S6_SERVICES}
exit 1
fi


#======================================================================================================================
# Check for restore file.
#======================================================================================================================
Expand Down