Skip to content

Commit

Permalink
pgcli version is extracted into a docker argument (#3628)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngken0995 authored Jan 8, 2024
1 parent efba05d commit 4cc5653
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ jobs:
INGESTION_PY_VERSION=${{ steps.prepare-build-args.outputs.ingestion_py_version }}
FRONTEND_NODE_VERSION=${{ steps.prepare-build-args.outputs.frontend_node_version }}
FRONTEND_PNPM_VERSION=${{ steps.prepare-build-args.outputs.frontend_pnpm_version }}
PGCLI_VERSION=${{ steps.prepare-build-args.outputs.pgcli_version }}
- name: Upload image `${{ matrix.image }}`
id: upload-img
Expand Down
4 changes: 4 additions & 0 deletions api/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ NO_COLOR := "\\033[0m"
###########

export API_PY_VERSION := `grep 'python_version' Pipfile | awk -F' = ' '{print $2}' | sed 's/"//g'`
export PGCLI_VERSION := `grep 'pgcli' Pipfile | awk -F' = ' '{print $2}' | sed 's/\~//g; s/"//g; s/=//g'`

# Print the Python version specified in the `Pipfile`
@py-version:
echo $API_PY_VERSION

@pgcli-version:
echo $PGCLI_VERSION

###########
# Install #
###########
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ services:
build:
context: ./docker/upstream_db/
target: db
args: # Automatically inferred from env vars, unless specified
- PGCLI_VERSION
image: openverse-upstream_db
ports:
- "50255:5432"
Expand Down
2 changes: 1 addition & 1 deletion docker/upstream_db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FROM postgres:13.10 as db

ARG PGCLI_VERSION=4.0.1
ARG PGCLI_VERSION

# Container optimizations
ENV PYTHONUNBUFFERED=1
Expand Down
2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export API_PY_VERSION := `just api/py-version`
export INGESTION_PY_VERSION := `just ingestion_server/py-version`
export FRONTEND_NODE_VERSION := `just frontend/node-version`
export FRONTEND_PNPM_VERSION := `just frontend/pnpm-version`
export PGCLI_VERSION := `just api/pgcli-version`

export HOST_NETWORK_ADDRESS := if os() == "macos" { "host.docker.internal" } else { "172.17.0.1" }

Expand All @@ -138,6 +139,7 @@ versions:
ingestion_py_version=$(just ingestion_server/py-version)
frontend_node_version=$(just frontend/node-version)
frontend_pnpm_version=$(just frontend/pnpm-version)
pgcli_version=$(just api/pgcli-version)
EOF
# Run `docker-compose` configured with the correct files and environment
Expand Down

0 comments on commit 4cc5653

Please sign in to comment.