Update vars/publishArtifact.groovy

This commit is contained in:
khaled committed 2026-09-30 14:42:46 +00:00
1 parent 828b75ad7e
commit 205f935b3f
1 file changed
+4 -4
+4 -4
View File
@@ -6,13 +6,13 @@ def call(Map config = [:]) {
def path = config.path ?: error('publishArtifact: "path" is required')
def repo = config.repo ?: 'lab-generic-local'
def base = config.base ?: 'http://10.0.1.4:8082/artifactory'
container('build') {
container('maven') { // maven a curl nativement, pas python:3.12-slim
stage('Publish to Artifactory') {
withCredentials([string(credentialsId: 'artifactory-token', variable: 'ART_TOKEN')]) {
sh """
HTTP=\$(curl -s -o /tmp/resp.txt -w '%{http_code}' \
-H "Authorization: Bearer \${ART_TOKEN}" \
-T ${file} \
HTTP=\$(curl -s -o /tmp/resp.txt -w '%{http_code}' \\
-H "Authorization: Bearer \${ART_TOKEN}" \\
-T ${file} \\
${base}/${repo}/${path}/${file})
echo "Artifactory responded HTTP \${HTTP}"
cat /tmp/resp.txt