Script Artifactory Configuration Jenkins

17 views
Skip to first unread message

Virginia Mesa

unread,
Apr 4, 2018, 6:55:06 AM4/4/18
to Jenkins Users

Good, I'm doing a groovy pipeline for an artifact upload to Artifactory. The project is NPM, and I know that for Gradle or Maven it is necessary to create a type instance:

def server = Artifactory.server(env.ARTIFACTORY_ID)
def rtGradle = Artifactory.newGradleBuild()

or

def server = Artifactory.server(env.ARTIFACTORY_ID)
def rtMaven = Artifactory.newMavenBuild()


I searched the internet, and for NPM I do not find anything like it. You know if it exists, or it would simply be like this:

def compilation_artifactory(String artifactorydirectory, String proyecto, String version){
def server = Artifactory.server(ARTIFACTORY_ID)

def uploadSpec = """{
"files": [
{
"pattern": "${proyecto}-${version}*.tgz",
"target": "${artifactorydirectory}/${proyecto}/",
}
]
}"""


def buildInfoUpload = server.upload spec: uploadSpec
return buildInfoUpload

}

Thanks!!!



Virginia Mesa

unread,
Apr 4, 2018, 7:03:22 AM4/4/18
to Jenkins Users

Hello again, thinking ... could it be that this instance is used to compile the project? Since I do that part in a separate method, I would not need it. Is this possible?
Reply all
Reply to author
Forward
0 new messages