Skip to content

Commit

Permalink
Remove restriction from publish snapshot script that jars must end in…
Browse files Browse the repository at this point in the history
… -SNAPSHOT.jar.

Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 committed Nov 30, 2021
1 parent c0490fb commit 3c1b0f5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions publish/publish-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,19 @@ for pom in ${pomFiles}; do
pom_dir="$(dirname "${pom}")"
for FILE in "${pom_dir}"/*; do
# The POM is deployed with the artifact in a single deploy-file command, we can skip over it
if [[ $FILE != $pom ]]; then
if [[ $FILE != $pom ]] &&
[[ $FILE != *"test-fixtures"* ]] && # This is a hack to ensure the OpenSearch build-tools test fixture jar is not uploaded instead of the actual build-tools jar.
[[ $FILE != *"javadoc"* ]] &&
[[ $FILE != *"sources"* ]]; then
extension="${FILE##*.}"
case $extension in jar | war | zip)
# Ensure we are only pushing the artifact that ends with -SNAPSHOT.<extension> and its pom.
if [[ $FILE == *SNAPSHOT.${extension} ]]; then
echo "Uploading: ${FILE} with ${pom} to ${url}"
mvn --settings="${mvn_settings}" deploy:deploy-file \
-DgeneratePom=false \
-DrepositoryId=nexus \
-Durl="${SNAPSHOT_REPO_URL}" \
-DpomFile="${pom}" \
-Dfile="${FILE}" || echo "Failed to upload ${FILE}"
else
echo "Skipping upload of additional artifact: ${FILE}"
fi
;;
*) echo "Skipping upload for ${FILE}" ;;
esac
Expand Down

0 comments on commit 3c1b0f5

Please sign in to comment.