Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7531a6bb4c |
No files matched your search
@@ -5,6 +5,12 @@ description: >
|
||||
- Deploys signed artifacts and waits for confirmed Central release publication
|
||||
- Saves Maven cache for future builds
|
||||
|
||||
parameters:
|
||||
skip_verified_analysis:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Skip repeated SpotBugs and PMD only after this job has completed mvn_verify"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Setup Maven Settings
|
||||
@@ -17,6 +23,8 @@ steps:
|
||||
# Central's native publication wait can be silent for its 30-minute limit.
|
||||
# Let Maven return its real result before CircleCI's inactivity watchdog.
|
||||
no_output_timeout: 35m
|
||||
environment:
|
||||
QQQ_SKIP_VERIFIED_ANALYSIS: << parameters.skip_verified_analysis >>
|
||||
command: <<include(scripts/mvn_jar_deploy.sh)>>
|
||||
- save_cache:
|
||||
paths:
|
||||
|
||||
@@ -57,7 +57,8 @@ steps:
|
||||
steps:
|
||||
- check_middleware_api_versions
|
||||
|
||||
- mvn_jar_deploy
|
||||
- mvn_jar_deploy:
|
||||
skip_verified_analysis: true
|
||||
|
||||
- when:
|
||||
condition:
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
|
||||
set -e
|
||||
|
||||
# The shared publish job already ran these checks in its verify lifecycle.
|
||||
# Standalone command callers retain analysis unless explicitly opted in.
|
||||
analysis_args=()
|
||||
if [[ "${QQQ_SKIP_VERIFIED_ANALYSIS:-false}" == "true" ]]; then
|
||||
analysis_args=(-Dspotbugs.skip=true -Dpmd.skip=true)
|
||||
fi
|
||||
|
||||
##############################################
|
||||
## Deploy signed artifacts to Maven Central ##
|
||||
##############################################
|
||||
@@ -30,6 +37,7 @@ set -e
|
||||
# Central 0.8.x: this completion flag overrides inherited literal waitUntil=uploaded.
|
||||
# Do not report a release as successful until Central confirms publication.
|
||||
mvn -s /tmp/circleci/mvn-settings.xml -P release -B -DskipTests \
|
||||
"${analysis_args[@]}" \
|
||||
-Dgpg.keyname="$GPG_KEYNAME" -Dgpg.passphrase="$GPG_PASSPHRASE" \
|
||||
-DwaitForPublishCompletion=true \
|
||||
-Dflatten.mode=resolveCiFriendliesOnly -DupdatePomFile=true \
|
||||
|
||||
@@ -43,7 +43,7 @@ class MavenCiContract(unittest.TestCase):
|
||||
self.assertIs(job["parameters"]["notify_rc_published"]["default"], False)
|
||||
self.assertIs(read("src/commands/git_operations.yml")["parameters"]["require_pushed_version"]["default"], False)
|
||||
steps = job["steps"]
|
||||
deploy = steps.index("mvn_jar_deploy")
|
||||
deploy = next(i for i, s in enumerate(steps) if isinstance(s, dict) and "mvn_jar_deploy" in s)
|
||||
pushed = next(i for i, s in enumerate(steps) if "git_operations" in str(s))
|
||||
dispatch = next(i for i, s in enumerate(steps) if "notify_rc_published.sh" in str(s))
|
||||
self.assertLess(deploy, pushed)
|
||||
@@ -57,6 +57,8 @@ class MavenCiContract(unittest.TestCase):
|
||||
return next(i for i, s in enumerate(steps) if s == name or isinstance(s, dict) and name in s)
|
||||
self.assertLess(position("mvn_manage_version"), position("mvn_verify"))
|
||||
self.assertLess(position("mvn_verify"), position("mvn_jar_deploy"))
|
||||
self.assertEqual(steps[position("mvn_jar_deploy")], {"mvn_jar_deploy": {"skip_verified_analysis": True}})
|
||||
self.assertIs(read("src/commands/mvn_jar_deploy.yml")["parameters"]["skip_verified_analysis"]["default"], False)
|
||||
self.assertTrue(any("check_middleware_api_versions" in str(s) for s in steps[position("mvn_verify") + 1:position("mvn_jar_deploy")]))
|
||||
deploy = (ROOT / "src/scripts/mvn_jar_deploy.sh").read_text()
|
||||
self.assertIn("-P release", deploy)
|
||||
|
||||
@@ -56,13 +56,22 @@ org.codehaus.mojo:flatten-maven-plugin:1.7.3:flatten
|
||||
deploy
|
||||
EOF
|
||||
diff -u "$test_dir/expected-args" "$test_dir/mvn-args"
|
||||
# The verified publishing job skips only duplicate analysis. Every signing,
|
||||
# flattening and publication argument must remain identical to the default.
|
||||
PATH="$test_dir/bin:$PATH" TEST_MVN_ARGS="$test_dir/verified-args" \
|
||||
GPG_KEYNAME=test-key GPG_PASSPHRASE=test-passphrase QQQ_SKIP_VERIFIED_ANALYSIS=true \
|
||||
bash "$test_dir/deploy.sh" > "$test_dir/verified-output" 2>&1
|
||||
grep -Fxq -- '-Dspotbugs.skip=true' "$test_dir/verified-args"
|
||||
grep -Fxq -- '-Dpmd.skip=true' "$test_dir/verified-args"
|
||||
grep -Fxv -e '-Dspotbugs.skip=true' -e '-Dpmd.skip=true' "$test_dir/verified-args" > "$test_dir/verified-common-args"
|
||||
diff -u "$test_dir/expected-args" "$test_dir/verified-common-args"
|
||||
# A Central validation failure or publication timeout must fail this wrapper.
|
||||
cat > "$test_dir/bin/mvn" <<'EOF'
|
||||
#!/bin/bash
|
||||
exit 42
|
||||
EOF
|
||||
set +e
|
||||
PATH="$test_dir/bin:$PATH" GPG_KEYNAME=test-key GPG_PASSPHRASE=test-passphrase \
|
||||
PATH="$test_dir/bin:$PATH" GPG_KEYNAME=test-key GPG_PASSPHRASE=test-passphrase QQQ_SKIP_VERIFIED_ANALYSIS=true \
|
||||
bash "$test_dir/deploy.sh" > "$test_dir/failure-output" 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
|
||||
Reference in new issue
Block a user