aboutsummaryrefslogtreecommitdiffstats
path: root/laas/rules
diff options
context:
space:
mode:
Diffstat (limited to 'laas/rules')
-rw-r--r--laas/rules/job.yaml27
-rw-r--r--laas/rules/notify_bot.yaml20
2 files changed, 47 insertions, 0 deletions
diff --git a/laas/rules/job.yaml b/laas/rules/job.yaml
new file mode 100644
index 0000000..4bdf0fc
--- /dev/null
+++ b/laas/rules/job.yaml
@@ -0,0 +1,27 @@
+---
+##############################################################################
+# Copyright 2017 Parker Berberian and Others #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################
+
+name: on_job_trigger
+pack: laas
+description: "rule to link deployment trigger to deployment action"
+enabled: true
+trigger:
+ type: laas.start_job_trigger
+action:
+ ref: laas.master_workflow
+ parameters:
+ job_id: "{{ trigger.job_id }}"
diff --git a/laas/rules/notify_bot.yaml b/laas/rules/notify_bot.yaml
new file mode 100644
index 0000000..6d7bd7f
--- /dev/null
+++ b/laas/rules/notify_bot.yaml
@@ -0,0 +1,20 @@
+---
+name: "notify_bot"
+pack: "laas"
+description: "sends a notification to the registered chat bot"
+enabled: true
+
+trigger:
+ type: "core.st2.generic.notifytrigger"
+ parameters: {}
+
+criteria:
+ trigger.channel:
+ pattern: "chatbot"
+ type: "equals"
+
+action:
+ ref: "laas.send_bot_notification"
+ parameters:
+ message: "{{trigger.message}}"
+ execution_id: "{{trigger.data.execution_id}}"