blob: 969f956814b6efb9c741c4453f8e406f4ff6ec62 [file]
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
import sys as _sys
from util import *
template = \
"""
---
version: {version}
release_date: {date_string}
title: Artemis {version}
shortDescription: Bug fix release.
# Docs subdir name for past-releases and previous-docs pages, 'latest' is always used on the main download page.
docs_version: {version}
java_version: 17+
---
"""
def create_release_file(version):
padded_components = [component.zfill(2) for component in version.split(".")]
if len(padded_components) < 3:
exit("Version ({}) must have 3 components to pad, but only have: {}".format(version, str(padded_components)))
padded_version = "-".join(padded_components)
output_path = "src/_artemis_releases/artemis-{}.md".format(padded_version)
date_string = get_date_string()
output = template.format(**locals())
output = output.strip()
write_utf8(output_path, output)
return output_path
ARGS = _sys.argv
if len(ARGS) < 2:
exit("Usage: ./scripts/release/create-artemis-release-file <version>")
version = ARGS[1]
release_file = create_release_file(version)
print("Release file generated at {}".format(release_file))