Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Rely on system configured environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Tyler Croy committed Jan 4, 2018
1 parent c168048 commit 735a5c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 0 additions & 6 deletions example/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion vars/archiveArtifacts.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 735a5c5

Please sign in to comment.