Rely on system configured environment variables
This commit is contained in:
parent
c1680486ce
commit
735a5c5fdb
|
@ -1,12 +1,6 @@
|
|||
pipeline {
|
||||
agent { dockerfile { dir 'example' } }
|
||||
|
||||
environment {
|
||||
AZURE_STORAGE_ACCOUNT = 'codevaletartifacts'
|
||||
AZURE_CONTAINER_NAME = 'jenkins'
|
||||
AZURE_ACCESS_KEY = credentials('azure-access-key')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Test') {
|
||||
steps {
|
||||
|
|
|
@ -16,8 +16,14 @@ def call(Map args) {
|
|||
String uploadScriptName = '__azure-upload.sh'
|
||||
String uploadScript = libraryResource 'io/codevalet/externalartifacts/upload-file-azure.sh'
|
||||
writeFile file: uploadScriptName, text: uploadScript
|
||||
String uploadedUrl = sh(script: "bash ${uploadScriptName} ${args.artifacts}",
|
||||
|
||||
String uploadedUrl
|
||||
withCredentials([string(credentialsId: 'azure-access-key',
|
||||
variable: 'AZURE_ACCESS_KEY')]) {
|
||||
|
||||
uploadedUrl = sh(script: "bash ${uploadScriptName} ${args.artifacts}",
|
||||
returnStdout: true).trim()
|
||||
}
|
||||
|
||||
if (uploadedUrl =~ /https\:\/\//) {
|
||||
/* if the output was a URL, generate our redirect file */
|
||||
|
|
Loading…
Reference in New Issue