Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Version bumping script enhancements #524

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions helpers/bumper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/usr/bin/env python2

#
# Usage:
# ./bumper.py
#
# Configurable environment variables:
# - BUMPER_VERSION_6 overrides the 6.x.x version.
# - BUMPER_VERSION_7 overrides the 7.x.x version.
# - BUMPER_USE_STAGING_IMAGES set to "true" causes the
# docker.elastic.co/staging/ docker registry namespace to be used.
#

import re
import os
import glob
Expand All @@ -7,13 +19,13 @@

os.chdir(os.path.join(os.path.dirname(__file__), ".."))

chart_version = "7.6.1"

versions = {
6: "6.8.7",
7: "7.6.1",
6: os.environ.get("BUMPER_VERSION_6", "6.8.7"),
7: os.environ.get("BUMPER_VERSION_7", "7.6.1"),
}

chart_version = versions[7]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we may have to release charts for 6.x also after GA release


file_patterns = [
"*/examples/*/test/goss*.y*ml",
"*/examples/*/*.y*ml",
Expand All @@ -40,3 +52,22 @@
print(r.sub(chart_version, line.rstrip()))
else:
print(r.sub(version, line.rstrip()))

if os.environ.get("BUMPER_USE_STAGING_IMAGES") == "true":
image_file_patterns = file_patterns + [
"*/tests/*.py",
"**/templates/*.tpl",
"**/Makefile",
]

for pattern in image_file_patterns:
for f in glob.glob(pattern):
print(f)
for line in fileinput.input([f], inplace=True):
print(
re.sub(
r"docker.elastic.co/.+/",
"docker.elastic.co/staging/",
line.rstrip(),
)
)