mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +02:00
with #3875 temp directory was created in current workspace. This had negative side-effects: For example npm build packaged and published temporary files Co-authored-by: Anil Keshav <anil.keshav@sap.com>
This commit is contained in:
parent
a610e1df6a
commit
73f7d61743
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/SAP/jenkins-library/pkg/config/interpolation"
|
"github.com/SAP/jenkins-library/pkg/config/interpolation"
|
||||||
"github.com/SAP/jenkins-library/pkg/log"
|
"github.com/SAP/jenkins-library/pkg/log"
|
||||||
CredentialUtils "github.com/SAP/jenkins-library/pkg/piperutils"
|
"github.com/SAP/jenkins-library/pkg/piperutils"
|
||||||
"github.com/SAP/jenkins-library/pkg/vault"
|
"github.com/SAP/jenkins-library/pkg/vault"
|
||||||
"github.com/hashicorp/vault/api"
|
"github.com/hashicorp/vault/api"
|
||||||
)
|
)
|
||||||
@ -285,7 +285,7 @@ func populateCredentialsAsEnvs(config *StepConfig, secret map[string]string, key
|
|||||||
os.Setenv(envVariable, secretValue)
|
os.Setenv(envVariable, secretValue)
|
||||||
envVariable = vaultCredentialEnvPrefix + convertEnvVar(secretKey) + "_BASE64"
|
envVariable = vaultCredentialEnvPrefix + convertEnvVar(secretKey) + "_BASE64"
|
||||||
log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable)
|
log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable)
|
||||||
os.Setenv(envVariable, CredentialUtils.EncodeString(secretValue))
|
os.Setenv(envVariable, piperutils.EncodeString(secretValue))
|
||||||
matched = true
|
matched = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -303,7 +303,7 @@ func populateCredentialsAsEnvs(config *StepConfig, secret map[string]string, key
|
|||||||
os.Setenv(envVariable, secretValue)
|
os.Setenv(envVariable, secretValue)
|
||||||
envVariable = vaultCredentialEnvPrefixDefault + convertEnvVar(secretKey) + "_BASE64"
|
envVariable = vaultCredentialEnvPrefixDefault + convertEnvVar(secretKey) + "_BASE64"
|
||||||
log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable)
|
log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable)
|
||||||
os.Setenv(envVariable, CredentialUtils.EncodeString(secretValue))
|
os.Setenv(envVariable, piperutils.EncodeString(secretValue))
|
||||||
matched = true
|
matched = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -369,7 +369,8 @@ func RemoveVaultSecretFiles() {
|
|||||||
func createTemporarySecretFile(namePattern string, content string) (string, error) {
|
func createTemporarySecretFile(namePattern string, content string) (string, error) {
|
||||||
if VaultSecretFileDirectory == "" {
|
if VaultSecretFileDirectory == "" {
|
||||||
var err error
|
var err error
|
||||||
VaultSecretFileDirectory, err = ioutil.TempDir(".", "vault")
|
fileUtils := &piperutils.Files{}
|
||||||
|
VaultSecretFileDirectory, err = fileUtils.TempDir("", "vault")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user