Skip to content

Commit

Permalink
Merge pull request #4065 from dev-hato/revert-4030-rm_update_pipenv
Browse files Browse the repository at this point in the history
pipenvアップデート
  • Loading branch information
massongit authored Jun 15, 2024
2 parents d49615d + ea7398a commit 5602e89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 && \
Expand Down
12 changes: 12 additions & 0 deletions scripts/pr_format/pr_format/install_pipenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5602e89

Please sign in to comment.