-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e488bc
commit 809f988
Showing
4 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
from pipelines.exemplo.nome_do_objetivo.flows import * # noqa | ||
from pipelines.exemplo.secrets.flows import * # noqa |
Empty file.
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,21 @@ | ||
# -*- coding: utf-8 -*- | ||
from prefect import Flow, Parameter | ||
from prefect.run_configs import KubernetesRun | ||
from prefect.storage import GCS | ||
|
||
from pipelines.constants import constants | ||
from pipelines.exemplo.secrets.tasks import print_secret, read_secret | ||
|
||
with Flow( | ||
name="rj-escritorio: Nome do objetivo - Descrição detalhada do objetivo", | ||
) as exemplo__secrets__print_flow: | ||
# Parameters | ||
secret_name = Parameter("secret_name", required=True) | ||
|
||
# Tasks | ||
secret_value = read_secret(secret_name=secret_name) | ||
print_secret(secret=secret_value) | ||
|
||
# Storage and run configs | ||
exemplo__secrets__print_flow.storage = GCS(constants.GCS_FLOWS_BUCKET.value) | ||
exemplo__secrets__print_flow.run_config = KubernetesRun(image=constants.DOCKER_IMAGE.value) |
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,14 @@ | ||
# -*- coding: utf-8 -*- | ||
from prefect import task | ||
from prefeitura_rio.pipelines_utils.infisical import get_secret | ||
from prefeitura_rio.pipelines_utils.logging import log | ||
|
||
|
||
@task | ||
def read_secret(secret_name): | ||
return get_secret(secret_name) | ||
|
||
|
||
@task | ||
def print_secret(secret): | ||
log(secret) |