Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove restriction from publish snapshot script that jars must end in -SNAPSHOT.jar. #1188

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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