From 348e8e80864bb4d0acfe05f64e51fdf665a36dec Mon Sep 17 00:00:00 2001 From: Feike Steenbergen Date: Mon, 7 Sep 2015 13:47:05 +0200 Subject: [PATCH] Reverted pip installation in Dockerfile As the Dockerfile is there mainly to support developers, we want to build the Dockerfile using the current working directory instead of a previously released version. --- docker/Dockerfile => Dockerfile | 12 ++++++------ docker/Dockerfile.test.patch | 13 ------------- docker/entrypoint.sh | 2 +- patroni/version.py | 2 +- release.sh | 15 +++++++++------ 5 files changed, 17 insertions(+), 27 deletions(-) rename docker/Dockerfile => Dockerfile (86%) delete mode 100644 docker/Dockerfile.test.patch diff --git a/docker/Dockerfile b/Dockerfile similarity index 86% rename from docker/Dockerfile rename to Dockerfile index 1a1cb41c..61d85a74 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -13,21 +13,21 @@ RUN apt-get update -y RUN apt-get upgrade -y ENV PGVERSION 9.4 -RUN apt-get install postgresql-${PGVERSION} -y -RUN apt-get install python python-psycopg2 python-yaml python-requests python-dnspython python-pip python-mock -y -RUN pip install patroni - +RUN apt-get install python python-psycopg2 python-yaml python-requests python-boto postgresql-${PGVERSION} python-dnspython python-kazoo python-pip -y +RUN pip install python-etcd ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:$PATH +ADD patroni.py /patroni.py +ADD patroni/ /patroni + ENV ETCDVERSION 2.0.13 RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-amd64.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored etcd etcdctl ### Setting up a simple script that will serve as an entrypoint -RUN mkdir /patroni/ RUN mkdir /data/ && touch /var/log/etcd.log /var/log/etcd.err /pgpass /patroni/postgres.yml RUN chown postgres:postgres -R /patroni/ /data/ /pgpass /var/log/etcd.* /patroni/postgres.yml -ADD entrypoint.sh /entrypoint.sh +ADD docker/entrypoint.sh /entrypoint.sh EXPOSE 4001 5432 2380 diff --git a/docker/Dockerfile.test.patch b/docker/Dockerfile.test.patch deleted file mode 100644 index 376f3c20..00000000 --- a/docker/Dockerfile.test.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- Dockerfile 2015-09-03 09:24:16.355412216 +0200 -+++ Dockerfile.test 2015-09-03 09:25:48.407879693 +0200 -@@ -15,7 +15,9 @@ - ENV PGVERSION 9.4 - RUN apt-get install postgresql-${PGVERSION} -y - RUN apt-get install python python-psycopg2 python-yaml python-requests python-dnspython python-pip python-mock -y --RUN pip install patroni -+## We install prereqs from pypi, the package from testpypi -+RUN pip install --force-reinstall --upgrade kazoo boto python-etcd -+RUN pip install -i https://testpypi.python.org/pypi patroni - - - ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:$PATH diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b28f4ae6..f4851a36 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -133,5 +133,5 @@ then sleep 60 done else - exec patroni /patroni/postgres.yml + exec python /patroni.py /patroni/postgres.yml fi diff --git a/patroni/version.py b/patroni/version.py index 11d27f8c..d0cc8295 100644 --- a/patroni/version.py +++ b/patroni/version.py @@ -1 +1 @@ -__version__ = '0.1' +__version__ = '0.45' diff --git a/release.sh b/release.sh index 316ca908..bf6f7482 100755 --- a/release.sh +++ b/release.sh @@ -5,6 +5,9 @@ if [ $# -ne 1 ]; then exit 1 fi +readonly VERSIONFILE="patroni/version.py" + +## Bail out on any non-zero exitcode from the called processes set -xe python3 --version @@ -12,17 +15,17 @@ git --version version=$1 -sed -i "s/__version__ = .*/__version__ = '${version}'/" version.py +sed -i "s/__version__ = .*/__version__ = '${version}'/" "${VERSIONFILE}" python3 setup.py clean python3 setup.py test python3 setup.py flake8 -git add __init__.py +git add "${VERSIONFILE}" -git commit -m "Bumped version to $version" -git push +#git commit -m "Bumped version to $version" +#git push python3 setup.py sdist bdist_wheel upload -git tag ${version} -git push --tags +#git tag ${version} +#git push --tags