forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci_check_gradle_properties.py
35 lines (29 loc) · 1.28 KB
/
ci_check_gradle_properties.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
from typing import Any
from ci_workflow.ci_check import CiCheckSource
from ci_workflow.ci_target import CiTarget
from git.git_repository import GitRepository
from manifests.input_manifest import Component
from system.properties_file import PropertiesFile
class CiCheckGradleProperties(CiCheckSource):
def __init__(self, component: Component, git_repo: GitRepository, target: CiTarget, args: Any = None) -> None:
super().__init__(component, git_repo, target, args)
self.properties = self.__get_properties()
def __get_properties(self) -> PropertiesFile:
cmd = " ".join(
filter(
None,
[
"./gradlew properties",
f"-Dopensearch.version={self.target.opensearch_version}",
f"-Dbuild.snapshot={str(self.target.snapshot).lower()}",
f"-Dbuild.version_qualifier={str(self.target.qualifier)}" if self.target.qualifier else None,
]
)
)
return PropertiesFile(self.git_repo.output(cmd))