This repository was archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…+ :docker:exec task as an example
- next_release
- (#88, #86)
1 parent
f4a5f6e
commit 9e0b99c
Showing
5 changed files
with
217 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from argparse import ArgumentParser | ||
from typing import List | ||
|
||
from rkd.core.api.contract import TaskInterface, ExecutionContext | ||
from rkd.core.api.lifecycle import ConfigurationLifecycleEventAware | ||
from rkd.core.api.syntax import TaskDeclaration | ||
from rkd.core.execution.lifecycle import ConfigurationLifecycleEvent | ||
|
||
|
||
class RunInContainerTask(TaskInterface, ConfigurationLifecycleEventAware): | ||
""" | ||
Runs a command inside a container | ||
""" | ||
|
||
docker_image: str | ||
|
||
def get_configuration_attributes(self) -> List[str]: | ||
return [ | ||
'docker_image' | ||
] | ||
|
||
def configure(self, event: ConfigurationLifecycleEvent) -> None: | ||
self.docker_image = 'test' | ||
|
||
print('!!!', self.docker_image) | ||
print('???', self) | ||
|
||
print(self.get_name()) | ||
|
||
def get_name(self) -> str: | ||
return ':exec' | ||
|
||
def get_group_name(self) -> str: | ||
return ':docker' | ||
|
||
def execute(self, context: ExecutionContext) -> bool: | ||
return True | ||
|
||
def configure_argparse(self, parser: ArgumentParser): | ||
pass | ||
|
||
|
||
def imports() -> list: | ||
return [ | ||
TaskDeclaration(RunInContainerTask(), internal=True) | ||
] |