I'm working on a small script to take some variables, packageName, newVersion. I've googled and tried an awful lot and it brings me to asking.
The script executes as: updatePackage.sh -p weblogic-pkg-1 -v 2.0.1-B3
This reads yaml:
## Weblogic Deployment
'weblogic-pkg-1':
ensure: 'present'
deploymenttype: 'AppDeployment'
versionidentifier: '2.0.0-B2'
timeout: 60
stagingmode: "nostage"
remote: "1"
upload: "1"
target:
- "%{hiera('package_clustername')}"
targettype:
- 'Cluster'
localpath: '/opt/releases/staging/applications/weblogic-pkg-1/weblogic-pkg-1-2.0.0-B2.war'
I am trying to get the script to change the version number once it has matched the package, so the desired output is:
## Weblogic Deployment
'weblogic-pkg-1':
ensure: 'present'
deploymenttype: 'AppDeployment'
versionidentifier: '2.0.1-B3'
timeout: 60
stagingmode: "nostage"
remote: "1"
upload: "1"
target:
- "%{hiera('package_clustername')}"
targettype:
- 'Cluster'
localpath: '/opt/releases/staging/applications/weblogic-pkg-1/weblogic-pkg-1-2.0.1-B3.war'
The YAML file has about 50 packages so I cannot just sed /version/newVersion sadly. The system is also pretty locked down so adding a yaml parser to the OS might be tricky.
Any tips?
Thanks
Dave