I’m working on a Jenkins pipeline whose goal is to zip a folder named “spots” and push to the nexus repository
Here is the step i’m using to zip and push the zip file
stage('Zip and push files'){
script {
sh '''
cd src/main/resources
zip spots-$VERSION.zip spots
ls -al
zipinfo spots-$VERSION.zip
'''
}
nexusArtifactUploader(
nexusVersion: 'nexus3',
protocol: 'https',
nexusUrl: 'myNexusUrl',
groupId: 'QA',
version: "$VERSION",
credentialsId: "nexus3",
repository: 'maven-releases',
artifacts: [
[artifactId: 'spots-artifact',
classifier: '',
file: 'src/main/resources/spots-$VERSION.zip',
type: 'zip']
]
)
}
But after pushing to the nexus, the folder included in the zip is empty. The zip does not contain the expected file.
Is there anything missing in my script please?
Thanks a lot.