Skip to content

Commit 6e762ce

Browse files
committed
improved make assemble script
1 parent 36d7f86 commit 6e762ce

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

.ci/make.sh

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,15 @@ esac
138138
# ------------------------------------------------------- #
139139

140140
if [[ "$CMD" == "assemble" ]]; then
141-
artefact_name="elasticsearch-php-${VERSION}"
142141
echo -e "\033[34;1mINFO: copy artefacts\033[0m"
143-
rsync -arv --exclude=.ci --exclude=.git --filter=':- .gitignore' "$PWD" "${output_folder}/."
144-
145-
echo -e "\033[34;1mINFO: rename artefacts\033[0m"
146-
mv -v "${output_folder}/elasticsearch-php" "${output_folder}/${artefact_name}"
147-
148-
echo -e "\033[34;1mINFO: build artefacts\033[0m"
149-
cd ./.ci/output && tar -czvf ${artefact_name}.tar.gz "${artefact_name}/." && cd -
150-
151-
echo -e "\033[34;1mINFO: cleanup\033[0m"
152-
rm -Rf "${output_folder}/${artefact_name}"
153-
154-
echo -e "\033[34;1mINFO: validate artefact\033[0m"
155-
proof=`ls ${output_folder}`
156-
157-
if [ $proof == "${artefact_name}.tar.gz" ]; then
158-
echo -e "\033[32;1mTARGET: assemble - success: $artefact_name.tar.gz\033[0m"
159-
else
142+
rsync -ar --exclude=.ci --exclude=.git --filter=':- .gitignore' "$PWD" "${output_folder}/."
143+
144+
if compgen -G ".ci/output/*" > /dev/null; then
145+
cd $repo/.ci/output && tar -czf elasticsearch-php-$VERSION.tar.gz * && cd -
146+
rm -Rf "${repo}/.ci/output/elasticsearch-php"
147+
echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
148+
exit 0
149+
else
160150
echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
161151
exit 1
162152
fi

0 commit comments

Comments
 (0)