Skip to content

Commit

Permalink
feat: fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss committed Sep 24, 2024
1 parent 0e8107d commit 9130478
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
7 changes: 7 additions & 0 deletions integration/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ pipeline {
zip -r native_logs.zip /var/log/harvest
'''
archiveArtifacts artifacts: "native_logs.zip", fingerprint: true

withCredentials([string(credentialsId: 'PROMETHEUS_URL', variable: 'PROMETHEUS_URL')]) {
sh '''
cd /opt/harvest
bin/harvest generate metrics --poller dc1 --config /u/mpeg/harvest/harvest.yml --prom-url $PROMETHEUS_URL
'''
}
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions jenkins/artifacts/jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,7 @@ pipeline {
stage('Test and Generate Harvest Metrics') {
steps {
script {
def promUrlParam = ""
if (params.RUN_TEST == 'true') {
withCredentials([string(credentialsId: 'PROMETHEUS_URL', variable: 'PROMETHEUS_URL')]) {
promUrlParam = "--prom-url $PROMETHEUS_URL"
}
}
def result = sh(script: """
export VERSION=$VERSION
bin/harvest generate metrics --poller dc1 --config /u/mpeg/harvest/harvest.yml ${promUrlParam}
""", returnStatus: true)
def result = sh(script: 'bin/harvest generate metrics --poller dc1 --config /u/mpeg/harvest/harvest.yml', returnStatus: true)
if (result != 0) {
error("Generate Harvest metrics command failed.")
}
Expand Down

0 comments on commit 9130478

Please sign in to comment.