Skip to content

Commit febc85c

Browse files
Merge pull request #252 from splunk/fix-jenkins-build
add teardown in jenkins file
2 parents 065beae + c30ed32 commit febc85c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ci/Jenkinsfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,23 @@ withSplunkWrapNode("master") {
6464
echo "Stack Trace: ${e.printStackTrace()}";
6565
}
6666
finally {
67+
println "=============delete splunk cloud stack=============="
68+
splunkCopyFromDocker files: "ci/stack_id",
69+
imageName: imageName,
70+
remotePath: "/build/kafka-connect-splunk";
71+
archiveArtifacts allowEmptyArchive: true, artifacts: "target/stack_id";
72+
withCredentials([file(credentialsId: 'gdi_connectors_orca', variable: 'ORCA_CREDENTIALS')]) {
73+
sh '''#!/bin/bash
74+
tar -ovxf $ORCA_CREDENTIALS
75+
mkdir -p ~/.orca
76+
cp -r .orca/* ~/.orca
77+
chmod 600 ~/.orca/*id_rsa
78+
chown -R 10777 ~/.orca
79+
pip install splunk_orca==1.1.0 -i https://repo.splunk.com/artifactory/api/pypi/pypi/simple --upgrade
80+
stack_id=`cat target/stack_id`
81+
python -m splunk_orca --cloud cloudworks destroy $stack_id
82+
'''
83+
}
6784
steps.cleanWs();
6885
}
6986
}

ci/splunk_cloud_ci.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ sed -i "s/splunk_hec_url: https:\/\/127.0.0.1:8088/splunk_hec_url: https:\/\/$CI
1313
sed -i "s/splunk_password: helloworld/splunk_password: ${CI_SPLUNK_PASSWORD}/g" /build/kafka-connect-splunk/test/config.yaml
1414

1515
cp /build/kafka-connect-splunk/test/config.yaml /build/kafka-connect-splunk/ci/config.yaml
16+
echo "${STACK_ID}" > /build/kafka-connect-splunk/ci/stack_id

0 commit comments

Comments
 (0)