Skip to content

Commit 0c7e268

Browse files
committed
Create RKD structure
1 parent bdfe79e commit 0c7e268

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.rkd/logs
2+
*.pyc
3+
*__pycache__*
4+
/.venv
5+
.venv-setup.log

.rkd/makefile.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
import os
3+
from rkd.api.syntax import TaskAliasDeclaration as Task
4+
from rkd.api.syntax import TaskDeclaration
5+
from rkd.api.contract import ExecutionContext
6+
from rkd.standardlib import CallableTask
7+
8+
9+
# def create_union_task_as_method(context: ExecutionContext) -> bool:
10+
# os.system('xdg-open https://iwa-ait.org')
11+
# return True
12+
13+
14+
IMPORTS = []
15+
TASKS = []
16+
17+
#
18+
# # optionally, add a custom task written in pure Python
19+
# IMPORTS += [TaskDeclaration(CallableTask(':create-union', create_union_task_as_method))]
20+
#
21+
# # optionally, create own tasks that are using other tasks
22+
# TASKS = [
23+
# Task(':hello-world', [':sh', '-c', '''
24+
# set -x
25+
# MSG="Hello world"
26+
#
27+
# echo "${MSG}"
28+
# '''])
29+
# ]

.rkd/makefile.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: org.riotkit.rkd/yaml/v1
2+
imports: []
3+
tasks:
4+
:hello:
5+
description: Hello world task
6+
arguments:
7+
"--name":
8+
help: "Your name"
9+
required: True
10+
steps: |
11+
echo "Hello $ARG_NAME"
12+
13+
:hello:python:
14+
description: Hello world task
15+
arguments:
16+
"--name":
17+
help: "Your name"
18+
required: True
19+
steps: |
20+
#!python
21+
22+
# those two lines are optional (for your eyes and for IDE - you can also import those classes there)
23+
ctx: ExecutionContext
24+
this: TaskInterface
25+
26+
print('Hello %s' % ctx.get_arg('--name'))
27+
return True

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rkd==2.1.4

setup-venv.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if test -d .venv; then
5+
echo "source ./.venv/bin/activate"
6+
exit 0
7+
fi
8+
9+
virtualenv .venv
10+
source ./.venv/bin/activate
11+
pip install -r requirements.txt
12+
echo "source ./.venv/bin/activate"

0 commit comments

Comments
 (0)