Skip to content

Commit

Permalink
Fix Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bhapas committed Jul 14, 2023
1 parent de5c3a9 commit 18f5916
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -591,25 +591,26 @@ def targetWithoutNode(Map args = [:]) {
def enableRetry = args.get('enableRetry', false)
def withGCP = args.get('withGCP', false)
def withNodejs = args.get('withNodejs', false)
String name = normalise("${directory}")
String name = normalise(args.directory)
withGithubNotify(context: "${context}") {
withBeatsEnv(archive: true, withModule: withModule, directory: directory, id: args.id) {
dumpVariables()
withTools(k8s: installK8s, gcp: withGCP, nodejs: withNodejs) {
// make commands use -C <folder> while mage commands require the dir(folder)
// let's support this scenario with the location variable.
echo "terraform-${name}"
dir(isMage ? directory : '') {
if (enableRetry) {
// unstash in the same directory where the files were stashed
dir('input/awss3/_meta/terraform'){
echo "terraform-${name}"
try {
unstash(name: "terraform-${name}")
sh "ls -la ${pwd()}"
} catch (error) {
echo "error unstashing: ${error}"
}
// unstash in the same directory where the files were stashed
dir('input/awss3/_meta/terraform'){
echo "terraform-${name}"
try {
unstash("terraform-${name}")
sh "ls -la ${pwd()}"
} catch (error) {
echo "error unstashing: ${error}"
}
}
if (enableRetry) {
// Retry the same command to bypass any kind of flakiness.
// Downside: genuine failures will be repeated.
retry(3) {
Expand Down

0 comments on commit 18f5916

Please sign in to comment.