-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds task builder using YAML configuration * adds simple S3 to Mongo task * adds documentation using `mdbook` and Github Pages (#7) * adds license in README.md (#8) by @0xnet
- Loading branch information
Showing
48 changed files
with
1,034 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
on: | ||
push: | ||
branches: [ "develop" ] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install latest mdbook | ||
run: | | ||
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
mkdir mdbook | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
echo `pwd`/mdbook >> $GITHUB_PATH | ||
- name: Build Book | ||
run: cd docs && mdbook build | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: 'docs/book' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v3 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"airgoodies-aws-s3-connection-name": "", | ||
"airgoodies-aws-s3-default-bucket": "" | ||
"${dag_id}.airgoodies-aws-s3-connection-name": "", | ||
"${dag_id}.airgoodies-aws-s3-default-bucket": "" | ||
} |
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
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,3 @@ | ||
{ | ||
"${dag_id}.airgoodies-dag-config-file-key": "" | ||
} |
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,40 @@ | ||
""" | ||
@author: Stavros Grigoriou | ||
@since: 0.0.4 | ||
""" | ||
|
||
|
||
class AirgoodiesCommand: | ||
""" | ||
Airgoodies Command class, contains the metadata and callable for an Airgoodies compatible command. | ||
""" | ||
from airflow.operators.python import PythonOperator | ||
from airflow import DAG | ||
|
||
_task_id: str | ||
_python_callable: callable | ||
_provide_context: bool = True | ||
|
||
def __init__(self, | ||
task_id: str, | ||
python_callable: callable, | ||
provide_context: bool = True): | ||
""" | ||
Command initializer. | ||
""" | ||
self._task_id = task_id | ||
self._python_callable = python_callable | ||
self._provide_context = provide_context | ||
|
||
def to_operator(self, dag=DAG) -> PythonOperator: | ||
""" | ||
Convert the command in to a PythonOperator usable by Apache Airflow. | ||
:return: A setup python operator. | ||
""" | ||
from airflow.operators.python import PythonOperator | ||
|
||
return PythonOperator(task_id=self._task_id, | ||
python_callable=self._python_callable, | ||
provide_context=self._provide_context, | ||
dag=dag) |
Oops, something went wrong.