-
Notifications
You must be signed in to change notification settings - Fork 172
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
feat: Publish artifacts to maven #946
Conversation
de7c995
to
6141a26
Compare
@andygrove This is ready to be tried out. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #946 +/- ##
============================================
+ Coverage 34.16% 34.19% +0.02%
- Complexity 880 894 +14
============================================
Files 112 112
Lines 43286 43344 +58
Branches 9572 9576 +4
============================================
+ Hits 14789 14820 +31
- Misses 25478 25511 +33
+ Partials 3019 3013 -6 ☔ View full report in Codecov by Sentry. |
dev/release/publish-to-maven.sh
Outdated
exit 1 | ||
fi | ||
|
||
STAGED_REPO_ID=$(echo $REPO_REQUEST_RESPONSE | xmllint -xpath "//stagedRepositoryId/text()" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing for me with:
Usage : xmllint [options] XMLfiles ...
I am using this version:
% xmllint --version
xmllint: using libxml version 20913
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude ICU ISO8859X Unicode Regexps Automata Schemas Schematron Modules Debug Zlib
dev/release/publish-to-maven.sh
Outdated
exit 1 | ||
fi | ||
|
||
STAGED_REPO_ID=$(echo $REPO_REQUEST_RESPONSE | xmllint -xpath "//stagedRepositoryId/text()" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes it for me.
The -
at the end indicates stdin input
STAGED_REPO_ID=$(echo $REPO_REQUEST_RESPONSE | xmllint -xpath "//stagedRepositoryId/text()" ) | |
STAGED_REPO_ID=$(echo $REPO_REQUEST_RESPONSE | xmllint --xpath "//stagedRepositoryId/text()" -) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I tested parts of this script independently and once I put it all together I was not able to test everything since it would fail before this stage!
dev/release/publish-to-maven.sh
Outdated
# check permission | ||
PERMITTED_REQUEST="-u $ASF_USERNAME:$ASF_PASSWORD \ | ||
-H "Content-Type:application/xml" \ | ||
$NEXUS_ROOT/profiles/$NEXUS_PROFILE/start" | ||
PERMITTED=$(curl -s -o /dev/null -w "%{http_code}" $PERMITTED_REQUEST) | ||
|
||
if [ "$PERMITTED" != "200" ] | ||
then | ||
echo "Nexus replied with a status code: $PERMITTED" | ||
echo "You may not be authorized to perform this action" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This permission check does not work for me. I get a 405
response. I just commented this section out and the rest of the script worked fine, other than one small edit I had to make (see separate comment for this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is probably incorrect. It worked for me because I did not have the permission and this correctly caught that. But when you do have permission, it reports an error that basically says you can't do this.
Removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! This is working for me now. Thanks @parthchandra
Which issue does this PR close?
Part of #721