Skip to content

Instantly share code, notes, and snippets.

@krzysbaranski
Last active November 28, 2017 18:12
Show Gist options
  • Save krzysbaranski/39bb9d9f776012d30b97e74ce95c58db to your computer and use it in GitHub Desktop.
Save krzysbaranski/39bb9d9f776012d30b97e74ce95c58db to your computer and use it in GitHub Desktop.
- description: ''
executionEnabled: true
id: 829fa3fe-86af-423a-a308-d7422df37dec
loglevel: INFO
name: key_value_data
nodeFilterEditable: false
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: false
rankOrder: ascending
successOnEmptyNodeFilter: false
threadcount: 1
filter: 'localhost name: localhost'
nodesSelectedByDefault: true
options:
- description: ' '
name: referenceTime
value: now
- name: timeShift
value: -1 hour
scheduleEnabled: true
sequence:
commands:
- description: step1
script: |
#!/usr/bin/env bash
set -x
set -e
REF_TIME=`date --rfc-3339="seconds" -u -d "@option.referenceTime@"`
END_TIME=`date -u -d "${REF_TIME}" +%Y%m%d/%H00`
START_TIME=`date -u -d "@option.timeShift@ ${REF_TIME}" +%Y%m%d/%H00`
OUTPUT_FILENAME=`date -u -d "${REF_TIME}" +%Y%m%d_%H00`.json
echo "RUNDECK:DATA:reftime=${REF_TIME}"
echo "RUNDECK:DATA:starttime=${START_TIME}"
echo "RUNDECK:DATA:endtime=${END_TIME}"
- description: echo step 2
exec: /bin/echo ${data.reftime}
- args: ${data.reftime}
description: print ref time step 3
script: |
#!/bin/bash
set -x
echo "command parameter data.reftime=$1"
- description: step 4 job reference
jobref:
args: -referenceTime ${data.reftime} -timeShift ${option.timeShift}
group: ''
name: key_value_data_recieve
nodeStep: 'true'
- description: inline step 5
script: |
#!/bin/bash
set -x
echo "INLINE"
echo "@data.reftime@"
echo "END"
- args: ${data.reftime}
description: step 6
script: |-
#!/bin/bash
echo $1
echo data by argument
keepgoing: false
pluginConfig:
LogFilter:
- config:
logData: 'true'
regex: ^RUNDECK:DATA:(.+?)\s*=\s*(.+)$
type: key-value-data
strategy: node-first
uuid: 829fa3fe-86af-423a-a308-d7422df37dec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment