From cb96f6892fa93001a640f33f690475b7093a797b Mon Sep 17 00:00:00 2001 From: "Aris (Karim) Merchant" Date: Tue, 31 Jul 2018 12:24:45 -0700 Subject: [PATCH 1/3] Change Dockerfile to comply with best practices In order of decreasing significance: * Move addition of all files later to avoid premature build cache invalidation * Add separate instructions to copy over files needed earlier * Change deprecated MAINTAINER instruction to LABEL maintainer * Change ADD to COPY, as ADD apparently behaves weirdly in some cases * Alphabetize dependencies for readability --- Dockerfile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c6b15103e..3f55973d70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,22 +21,30 @@ # FROM alpine -MAINTAINER www.evennia.com +LABEL maintainer="www.evennia.com" # install compilation environment -RUN apk update && apk add python py-pip python-dev py-setuptools gcc \ -musl-dev jpeg-dev zlib-dev bash py2-openssl procps +RUN apk update && apk add bash gcc jpeg-dev musl-dev procps py-pip \ +py-setuptools py2-openssl python python-dev zlib-dev -# add the project source -ADD . /usr/src/evennia +# add the files required for pip installation +COPY ./setup.py /usr/src/evennia/ +COPY ./requirements.txt /usr/src/evennia/ +COPY ./evennia/VERSION.txt /usr/src/evennia/evennia/ +COPY ./bin /usr/src/evennia/bin/ # install dependencies RUN pip install -e /usr/src/evennia --trusted-host pypi.python.org RUN pip install cryptography pyasn1 service_identity +# add the project source; this should always be done after all +# expensive operations have completed to avoid prematurely +# invalidating the build cache. +COPY . /usr/src/evennia + # add the game source when rebuilding a new docker image from inside # a game dir -ONBUILD ADD . /usr/src/game +ONBUILD COPY . /usr/src/game # make the game source hierarchy persistent with a named volume. # mount on-disk game location here when using the container From 87456c081f42abafd26a399ba7fa35a52d311a8a Mon Sep 17 00:00:00 2001 From: FatherGrishnak <42367299+FatherGrishnak@users.noreply.github.com> Date: Tue, 14 Aug 2018 08:31:09 +0000 Subject: [PATCH 2/3] Update to fix #1644 --- evennia/objects/manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/objects/manager.py b/evennia/objects/manager.py index 4c81ea186a..6b4a16dde9 100644 --- a/evennia/objects/manager.py +++ b/evennia/objects/manager.py @@ -437,7 +437,7 @@ class ObjectDBManager(TypedObjectManager): """ Create and return a new object as a copy of the original object. All will be identical to the original except for the arguments given - specifically to this method. + specifically to this method. Object contents will not be copied. Args: original_object (Object): The object to make a copy from. @@ -502,6 +502,10 @@ class ObjectDBManager(TypedObjectManager): for script in original_object.scripts.all(): ScriptDB.objects.copy_script(script, new_obj=new_object) + # copy over all tags, if any + for tag in original_object.tags.get(): + new_object.tags.add(tag) + return new_object def clear_all_sessids(self): From 5e6a29a43018c8864db5b267a7a65f0953fc3057 Mon Sep 17 00:00:00 2001 From: FatherGrishnak <42367299+FatherGrishnak@users.noreply.github.com> Date: Wed, 15 Aug 2018 00:55:13 +0000 Subject: [PATCH 3/3] Update manager.py --- evennia/objects/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/objects/manager.py b/evennia/objects/manager.py index 6b4a16dde9..9907c960d6 100644 --- a/evennia/objects/manager.py +++ b/evennia/objects/manager.py @@ -503,9 +503,9 @@ class ObjectDBManager(TypedObjectManager): ScriptDB.objects.copy_script(script, new_obj=new_object) # copy over all tags, if any - for tag in original_object.tags.get(): - new_object.tags.add(tag) - + for tag in original_object.tags.get(return_tagobj=True, return_list=True): + new_object.tags.add(tag=tag.key, category=tag.category, data=tag.data) + return new_object def clear_all_sessids(self):