ansible-role-elasticsearch/helpers/bumper.py
Yuriy 202676b121
7.9.0 release (#712)
* 7.9.0 as default version
* 6.8.12 as 6.x tested version
2020-08-18 10:32:49 -05:00

36 lines
697 B
Python
Executable file

#!/usr/bin/env python3
import fileinput
import os
"""
This script is used to bump elasticsearch versions before a new release
Usage:
- Change the values of `old_versions` and `new_versions``
- Run the script: `./bumper.py`
- That's all
"""
os.chdir(os.path.join(os.path.dirname(__file__), '..'))
old_versions = {
6: '6.8.11',
7: '7.8.1',
}
new_versions = {
6: '6.8.12',
7: '7.9.0',
}
files = [
'README.md',
'defaults/main.yml',
'.kitchen.yml',
]
for major, version in old_versions.items():
for file in files:
print(file)
for line in fileinput.input([file], inplace=True):
print(line.replace(version, new_versions[major]), end='')