forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
component_opensearch_dashboards_min.py
41 lines (33 loc) · 1.23 KB
/
component_opensearch_dashboards_min.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
36
37
38
39
40
41
# 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.
import os
from git.git_repository import GitRepository
from manifests_workflow.component import Component
from system.config_file import ConfigFile
class ComponentOpenSearchDashboardsMin(Component):
def __init__(self, repo, snapshot=False):
super().__init__("OpenSearch-Dashboards", repo, snapshot, [])
@classmethod
def branches(self):
return Component.branches("https://github.com/opensearch-project/OpenSearch-Dashboards.git")
@classmethod
def checkout(self, path, branch="main", snapshot=False):
with GitRepository(
"https://github.com/opensearch-project/OpenSearch-Dashboards.git",
branch,
path,
) as repo:
return ComponentOpenSearchDashboardsMin(
repo,
snapshot,
)
@property
def properties(self):
path = os.path.join(self.git_repo.working_directory, "package.json")
return ConfigFile.from_file(path)
@property
def version(self):
return self.properties.get_value("version")