[DO-273] shared libs update (#12)
Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/12 Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Co-committed-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech>
This commit is contained in:
committed by
Aleksandr Vodyanov
parent
5642ea8b96
commit
bc24016ef4
@@ -96,6 +96,30 @@ class Nexus implements Serializable {
|
||||
return urls
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Download artifact from Nexus repo
|
||||
*
|
||||
@param url String - URL, откуда будет скачан файл
|
||||
@param outputFile String - Путь с именем файла, по которому будет сохранен(optional).
|
||||
* По умолчанию с именем сохраняется в текущей директории с именем файла
|
||||
@return Srting - Возвращает имя загруженного файла
|
||||
*/
|
||||
String download(String url, String outputFile = '') {
|
||||
String artifactName = url.split('/').last()
|
||||
String artifact = outputFile ?: "${this.script.pwd()}/${artifactName}"
|
||||
|
||||
this.script.httpRequest(
|
||||
url: url,
|
||||
authentication: this.credentials,
|
||||
httpMode: "GET",
|
||||
quiet: true,
|
||||
outputFile: artifact
|
||||
)
|
||||
|
||||
return artifact
|
||||
}
|
||||
|
||||
/**
|
||||
* Method get artifact's info from nexus
|
||||
@param repository String - Repository name in Nexus.
|
||||
|
||||
Reference in New Issue
Block a user