From 9b4bf3c59bdd91b2659f39710498a2082b6e26dd Mon Sep 17 00:00:00 2001 From: Mark Striemer Date: Thu, 11 Feb 2016 11:16:01 -0600 Subject: [PATCH] Set COMPOSE_PROJECT_NAME based on root directory Document that you might need to set COMPOSE_PROJECT_NAME in some cases too. --- Makefile | 6 +++++- README.rst | 2 +- docs/index.rst | 2 +- .../deprecated/advanced-installation.rst | 0 .../{install-olympia => install}/deprecated/celery.rst | 0 .../deprecated/elasticsearch.rst | 0 .../{install-olympia => install}/deprecated/index.rst | 0 .../deprecated/installation.rst | 0 .../deprecated/troubleshooting.rst | 0 docs/topics/{install-olympia => install}/docker.rst | 7 +++++++ docs/topics/{install-olympia => install}/index.rst | 0 11 files changed, 14 insertions(+), 3 deletions(-) rename docs/topics/{install-olympia => install}/deprecated/advanced-installation.rst (100%) rename docs/topics/{install-olympia => install}/deprecated/celery.rst (100%) rename docs/topics/{install-olympia => install}/deprecated/elasticsearch.rst (100%) rename docs/topics/{install-olympia => install}/deprecated/index.rst (100%) rename docs/topics/{install-olympia => install}/deprecated/installation.rst (100%) rename docs/topics/{install-olympia => install}/deprecated/troubleshooting.rst (100%) rename docs/topics/{install-olympia => install}/docker.rst (93%) rename docs/topics/{install-olympia => install}/index.rst (100%) diff --git a/Makefile b/Makefile index 83d5c8901b..e71a3b0a69 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,11 @@ NUM_ADDONS=10 NUM_THEMES=$(NUM_ADDONS) -COMPOSE_PROJECT_NAME?=addonsserver +# Get the name of the Makefile's directory for the docker container base name. +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) + +COMPOSE_PROJECT_NAME?=$(shell echo "${current_dir}" | tr -d '-' | tr -d '_') DOCKER_NAME="${COMPOSE_PROJECT_NAME}_web_1" UNAME_S := $(shell uname -s) diff --git a/README.rst b/README.rst index 9a71f5bdc9..8352d4b18a 100644 --- a/README.rst +++ b/README.rst @@ -19,5 +19,5 @@ You can access the AMO stage environment at https://addons.allizom.org/ You can join our mailing list at: https://mail.mozilla.org/listinfo/dev-addons .. _`addons.mozilla.org`: https://addons.mozilla.org -.. _`install docs`: https://addons-server.readthedocs.org/en/latest/topics/install-olympia/docker.html +.. _`install docs`: https://addons-server.readthedocs.org/en/latest/topics/install/docker.html .. _`irc://irc.mozilla.org/amo`: irc://irc.mozilla.org/amo diff --git a/docs/index.rst b/docs/index.rst index ee720624ab..8caaffd739 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,5 +15,5 @@ Contents :maxdepth: 2 topics/api/index - topics/install-olympia/index + topics/install/index topics/development/index diff --git a/docs/topics/install-olympia/deprecated/advanced-installation.rst b/docs/topics/install/deprecated/advanced-installation.rst similarity index 100% rename from docs/topics/install-olympia/deprecated/advanced-installation.rst rename to docs/topics/install/deprecated/advanced-installation.rst diff --git a/docs/topics/install-olympia/deprecated/celery.rst b/docs/topics/install/deprecated/celery.rst similarity index 100% rename from docs/topics/install-olympia/deprecated/celery.rst rename to docs/topics/install/deprecated/celery.rst diff --git a/docs/topics/install-olympia/deprecated/elasticsearch.rst b/docs/topics/install/deprecated/elasticsearch.rst similarity index 100% rename from docs/topics/install-olympia/deprecated/elasticsearch.rst rename to docs/topics/install/deprecated/elasticsearch.rst diff --git a/docs/topics/install-olympia/deprecated/index.rst b/docs/topics/install/deprecated/index.rst similarity index 100% rename from docs/topics/install-olympia/deprecated/index.rst rename to docs/topics/install/deprecated/index.rst diff --git a/docs/topics/install-olympia/deprecated/installation.rst b/docs/topics/install/deprecated/installation.rst similarity index 100% rename from docs/topics/install-olympia/deprecated/installation.rst rename to docs/topics/install/deprecated/installation.rst diff --git a/docs/topics/install-olympia/deprecated/troubleshooting.rst b/docs/topics/install/deprecated/troubleshooting.rst similarity index 100% rename from docs/topics/install-olympia/deprecated/troubleshooting.rst rename to docs/topics/install/deprecated/troubleshooting.rst diff --git a/docs/topics/install-olympia/docker.rst b/docs/topics/install/docker.rst similarity index 93% rename from docs/topics/install-olympia/docker.rst rename to docs/topics/install/docker.rst index 537b1cde04..72c2e94dce 100644 --- a/docs/topics/install-olympia/docker.rst +++ b/docs/topics/install/docker.rst @@ -103,6 +103,13 @@ on each container. Here is an example of running the ``py.test`` command on the If you'd like to use a python debugger to interactively debug Django view code, check out the :ref:`debugging` section. +.. note:: + If you see an error like ``No such container: addonsserver_web_1`` and + your containers are running you can overwrite the base name for docker + containers with the ``COMPOSE_PROJECT_NAME`` environment variable. If your + container is named ``localaddons_web_1`` you would set + ``COMPOSE_PROJECT_NAME=localaddons``. + Updating your containers ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/install-olympia/index.rst b/docs/topics/install/index.rst similarity index 100% rename from docs/topics/install-olympia/index.rst rename to docs/topics/install/index.rst