Skip to content

Commit d36f4ec

Browse files
committed
Update assemble task - SNAPSHOT
1 parent aaae96a commit d36f4ec

File tree

2 files changed

+10
-48
lines changed

2 files changed

+10
-48
lines changed

.ci/make.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ output_folder=".ci/output"
4040
codegen_folder=".ci/output"
4141
OUTPUT_DIR="$repo/${output_folder}"
4242
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
43+
WORKFLOW="${WORKFLOW-staging}"
4344
mkdir -p "$OUTPUT_DIR"
4445

4546
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
@@ -58,7 +59,7 @@ case $CMD in
5859
exit 0
5960
;;
6061
assemble)
61-
if [ -v $VERSION ]; then
62+
if [[ -v $VERSION ]]; then
6263
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
6364
exit 1
6465
fi
@@ -67,7 +68,7 @@ case $CMD in
6768
TASK_ARGS=("$VERSION" "$output_folder")
6869
;;
6970
codegen)
70-
if [ -v $VERSION ]; then
71+
if [[ -v $VERSION ]]; then
7172
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
7273
exit 1
7374
fi
@@ -77,7 +78,7 @@ case $CMD in
7778
TASK_ARGS=("$VERSION" "$codegen_folder")
7879
;;
7980
docsgen)
80-
if [ -v $VERSION ]; then
81+
if [[ -v $VERSION ]]; then
8182
echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m"
8283
exit 1
8384
fi
@@ -93,7 +94,7 @@ case $CMD in
9394
TASK_ARGS=("$VERSION" "$codegen_folder")
9495
;;
9596
bump)
96-
if [ -v $VERSION ]; then
97+
if [[ -v $VERSION ]]; then
9798
echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m"
9899
exit 1
99100
fi
@@ -137,7 +138,11 @@ if [[ "$CMD" == "assemble" ]]; then
137138
if compgen -G ".ci/output/*" > /dev/null; then
138139

139140
# Tarball everything up in .ci/output
140-
cd $repo/.ci/output && tar -czvf elasticsearch-py-$VERSION.tar.gz * && cd -
141+
if [[ "$WORKFLOW" == 'snapshot' ]]; then
142+
cd $repo/.ci/output && tar -czvf elasticsearch-py-$VERSION-SNAPSHOT.tar.gz * && cd -
143+
else
144+
cd $repo/.ci/output && tar -czvf elasticsearch-py-$VERSION.tar.gz * && cd -
145+
fi
141146

142147
echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
143148
exit 0

utils/build-dists.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import re
2626
import shlex
2727
import shutil
28-
import sys
2928
import tempfile
3029

3130
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -167,48 +166,6 @@ def main():
167166
# If we're handed a version from the build manager we
168167
# should check that the version is correct or write
169168
# a new one.
170-
if len(sys.argv) >= 2:
171-
# 'build_version' is what the release manager wants,
172-
# 'expect_version' is what we're expecting to compare
173-
# the package version to before building the dists.
174-
build_version = expect_version = sys.argv[1]
175-
176-
# Any prefixes in the version specifier mean we're making
177-
# a pre-release which will modify __versionstr__ locally
178-
# and not produce a git tag.
179-
if any(x in build_version for x in ("-SNAPSHOT", "-rc", "-alpha", "-beta")):
180-
# If a snapshot, then we add '+dev'
181-
if "-SNAPSHOT" in build_version:
182-
version = version + "+dev"
183-
# alpha/beta/rc -> aN/bN/rcN
184-
else:
185-
pre_number = re.search(r"-(a|b|rc)(?:lpha|eta|)(\d+)$", expect_version)
186-
version = version + pre_number.group(1) + pre_number.group(2)
187-
188-
expect_version = re.sub(
189-
r"(?:-(?:SNAPSHOT|alpha\d+|beta\d+|rc\d+))+$", "", expect_version
190-
)
191-
if expect_version.endswith(".x"):
192-
expect_version = expect_version[:-1]
193-
194-
# For snapshots we ensure that the version in the package
195-
# at least *starts* with the version. This is to support
196-
# build_version='7.x-SNAPSHOT'.
197-
if not version.startswith(expect_version):
198-
print(
199-
"Version of package (%s) didn't match the "
200-
"expected release version (%s)" % (version, build_version)
201-
)
202-
exit(1)
203-
204-
# A release that will be tagged, we want
205-
# there to be no '+dev', etc.
206-
elif expect_version != version:
207-
print(
208-
"Version of package (%s) didn't match the "
209-
"expected release version (%s)" % (version, build_version)
210-
)
211-
exit(1)
212169

213170
for suffix in ("", major_version):
214171
run("rm", "-rf", "build/", "*.egg-info", ".eggs")

0 commit comments

Comments
 (0)