From 21f25419eb7781a9da24c8d560679cc25d8d1829 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Nov 2020 13:45:05 -0600 Subject: [PATCH] [7.x] Change 'make.sh release' to 'make.sh assemble' Co-authored-by: Seth Michael Larson --- .ci/Dockerfile | 10 ++++++++-- .ci/make.sh | 8 +++++--- .dockerignore | 1 - utils/build-dists.py | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.ci/Dockerfile b/.ci/Dockerfile index 2cedf7a3..09181986 100644 --- a/.ci/Dockerfile +++ b/.ci/Dockerfile @@ -2,9 +2,15 @@ ARG PYTHON_VERSION=3.8 FROM python:${PYTHON_VERSION} WORKDIR /code/elasticsearch-py -COPY . . +COPY dev-requirements.txt . RUN python -m pip install \ + -U --no-cache-dir \ + --disable-pip-version-check \ + pip \ + && python -m pip install \ --no-cache-dir \ --disable-pip-version-check \ - -e . \ -r dev-requirements.txt + +COPY . . +RUN python -m pip install -e . diff --git a/.ci/make.sh b/.ci/make.sh index 706a0126..f68bde59 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -5,10 +5,12 @@ set -eo pipefail BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" BASE_DIR="$( dirname "$BASE_DIR" )" -if [[ "$1" == "release" ]]; then - python $BASE_DIR/utils/build-dists.py $2 +if [[ "$1" == "assemble" ]]; then mkdir -p $BASE_DIR/.ci/output - cp $BASE_DIR/dist/* $BASE_DIR/.ci/output/ + docker build . --tag elastic/elasticsearch-py -f .ci/Dockerfile + docker run --rm -it -v $BASE_DIR/.ci/output:/code/elasticsearch-py/dist \ + elastic/elasticsearch-py \ + python /code/elasticsearch-py/utils/build-dists.py $2 exit 0 fi diff --git a/.dockerignore b/.dockerignore index a7231663..ce7f5c1a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,6 @@ docs example venv -.git .tox .nox .*_cache diff --git a/utils/build-dists.py b/utils/build-dists.py index 015aa3c1..db5b8158 100644 --- a/utils/build-dists.py +++ b/utils/build-dists.py @@ -161,7 +161,7 @@ def test_dist(dist): def main(): run("git", "checkout", "--", "setup.py", "elasticsearch/") - run("rm", "-rf", "build/", "dist/", "*.egg-info", ".eggs") + run("rm", "-rf", "build/", "dist/*", "*.egg-info", ".eggs") # Grab the major version to be used as a suffix. version_path = os.path.join(base_dir, "elasticsearch/_version.py") @@ -258,6 +258,7 @@ def main(): assert len(dists) == 4 for dist in dists: test_dist(os.path.join(base_dir, "dist", dist)) + os.system("chmod a+w dist/*") # After this run 'python -m twine upload dist/*' print(