Skip to content

rtPublishBuildInfo does not associate all artifacts created in parallel build stages #754

Open

Description

Describe the bug
When using Jenkins declarative pipeline that has parallel stages, where each parallel stage deploys an artifact using rtUpload, only one of the deployed artifacts will be associated with the build info when calling rtPublishBuildInfo instead of all the artifacts uploaded by the job.

To Reproduce
Create a pipeline job with the following:

pipeline {
    agent { label "myagent" }

    stages {
        stage('parallel-build') {
            parallel {
                stage('build artifact 1') {
                    steps {
                        script {
                            def date = new Date()
                            def data = "Hello World\nSecond line\n" + date
                            writeFile(file: 'boogy1.txt', text: data)
                        }
                        rtUpload (
                            serverId: 'Artifactory-1',
                            spec: '''{
                                "files": [
                                    {
                                    "pattern": "boogy1.txt",
                                    "target": "myrepo/boogy1.txt"
                                    }
                                ]
                            }'''
                        )
                    }
                }

                stage('build artifact 2') {
                    steps {
                        script {
                            def date = new Date()
                            def data = "Hello World\nSecond line\n" + date
                            writeFile(file: 'boogy2.txt', text: data)
                        }
                        rtUpload (
                            serverId: 'Artifactory-1',
                            spec: '''{
                                "files": [
                                    {
                                    "pattern": "boogy2.txt",
                                    "target": "myrepo/boogy2.txt"
                                    }
                                ]
                            }'''
                        )
                    }
                }
            }

        }

        stage('publish info') {
            steps {
                rtPublishBuildInfo (
                    serverId: 'Artifactory-1'
                )
            }
        }
    }
}

Expected behavior
Artifactory build info for the build should contain all artifacts uploaded via rtUpload during the job.

Versions

  • Jenkins Artifactory plugin version: 3.18.0
  • Jenkins version : 2.361.2
  • Jenkins operating system: Ubuntu 20.04
  • Artifactory Version: 7.49.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions