Skip to content

Commit

Permalink
Only upgrade packages if the relevant files exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 9, 2025
1 parent 9206c81 commit e298011
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `staging` option removed from `ENVIRONMENT` - there is now only `production` and `develop`

### Fixed

- Only upgrade npm packages if a `package.json` file exists

### Security

## [0.6.0](https://github.com/nationalarchives/docker/compare/v0.5.2...v0.6.0) - 2025-01-03
Expand Down
25 changes: 19 additions & 6 deletions docker/tna-python-dev/bin/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@

cd /app || return

if [ -z "$1" ] || [ "$1" == "poetry" ]; then
echo "Upgrading Poetry dependencies..."
poetry update
if [ -z "$1" ] || [ "$1" == "poetry" ]
then
if [ -f "/app/pyproject.toml" ]
then
echo "Upgrading Poetry dependencies..."
poetry update
else
echo "pyproject.toml does not exist"
exit 1
fi
fi

if [ -z "$1" ] || [ "$1" == "npm" ]; then
echo "Upgrading npm dependencies..."
tna-npm update
if [ -z "$1" ] || [ "$1" == "npm" ]
then
if [ -f "/app/package.json" ]
then
echo "Upgrading npm dependencies..."
tna-npm update
else
echo "package.json does not exist"
fi
fi

0 comments on commit e298011

Please sign in to comment.