-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
80 lines (79 loc) · 3.5 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "Sync Uptime-Kuma Monitoring of an ERDDAP deployment on remote server"
description: "Update Uptime-Kuma monitoring of a remote ERDDAP server based on the datasets.xml files of the remote server files and environemnt variables."
inputs:
datasets_xml:
description: "Path to the datasets.xml file to be checked.
It could be a glob expression."
required: false
recursive:
description: "If true, subdirectories will be searched for datasets.xml
files."
required: false
active_dataset_xml:
description: "Path to the active datasets.xml file."
required: false
bigParentDirectory:
description: "The big parent directory to sync the datasets.xml file to."
required: false
container_name:
description: "The container to sync the datasets.xml file to."
required: true
uptime_kuma_url:
description: "URL to upttime_kuma_url. Default to server UPTIME_KUMA_URL
environment variable."
required: false
uptime_kuma_username:
description: "Uptime Kuma username. Default to server UPTIME_KUMA_USERNAME
environment variable available within server."
required: false
uptime_kuma_password:
description: "Uptime Kuma password. Default to server UPTIME_KUMA_PASSWORD
environment variable available within server."
uptime_kuma_token:
description: "Uptime Kuma token. Default to server UPTIME_KUMA_TOKEN
environment variable available within server."
erddap_url:
description: "The ERDDAP server URL to monitor. Default to server ERDDAP_URL
environment variable available within server."
erddap_name:
description: "The ERDDAP server name use to define this deployment on uptime
kuma. default to ERDDAP_URL environment variable available within server."
required: false
ssh_host:
description: "The ssh host to connecto the erddap server."
required: true
ssh_username:
description: "The ssh user to connecto the erddap server."
required: true
ssh_key:
description: "The ssh key to connecto the erddap server."
required: true
ssh_port:
description: "The ssh port to connecto the erddap server."
required: false
default: "22"
runs:
using: "composite"
steps:
- name: Update ERDDAP dataset.xml
uses: appleboy/[email protected]
with:
host: ${{ inputs.ssh_host }}
username: ${{ inputs.ssh_username }}
key: ${{ inputs.ssh_key }}
port: ${{ inputs.ssh_port }}
script: |
docker exec \
$(docker ps --filter name=${{ inputs.container_name }} -q) \
erddap_deploy \
${{ inputs.datasets_xml && '--datasets-xml=' || '' }}${{ inputs.datasets_xml }} \
${{ inputs.recursive && '--recursive' || '' }} \
${{ inputs.active_datasets_xml && '--active-datasets-xml=' || '' }}${{ inputs.active_datasets_xml }} \
${{ inputs.big_parent_directory && '--big-parent-directory=' || '' }}${{ inputs.bigParentDirectory }} \
monitor \
${{ inputs.uptime_kuma_url && '--uptime-kuma-url=' || '' }}${{ inputs.uptime_kuma_url }} \
${{ inputs.uptime_kuma_username && '--username=' || '' }}${{ inputs.uptime_kuma_username }} \
${{ inputs.uptime_kuma_password && '--password=' || '' }}${{ inputs.uptime_kuma_password }} \
${{ inputs.uptime_kuma_token && '--token=' || '' }}${{ inputs.uptime_kuma_token }} \
${{ inputs.erddap_url && '--erddap-url=' || '' }}${{ inputs.erddap_url }} \
${{ inputs.erddap_name && '--erddap-name=' || '' }}${{ inputs.erddap_name }};