Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/civitaspo/digdag-operator-param

digdag plugin for operating param
https://github.com/civitaspo/digdag-operator-param

Last synced: 3 months ago
JSON representation

digdag plugin for operating param

Awesome Lists containing this project

README

        

# digdag-operator-param
[![Jitpack](https://jitpack.io/v/pro.civitaspo/digdag-operator-param.svg)](https://jitpack.io/#pro.civitaspo/digdag-operator-param) [![CircleCI](https://circleci.com/gh/civitaspo/digdag-operator-param.svg?style=shield)](https://circleci.com/gh/civitaspo/digdag-operator-param) [![Digdag](https://img.shields.io/badge/digdag-v0.9.30-brightgreen.svg)](https://github.com/treasure-data/digdag/releases/tag/v0.9.30)

digdag plugin for operating params.

# Overview

- Plugin type: operator

# Usage

```yaml

_export:
plugin:
repositories:
- https://jitpack.io
dependencies:
- pro.civitaspo:digdag-operator-param:0.0.2

+show1:
echo>: "hoge: ${typeof(hoge) == 'undefined' ? 'None' : hoge}, a.b: ${typeof(a) == 'undefined' ? 'None' : typeof(a.b) == 'undefined' ? 'None' : a.b}"

+store:
param_store>:
hoge: fuga
a:
b: c

+show2:
echo>: "hoge: ${typeof(hoge) == 'undefined' ? 'None' : hoge}, a.b: ${typeof(a) == 'undefined' ? 'None' : typeof(a.b) == 'undefined' ? 'None' : a.b}"

+reset:
+hoge:
param_reset>: hoge
+a.b:
param_reset>: a.b

+show3:
echo>: "hoge: ${typeof(hoge) == 'undefined' ? 'None' : hoge}, a.b: ${typeof(a) == 'undefined' ? 'None' : typeof(a.b) == 'undefined' ? 'None' : a.b}"

+eval:
_export:
a: aaa
b: bbb
c: ccc
d: ${a}-${b}-${c}

+a:
_export:
e: ${d}
f:
g: ${d}
h:
- ${d}
+b:
echo>: ${d}
+c:
echo>: ${e}
+d:
echo>: ${f.g}
+e:
param_eval>: f.g
+f:
echo>: ${f.g}
+g:
+h:
for_each>: {i: "${f.h}"}
_do:
echo>: ${i}
+i:
echo>: ${f.h}
+j:
param_eval>: f.h
+k:
+l:
for_each>: {i: "${f.h}"}
_do:
echo>: ${i}
+m:
echo>: ${f.h}

```

# Configuration

## Configuration for `param_store>` operator

### Options

- **param_store>**: Params to store. (string to object map, required)

## Configuration for `param_reset>` operator

### Options

- **param_reset>**: Param name to reset. (string, required)

## Configuration for `param_eval>` operator

### Options

- **param_eval>**: Param name to eval. (string, required)

**NOTE**:
* This operator is a workaround for the issue: [Exported vars are not evaluated recursively in the context of nested params](https://github.com/treasure-data/digdag/issues/862)
* Use single quote`'` instead of double quote`"` for injecting javascript code to avoide `SyntaxError: : Missing close quote` error: [Fails param_eval>: when using custom variables in nested variables](https://github.com/civitaspo/digdag-operator-param/issues/14)

# Development

## Run an Example

### build

```sh
./gradlew publish
```

Artifacts are build on local repos: `./build/repo`.

### run an example

```sh
./example/run.sh
```

## Dependencies
This project's dependencies are managed by the gradle [dependency locking feature](https://docs.gradle.org/current/userguide/dependency_locking.html).

```shell
# Update the dependencies
./gradlew dependencies --write-locks

# Update the paticular dependency
./gradlew dependencies --update-locks org.junit.jupiter:junit-jupiter-api
```

## (TODO) Run Tests

```sh
./gradlew test
```

# ChangeLog

[CHANGELOG.md](./CHANGELOG.md)

# License

[Apache License 2.0](./LICENSE.txt)

# Author

@civitaspo