Skip to content

Commit

Permalink
Merge pull request #62 from rgdoliveira/sync_main
Browse files Browse the repository at this point in the history
Sync main branch with Apache main branch
  • Loading branch information
rgdoliveira authored Oct 25, 2024
2 parents e534438 + ae77a7f commit aedaeeb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Apache KIE
Copyright 2023 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

The Initial Developer of some parts of the framework, which are copied from, derived from, or
inspired by KIE (Knowledge Is Everthing) group, is Red Hat, Inc (https://www.redhat.com/).
Copyright Red Hat, Inc. and/or its affiliates.. All Rights Reserved.
13 changes: 13 additions & 0 deletions scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,19 @@ def update_maven_repo_in_setup_maven(repo_url, replace_default_repository):
replacement = 'export MAVEN_REPO_URL="{}"'.format(repo_url)
update_in_file(SETUP_MAVEN_SCRIPT, pattern, replacement)

def update_maven_repos_in_setup_maven(repos_url):
"""
Update maven repositories into setup-maven.sh script
:param repos_url: Maven repositories urls
"""
repo_list = repos_url.split(',')
print("Set maven repos {} in setup-maven script".format(repo_list))
pattern = re.compile(r'(# export MAVEN_REPO_URL=.*)')
replacement = f"export MAVEN_REPOS={','.join(['REPO_' + str(i) for i, _ in enumerate(repo_list)])}\n"
for i, value in enumerate(repo_list):
replacement += f"export REPO_{i}_MAVEN_REPO_URL={value}\n"
update_in_file(SETUP_MAVEN_SCRIPT, pattern, replacement)

def update_env_value(env_name, env_value):
"""
Update environment value into the given yaml module/image file
Expand Down
4 changes: 4 additions & 0 deletions scripts/update-repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Update Maven information in repo from the given artifact url and '
'version.')
parser.add_argument('--repo-urls', dest='repo_urls', help='Defines the urls of the repositories to setup maven, comma (,) separated')
parser.add_argument('--repo-url', dest='repo_url', help='Defines the url of the repository to setup into the tests')
parser.add_argument('--replace-default-repo', dest='replace_default_repo', default=False, action='store_true',
help='Enable if repo-url should replace the default repository')
Expand All @@ -53,6 +54,9 @@
parser.add_argument('--tests-only', dest='tests_only', default=False, action='store_true', help='Update product modules/images')
args = parser.parse_args()

if args.repo_urls:
common.update_maven_repos_in_setup_maven(args.repo_urls)

if args.repo_url:
common.update_maven_repo_in_build_config(args.repo_url, args.replace_default_repo)
common.update_maven_repo_in_setup_maven(args.repo_url, args.replace_default_repo)
Expand Down

0 comments on commit aedaeeb

Please sign in to comment.