Skip to content

Commit

Permalink
Move installation of formatting and linting tools to Dockerfile (#25)
Browse files Browse the repository at this point in the history
* Move Poetry and npm installs to Dockerfile rather than dev startup script

* Update deps for dev and don't use the cache directory

* Use nvm during build process

* Use source to load nvm

* Update nvm path

* Ignore SC1091 for shellcheck on Dockerfile

* Update CHANGELOG.md
  • Loading branch information
ahosgood authored Dec 4, 2024
1 parent 8f86305 commit 8860c06
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ runs:
run: |
cd ${{ inputs.dockerfile-location }}
[ -d "./bin" ] && shellcheck --external-sources --exclude=SC1091 ./bin/*
shellcheck --external-sources --exclude=SC2148 ./Dockerfile
shellcheck --external-sources --exclude=SC2148 --exclude=SC1091 ./Dockerfile
shell: bash
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
### Changed

- Installation of formatting and linting tools moved to `Dockerfile` so are available at startup of the dev image

### Deprecated
### Removed
### Fixed
Expand Down
8 changes: 8 additions & 0 deletions docker/tna-python-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ ENV PATH="/home/app/.local/bin/tasks:/home/app/.local/bin/dev:$PATH"
# ==========================================
COPY --chown=app lib/* /home/app/

# ==========================================
# Install the tools required for linting and
# fixing both Python and JS/CSS code
# ==========================================
RUN python -m pip install --no-cache-dir --quiet black==24.10.0 flake8==7.1.1 isort==5.13.2; \
. "$HOME/.nvm/nvm.sh"; \
npm install -g [email protected] [email protected] [email protected] [email protected] [email protected]

CMD ["dev"]
5 changes: 1 addition & 4 deletions docker/tna-python-dev/bin/dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash

poetry install --no-root --with dev || true
python -m pip install --quiet black==24.10.0 flake8==7.1.0 isort==5.13.2

cd /app || return

. "$HOME/.nvm/nvm.sh"
if [ -f "/app/.nvmrc" ]
Expand All @@ -12,7 +9,7 @@ then
else
nvm use default
fi
npm install -g [email protected] [email protected] [email protected] [email protected] [email protected]
npm install

if [ -d "/home/app/.local/bin/tasks" ]
then
Expand Down

0 comments on commit 8860c06

Please sign in to comment.