diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index f998d71..8eb2fba 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,4 +1,5 @@ -image: openjdk:8 +image: adoptopenjdk:8-openj9 +#image: openjdk:8 pipelines: branches: @@ -16,6 +17,7 @@ pipelines: - gradle name: Build and Release script: - - ./gradlew clean build shadowJar startShadowScripts buildRpm + - ./gradlew clean build shadowJar startShadowScripts buildRpm buildDeb + - ls -l ${BITBUCKET_CLONE_DIR}/build/distributions/ - for file in ${BITBUCKET_CLONE_DIR}/build/libs/*-all.jar ; do curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${file}" ; done - for file in ${BITBUCKET_CLONE_DIR}/build/distributions/*.rpm ; do curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${file}" ; done diff --git a/gradle.properties b/gradle.properties index 5bcf16f..1c6d240 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ group = biz.nellemann.hmci -version = 1.0.2 +version = 1.0.3 diff --git a/src/main/groovy/biz/nellemann/hmci/App.groovy b/src/main/groovy/biz/nellemann/hmci/App.groovy index 3ec8e4c..2779dbb 100644 --- a/src/main/groovy/biz/nellemann/hmci/App.groovy +++ b/src/main/groovy/biz/nellemann/hmci/App.groovy @@ -63,7 +63,6 @@ class App implements Runnable { hmcClient.logoff() hmcClient.login() - log.info("Logging in to HMC " + hmcId) try { hmcClient.getManagedSystems().each { systemId, system -> diff --git a/src/main/groovy/biz/nellemann/hmci/HmcClient.groovy b/src/main/groovy/biz/nellemann/hmci/HmcClient.groovy index c80edc4..50f9245 100644 --- a/src/main/groovy/biz/nellemann/hmci/HmcClient.groovy +++ b/src/main/groovy/biz/nellemann/hmci/HmcClient.groovy @@ -112,9 +112,8 @@ class HmcClient { Response response = client.newCall(request).execute(); if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); - this.authToken = null + authToken = null log.debug("logoff()") - } diff --git a/src/main/groovy/biz/nellemann/hmci/InfluxClient.groovy b/src/main/groovy/biz/nellemann/hmci/InfluxClient.groovy index 5135734..2d6d917 100644 --- a/src/main/groovy/biz/nellemann/hmci/InfluxClient.groovy +++ b/src/main/groovy/biz/nellemann/hmci/InfluxClient.groovy @@ -52,6 +52,7 @@ class InfluxClient { void logoff() { influxDB?.close(); + influxDB = null } @@ -73,7 +74,13 @@ class InfluxClient { void writeBatchPoints() { log.debug("writeBatchPoints()") - influxDB.write(batchPoints); + try { + influxDB.write(batchPoints); + } catch(Exception e) { + log.error("writeBatchPoints() error", e) + logoff() + login() + } //influxDB.flush() }