diff --git a/Dockerfile b/Dockerfile index 8cfb0e32df..b37f5b01b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ WORKDIR /usr/src/app COPY .npmrc .npmrc COPY Pipfile Pipfile +COPY Pipfile.lock Pipfile.lock COPY package.json package.json COPY package-lock.json package-lock.json @@ -32,11 +33,11 @@ RUN apt-get update && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ apt-get update && \ apt-get install -y --no-install-recommends nodejs && \ - pip install pipenv==2023.12.1 --no-cache-dir && \ + pip install pipenv==2024.0.1 --no-cache-dir && \ if [ "${ENV}" = 'dev' ]; then \ - pipenv install --system --skip-lock --dev; \ + pipenv install --system --dev; \ else \ - pipenv install --system --skip-lock; \ + pipenv install --system; \ fi && \ npm install && \ pip uninstall -y pipenv virtualenv && \ diff --git a/scripts/pr_format/pr_format/install_pipenv.sh b/scripts/pr_format/pr_format/install_pipenv.sh index c6fb023088..c235e4a109 100755 --- a/scripts/pr_format/pr_format/install_pipenv.sh +++ b/scripts/pr_format/pr_format/install_pipenv.sh @@ -11,3 +11,15 @@ else fi pip install "${package_name_with_version}" + +if [ -f ${file_name} ]; then + new_version="$(pip list --outdated | grep pipenv || true)" + new_version="$(echo -e "${new_version}" | awk '{print $3}')" + if [ -n "${new_version}" ]; then + PATTERN_BEFORE="${package_name}[^ ]+" + PATTERN_AFTER="${package_name}==${new_version}" + sed -i -E "s/${PATTERN_BEFORE}/${PATTERN_AFTER}/g" ${file_name} + pip install "${package_name}==${new_version}" + exit 1 + fi +fi