[PATCH v4 4/8] docker: remove deprecated startup arguments
You-Sheng Yang
vicamo at gmail.com
Thu Dec 9 14:38:39 AEDT 2021
This also adds a default CMD directive so that it will launch a
patchwork instance when started with no argument.
Signed-off-by: You-Sheng Yang <vicamo at gmail.com>
---
docker-compose-pg.yml | 1 -
docker-compose.yml | 1 -
docs/development/installation.rst | 4 ++--
...recated-startup-arguments-768425c23b523d1e.yaml | 9 +++++++++
tools/docker/Dockerfile | 1 +
tools/docker/entrypoint.sh | 14 ++------------
6 files changed, 14 insertions(+), 16 deletions(-)
create mode 100644 releasenotes/notes/docker-remove-deprecated-startup-arguments-768425c23b523d1e.yaml
diff --git a/docker-compose-pg.yml b/docker-compose-pg.yml
index 8056d62..e703b96 100644
--- a/docker-compose-pg.yml
+++ b/docker-compose-pg.yml
@@ -16,7 +16,6 @@ services:
- GID
depends_on:
- db
- command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/home/patchwork/patchwork/
ports:
diff --git a/docker-compose.yml b/docker-compose.yml
index 103f19f..b91b7ef 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -18,7 +18,6 @@ services:
- GID
depends_on:
- db
- command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/home/patchwork/patchwork/
ports:
diff --git a/docs/development/installation.rst b/docs/development/installation.rst
index 3507f43..c5c0269 100644
--- a/docs/development/installation.rst
+++ b/docs/development/installation.rst
@@ -60,7 +60,7 @@ To run a shell within this environment, run:
.. code-block:: shell
- $ docker-compose run --rm web --shell
+ $ docker-compose run --rm web /bin/bash
To run ``django-manage`` commands, such as ``createsuperuser`` or ``migrate``,
run:
@@ -85,7 +85,7 @@ Likewise, to restore an older version of the database, run:
.. code-block:: shell
- $ docker-compose run --rm -web python manage.py dbrestore
+ $ docker-compose run --rm web python manage.py dbrestore
To run unit tests against the system Python packages, run:
diff --git a/releasenotes/notes/docker-remove-deprecated-startup-arguments-768425c23b523d1e.yaml b/releasenotes/notes/docker-remove-deprecated-startup-arguments-768425c23b523d1e.yaml
new file mode 100644
index 0000000..7b71ded
--- /dev/null
+++ b/releasenotes/notes/docker-remove-deprecated-startup-arguments-768425c23b523d1e.yaml
@@ -0,0 +1,9 @@
+---
+features:
+ - |
+ Development docker image now launches a patchwork instance by default when
+ started with no argument.
+deprecations:
+ - |
+ Long deprecated development docker image startup arguments --shell, --test,
+ --tox, --quick-test and --quick-tox are removed.
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index fe0cd59..71167e0 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -61,5 +61,6 @@ RUN pip install -r /opt/requirements-dev.txt
COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
+CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
USER patchwork
WORKDIR /home/patchwork/patchwork
diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh
index faa36b3..7e0af5a 100755
--- a/tools/docker/entrypoint.sh
+++ b/tools/docker/entrypoint.sh
@@ -133,20 +133,10 @@ elif ! test_database; then
reset_data
fi
-# TODO(stephenfin): Deprecated the --test, --tox, --quick-test and --quick-tox
-# flags in a future release
if [ $# -eq 0 ]; then
# we probably ran with --reset and nothing else
# just exit cleanly
exit 0
-elif [ "$1" == "--shell" ]; then
- exec bash
-elif [ "$1" == "--test" ] || [ "$1" == "--quick-test" ]; then
- shift
- python manage.py test $@
-elif [ "$1" == "--tox" ] || [ "$1" == "--quick-tox" ]; then
- shift
- tox $@
-else # run whatever CMD is set to
- $@
fi
+
+exec "$@"
--
2.32.0
More information about the Patchwork
mailing list