Skip to content

Commit

Permalink
Merged in r2-2671-add-psql-15 (pull request #6574)
Browse files Browse the repository at this point in the history
R2-2671: Adding postgresql 15

Approved-by: Pavel Nabutovsky
  • Loading branch information
jtoliver-quoin authored and pnabutovsky committed Nov 14, 2023
2 parents 5f76e7e + f0c6345 commit 854c67f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ansible/inventory/inventory.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ all:
primero_tag: 'latest'
# As of Primero v2.5, the default Docker deployed PostgreSQL is 10.22.
# If you want to run Primero with a different version of PostgreSQL,
# set primero_postgres_version to either '11' or '14'.
# set primero_postgres_version to either '11', '14', or '15'.
# NOTE: YOU NEED TO PERFORM A DATA MIGRATION BEFORE CHANGING POSTGRES VERSIONS!!!!!!
# primero_postgres_version: '14'
locale_all: 'en,fr,ar'
Expand Down
2 changes: 1 addition & 1 deletion app/models/reports/field_queries/numeric_field_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def range_query

def sort_query
%(
case #{range.map.with_index { |range, index| build_range_order(field, range, index) }.join}
case #{range.map.with_index { |range, index| build_range_order(field, range, index) }.join(' ')}
end as #{sort_field}
)
end
Expand Down
11 changes: 11 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
- bash: echo "##vso[task.setvariable variable=latestpg10]$([[ ${BUILD_SOURCEBRANCH} == *${LATESTBRANCH} ]] && echo 'latest-pg10')"
- bash: echo "##vso[task.setvariable variable=latestpg11]$([[ ${BUILD_SOURCEBRANCH} == *${LATESTBRANCH} ]] && echo 'latest-pg11')"
- bash: echo "##vso[task.setvariable variable=latestpg14]$([[ ${BUILD_SOURCEBRANCH} == *${LATESTBRANCH} ]] && echo 'latest-pg14')"
- bash: echo "##vso[task.setvariable variable=latestpg15]$([[ ${BUILD_SOURCEBRANCH} == *${LATESTBRANCH} ]] && echo 'latest-pg15')"
- task: CmdLine@2
displayName: 'Build Primero Docker images'
inputs:
Expand Down Expand Up @@ -180,3 +181,13 @@ jobs:
tags: |
$(tag)-pg14
$(latestpg14)
- task: Docker@2
displayName: 'Postgres - Push an image to Dockerhub'
inputs:
containerRegistry: 'dockerhub-primeroims'
repository: 'primeroims/postgres'
command: 'push'
tags: |
$(tag)-pg15
$(latestpg15)
1 change: 1 addition & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ phases:
- docker push ${CONTAINER_REGISTRY}/primeroims/postgres:${TAG}-pg10
- docker push ${CONTAINER_REGISTRY}/primeroims/postgres:${TAG}-pg11
- docker push ${CONTAINER_REGISTRY}/primeroims/postgres:${TAG}-pg14
- docker push ${CONTAINER_REGISTRY}/primeroims/postgres:${TAG}-pg15
- docker push ${CONTAINER_REGISTRY}/primeroims/nginx:${TAG}
- docker push ${CONTAINER_REGISTRY}/primeroims/application:${TAG}
- ../buildspec/send-command.sh
3 changes: 3 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ BUILD_MIGRATION="docker build -f migration/Dockerfile ../ -t primero/migration:$
BUILD_POSTGRES10="docker build -f postgres/Dockerfile . -t primero/postgres:${tag}-pg10 -t ${repository}/primero/postgres:${tag}-pg10 --build-arg BUILD_REGISTRY=${build_registry} --build-arg POSTGRES_VERSION=10.22"
BUILD_POSTGRES11="docker build -f postgres/Dockerfile . -t primero/postgres:${tag}-pg11 -t ${repository}/primero/postgres:${tag}-pg11 --build-arg BUILD_REGISTRY=${build_registry} --build-arg POSTGRES_VERSION=11.17"
BUILD_POSTGRES14="docker build -f postgres/Dockerfile . -t primero/postgres:${tag}-pg14 -t ${repository}/primero/postgres:${tag}-pg14 --build-arg BUILD_REGISTRY=${build_registry} --build-arg POSTGRES_VERSION=14.5"
BUILD_POSTGRES15="docker build -f postgres/Dockerfile . -t primero/postgres:${tag}-pg15 -t ${repository}/primero/postgres:${tag}-pg15 --build-arg BUILD_REGISTRY=${build_registry} --build-arg POSTGRES_VERSION=15.4"

apply_tags () {
local image=${1}
Expand Down Expand Up @@ -89,6 +90,7 @@ case ${image} in
eval "${BUILD_POSTGRES10}" && apply_tags postgres pg10
eval "${BUILD_POSTGRES11}" && apply_tags postgres pg11
eval "${BUILD_POSTGRES14}" && apply_tags postgres pg14
eval "${BUILD_POSTGRES15}" && apply_tags postgres pg15
;;
all)
eval "${BUILD_APP}" && apply_tags application
Expand All @@ -98,6 +100,7 @@ case ${image} in
eval "${BUILD_POSTGRES10}" && apply_tags postgres pg10
eval "${BUILD_POSTGRES11}" && apply_tags postgres pg11
eval "${BUILD_POSTGRES14}" && apply_tags postgres pg14
eval "${BUILD_POSTGRES15}" && apply_tags postgres pg15
;;
*)
echo "${USAGE}"
Expand Down

0 comments on commit 854c67f

Please sign in to comment.