Skip to content

Commit

Permalink
[CI] kind setup fails sometimes (elastic#21857)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 19, 2020
1 parent aef0ef0 commit 97415f3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,28 @@ def cloud(Map args = [:]) {

def k8sTest(Map args = [:]) {
def versions = args.versions
node(args.label) {
versions.each{ v ->
versions.each{ v ->
node(args.label) {
stage("${args.context} ${v}"){
withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.7.0", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){
withGithubNotify(context: "${args.context} ${v}") {
withBeatsEnv(archive: false, withModule: false) {
retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install kind", script: ".ci/scripts/install-kind.sh") }
retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install kubectl", script: ".ci/scripts/install-kubectl.sh") }
try {
sh(label: "Setup kind", script: ".ci/scripts/kind-setup.sh")
// Add some environmental resilience when setup does not work the very first time.
def i = 0
retryWithSleep(retries: 3, seconds: 5, backoff: true){
try {
sh(label: "Setup kind", script: ".ci/scripts/kind-setup.sh")
} catch(err) {
i++
sh(label: 'Delete cluster', script: 'kind delete cluster')
if (i > 2) {
error("Setup kind failed with error '${err.toString()}'")
}
}
}
sh(label: "Integration tests", script: "MODULE=kubernetes make -C metricbeat integration-tests")
sh(label: "Deploy to kubernetes",script: "make -C deploy/kubernetes test")
} finally {
Expand Down

0 comments on commit 97415f3

Please sign in to comment.