Update vars/publishArtifact.groovy
This commit is contained in:
1 parent
828b75ad7e
commit
205f935b3f
1 file changed
+4
-4
@@ -6,13 +6,13 @@ def call(Map config = [:]) {
|
|||||||
def path = config.path ?: error('publishArtifact: "path" is required')
|
def path = config.path ?: error('publishArtifact: "path" is required')
|
||||||
def repo = config.repo ?: 'lab-generic-local'
|
def repo = config.repo ?: 'lab-generic-local'
|
||||||
def base = config.base ?: 'http://10.0.1.4:8082/artifactory'
|
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') {
|
stage('Publish to Artifactory') {
|
||||||
withCredentials([string(credentialsId: 'artifactory-token', variable: 'ART_TOKEN')]) {
|
withCredentials([string(credentialsId: 'artifactory-token', variable: 'ART_TOKEN')]) {
|
||||||
sh """
|
sh """
|
||||||
HTTP=\$(curl -s -o /tmp/resp.txt -w '%{http_code}' \
|
HTTP=\$(curl -s -o /tmp/resp.txt -w '%{http_code}' \\
|
||||||
-H "Authorization: Bearer \${ART_TOKEN}" \
|
-H "Authorization: Bearer \${ART_TOKEN}" \\
|
||||||
-T ${file} \
|
-T ${file} \\
|
||||||
${base}/${repo}/${path}/${file})
|
${base}/${repo}/${path}/${file})
|
||||||
echo "Artifactory responded HTTP \${HTTP}"
|
echo "Artifactory responded HTTP \${HTTP}"
|
||||||
cat /tmp/resp.txt
|
cat /tmp/resp.txt
|
||||||
|
|||||||
Reference in new issue
Block a user