Open lvw5264 opened 5 years ago
We ran into the same issue. We divided our systems into patching units and the first unit gets patches from the current month ad the second unit gets patches from last month. There are additional LCEs around (for testing, different states and so on), but I'd say they can be ignored in this case.
We keep two cvmanager configurations:
current month example:
---
:settings:
...
:ccv:
ccv-lin-7:
cv-lin-7-os: 150.0
cv-lin-7-base: 162.0
:promote:
- ccv-lin-7
last month example:
---
:settings:
...
:ccv:
ccv-lin-7:
cv-lin-7-os: 139.0
cv-lin-7-base: 136.0
:promote:
- ccv-lin-7
To make your proposal work, this requires an additional cv
hash:
...
:cv:
ccv-lin-7: 12.0
...
This example worked in a test. Nice would be to auto-detect the CCV version ID based on the configured CV version IDs (if not present the CCV it would be necessary to publish a new CCV anyway).
We do incremental CV updates from time to time (if a critical patch needs to find its way to an existing view) which increment the CCVs as well. This is more a topic of updating the config (e.g. ccv-lin-7: 12.1
) but should be kept in mind when testing this feature.
@lvw5264 can you create a pull request with your code? This would simplify comments on particular lines of code.
I had a use case where we don't use composite content views, yet I wanted the
promote
command to use the content view version I defined. However, for some reason thepromote
command always uses the latest and does not check for the version the user defined in:cv:
under YAML at all.I suggest a solution in the code below, allowing the user specified version in YAML to be used, as well as latest. since I just hacked this together by combining aspects of the
update()
function, I will just paste thepromote()
function I made.Also when the request in promote() gave a 400 bad request, as the exception was not handled, so I added a
rescue
statement, which now helpfully tells the command line user that they "Cannot promote environment out of sequence. Use force to bypass restriction.".The YAML I use, where i have Library.yaml , dev.yaml (always kept up to date with Library), test.yaml, prod.yaml.
The promote() function: