Skip to content

Commit

Permalink
simplify our changes
Browse files Browse the repository at this point in the history
drop the versions.cfg
drop the versions -> requirements step
add something to configure in entrypoint
  • Loading branch information
jweede committed Dec 12, 2017
1 parent 103faca commit c4201b3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 289 deletions.
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ MAINTAINER Shoobx Ops <ops@shoobx.com>

WORKDIR "/opt/keas.kmi"

COPY docker/build.sh versions.cfg ./
RUN ["bash", "build.sh"]
COPY src/ ./src/
COPY setup.py README.txt CHANGES.txt ./
RUN pip install -e . --no-cache-dir

COPY docker/entrypoint.sh ./
ENTRYPOINT ["bash", "entrypoint.sh"]

COPY src/ ./src/
COPY setup.py README.txt CHANGES.txt ./
RUN pip install -e .

VOLUME ["/opt/keas.kmi/keys/"]
EXPOSE 8080

Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ all: bin/kmi
clean:
git clean -dxf

.PHONY: update # generates a new frozen versions.cfg
update: bin/buildout
bin/buildout update-versions-file=versions.cfg

.PHONY: docker # builds the docker image
docker:
docker build -t "$(DOCKER_TAG)" .
Expand Down
3 changes: 2 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ parts = test coverage-test coverage-report python paster runserver testclient
ctags
versions = versions
newest = true
extends = versions.cfg

[test]
recipe = zc.recipe.testrunner
Expand Down Expand Up @@ -48,3 +47,5 @@ initialization =
[testclient]
recipe = zc.recipe.egg
eggs = keas.kmi

[versions]
26 changes: 0 additions & 26 deletions docker/build.sh

This file was deleted.

23 changes: 12 additions & 11 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env bash
set -eux

GENERATED_ZOPE_CONF_FILE="zope.conf"
GENERATED_SERV_CONF_FILE="server.ini"
GENERATED_MARKER="generated by $(realpath ${0})"
GENERATED_BY="generated by $(realpath ${0})"
# settings defaults
: "${KMI_LOGGER_LEVEL:=INFO}"
: "${KMI_LOGGER_ROOT_LEVEL:=WARN}"

# translate env vars to config
cat - > "${GENERATED_SERV_CONF_FILE}" <<CONFIG
# ${GENERATED_MARKER}
# generate config from env
cat - > 'server.ini' <<CONFIG
# ${GENERATED_BY}
[app:main]
use = egg:keas.kmi
storage-dir=keys/
Expand All @@ -29,11 +30,11 @@ keys = console
keys = generic
[logger_root]
level = WARN
level = ${KMI_LOGGER_ROOT_LEVEL}
handlers = console
[logger_kmi]
level = INFO
level = ${KMI_LOGGER_LEVEL}
handlers = console
propagate = 0
qualname = kmi
Expand All @@ -49,8 +50,8 @@ datefmt= %Y-%m-%d %H:%M:%S
CONFIG

cat - > "zope.conf" <<ZOPE
# ${GENERATED_MARKER}
cat - > 'zope.conf' <<ZOPE
# ${GENERATED_BY}
site-definition src/keas/kmi/application.zcml
<eventlog>
Expand All @@ -68,7 +69,7 @@ ZOPE
# resume entrypoint stuff
if [[ "${1:-}" == 'run' ]]; then
ls keys/
gunicorn --paste "${GENERATED_SERV_CONF_FILE}"
exec gunicorn --paste 'server.ini'
else
exec "$@"
fi
241 changes: 0 additions & 241 deletions versions.cfg

This file was deleted.

0 comments on commit c4201b3

Please sign in to comment.