Update pom.xml
This plugins adds Jenkins pipeline steps to interact with the HuaweiCloud API.
git clone https://github.com/huaweicloud/pipeline-huaweicloud-plugin cd pipeline-huaweicloud-plugin mvn package -DskipTests
Install pipeline-huaweicloud-plugin/target/pipeline-huaweicloud.hpi in jenkins (such as: http://127.0.0.1/pluginManager/advanced)
the withOBS step provides authorization for the nested steps.
withOBS
Set region, endpointUrl, credentials information:
withOBS(endpointUrl:"https://obs.cn-north-1.myhuaweicloud.com",region:'cn-north-1',credentials:'ZJTEST') { // do something }
When you use Jenkins Declarative Pipelines you can also use withOBS in an options block:
options { withOBS(endpointUrl:"https://obs.cn-north-1.myhuaweicloud.com",region:'cn-north-1',credentials:'ZJTEST') } stages { ... }
Upload a file from the workspace (or a String) to an OBS bucket.
options { withOBS(endpointUrl:"https://obs.cn-north-1.myhuaweicloud.com",region:'cn-north-1',credentials:'ZJTEST') } steps { obsUpload(file:'ploaded5959630964693432219.jpi', bucket:'obs-test', path:'/') }
Invoke a function.
The step returns the object returned by the function.
steps { script { def result = invokeFunction(functionName: 'test002', payloadAsString: '{"key": "value"}') echo "Testing the ${result} browser" } }
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
pipeline-huaweicloud-plugin
This plugins adds Jenkins pipeline steps to interact with the HuaweiCloud API.
How to build it
Install pipeline-huaweicloud-plugin/target/pipeline-huaweicloud.hpi in jenkins (such as: http://127.0.0.1/pluginManager/advanced)
Usage / Steps
withOBS
the
withOBSstep provides authorization for the nested steps.Set region, endpointUrl, credentials information:
When you use Jenkins Declarative Pipelines you can also use
withOBSin an options block:obsUpload
Upload a file from the workspace (or a String) to an OBS bucket.
invokeFunction
Invoke a function.
The step returns the object returned by the function.