forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.py
35 lines (27 loc) · 933 Bytes
/
builder.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 abc import ABC, abstractmethod
from typing import Any
from build_workflow.build_recorder import BuildRecorder
from build_workflow.build_target import BuildTarget
class Builder(ABC):
component: Any
target: BuildTarget
output_path: str
def __init__(self, component: Any, target: BuildTarget) -> None:
self.output_path = "builds"
self.component = component
self.target = target
@abstractmethod
def checkout(self, work_dir: str) -> None:
pass
@abstractmethod
def build(self, build_recorder: BuildRecorder) -> None:
pass
@abstractmethod
def export_artifacts(self, build_recorder: BuildRecorder) -> None:
pass