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 5691dad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -591,25 +591,27 @@ 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()
// unstash terraform outputs in the same directory where the files were stashed
dirs?.each { folder ->
dir("${folder}") {
try {
unstash("terraform-${name}")
//unstash does not print verbose output , hence printing contents of the directory for logging purposes
sh "ls -la ${pwd()}"
} catch (error) {
echo "error unstashing: ${error}"
}
}
}
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.
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}"
}
}
// Retry the same command to bypass any kind of flakiness.
// Downside: genuine failures will be repeated.
retry(3) {
Expand Down Expand Up @@ -948,7 +950,7 @@ def startCloudTestEnv(Map args = [:]) {
// Archive terraform states in case manual cleanup is needed.
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/terraform.tfstate')
dir("${folder}") {
stash(name: "terraform-${name}", allowEmpty: true, includes: '**/terraform.tfstate,**/.terraform/**,*.yml')
stash(name: "terraform-${name}", allowEmpty: true, includes: '**/terraform.tfstate,**/.terraform/**,outputs*.yml')
}
}
}
Expand Down
1 change: 1 addition & 0 deletions x-pack/filebeat/input/awss3/input_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func makeTestConfigSQS(queueURL string) *conf.C {
queue_url: %s
max_number_of_messages: 1
visibility_timeout: 30s
region: us-east-1
file_selectors:
-
regex: 'events-array.json$'
Expand Down

0 comments on commit 5691dad

Please sign in to comment.