@@ -218,62 +218,6 @@ default:
218218# Check and fail early if maven central credentials are incorrect. When a new token is generated
219219# on the central publisher portal, it invalidates the old one. This check prevents going further.
220220# See https://datadoghq.atlassian.net/wiki/x/Oog5OgE
221- check-maven-proxy-artifact :
222- image : ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}base
223- stage : .pre
224- rules :
225- - when : on_success
226- script :
227- - |
228- check_jar() {
229- local label="$1" file="$2"
230- echo "--- Checking: ${label} ---"
231- local size
232- size=$(wc -c < "${file}")
233- echo "File size: ${size} bytes"
234- if [ "${size}" -eq 0 ]; then
235- echo "ERROR: file is empty"
236- return 1
237- fi
238- local magic
239- magic=$(head -c 4 "${file}" | od -A n -t x1 | tr -d ' \n')
240- local type
241- type=$(file "${file}")
242- echo "File magic bytes: ${magic} | file: ${type}"
243- if [ "${magic}" = "504b0304" ]; then
244- echo "OK: valid JAR/ZIP magic bytes"
245- else
246- echo "ERROR: not a valid JAR/ZIP file (expected 504b0304, got ${magic})"
247- if echo "${type}" | grep -qi "xml\|html\|text"; then
248- echo "--- File content ---"
249- cat "${file}"
250- echo "--- End of content ---"
251- fi
252- return 1
253- fi
254- }
255-
256- RESULT=0
257- for VERSION in 1.1.0 1.2.0 1.2.1; do
258- ARTIFACT_PATH="org/tabletest/tabletest-junit/${VERSION}/tabletest-junit-${VERSION}.jar"
259- echo "=== Version ${VERSION}: Downloading from Magic Mirror proxy ==="
260- curl --fail --location --silent --show-error --output "tabletest-junit-${VERSION}-proxy.jar" "${MAVEN_REPOSITORY_PROXY}${ARTIFACT_PATH}" \
261- && check_jar "proxy ${VERSION}" "tabletest-junit-${VERSION}-proxy.jar" \
262- || RESULT=1
263-
264- echo "=== Version ${VERSION}: Downloading from Maven Central ==="
265- curl --fail --location --silent --show-error --output "tabletest-junit-${VERSION}-central.jar" "https://repo1.maven.org/maven2/${ARTIFACT_PATH}" \
266- && check_jar "central ${VERSION}" "tabletest-junit-${VERSION}-central.jar" \
267- || RESULT=1
268- done
269-
270- exit $RESULT
271- artifacts :
272- when : always
273- paths :
274- - tabletest-junit-*-proxy.jar
275- - tabletest-junit-*-central.jar
276-
277221maven-central-pre-release-check :
278222 image : ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}base
279223 stage : .pre
0 commit comments