foreman_webhooks 0.0.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/concerns/foreman_webhooks/taxonomy_extensions.rb +11 -0
- data/app/views/foreman_webhooks/webhook_templates/katello_-_content_view.erb +16 -0
- data/app/views/foreman_webhooks/webhook_templates/katello_-_promote.erb +23 -0
- data/app/views/foreman_webhooks/webhook_templates/katello_-_publish.erb +24 -0
- data/app/views/foreman_webhooks/webhook_templates/katello_-_repo_sync.erb +27 -0
- data/lib/foreman_webhooks/engine.rb +1 -1
- data/lib/foreman_webhooks/version.rb +1 -1
- data/webpack/__mocks__/foremanReact/common/HOC.js +5 -2
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7eefadfce94e1499842423b790e8c387e4f62ce98a1e6b09fe8a9001718b9f1
|
4
|
+
data.tar.gz: ad0b5f62406983e72601d9a28aa7c8a84d364fb99b9984445b61b459f17446f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 662cfadd46b2f4cf687623a2383b2d27304464606a19df2dd53825accb75668381edada4d3c614705940773cf390a5e31d53c10f2aa4171f94cf690e5023992b
|
7
|
+
data.tar.gz: 10a37322e66de2ca65a93313b9bfc60b53e35ee1cad0ff599c88ca68f5b888829c3f235747458b13f3735ce315164e117bda4dc5b018f7e050f276c0c84070a2
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ForemanWebhooks
|
4
|
+
module TaxonomyExtensions
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
has_many :webhook_templates, -> { where(type: 'WebhookTemplate') }, through: :taxable_taxonomies, source: :taxable, source_type: 'WebhookTemplate'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%#
|
2
|
+
name: Katello Content View
|
3
|
+
description: Example payload for content_view_*.event.foreman
|
4
|
+
snippet: false
|
5
|
+
model: WebhookTemplate
|
6
|
+
-%>
|
7
|
+
#
|
8
|
+
# Example webhook template, @object carries Action instance.
|
9
|
+
# For more information about available helpers visit /templates_doc
|
10
|
+
#
|
11
|
+
# Content view id <%= @object.id %>
|
12
|
+
# Content view name <%= @object.name %>
|
13
|
+
# Content view label <%= @object.label %>
|
14
|
+
# Organization id <%= @object.organization.id %>
|
15
|
+
# Organization name <%= @object.organization.name %>
|
16
|
+
# Organization label <%= @object.organization.label %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%#
|
2
|
+
name: Katello Promote
|
3
|
+
description: Example payload for actions.katello.content_view.promote_suceeded
|
4
|
+
snippet: false
|
5
|
+
model: WebhookTemplate
|
6
|
+
-%>
|
7
|
+
#
|
8
|
+
# Example webhook template, @object carries Action instance.
|
9
|
+
# For more information about available helpers visit /templates_doc
|
10
|
+
#
|
11
|
+
# Environments <%= @object.environments %>
|
12
|
+
# Content view ID <%= @object.content_view_id %>
|
13
|
+
# Content view name <%= @object.content_view_name %>
|
14
|
+
# Content view label <%= @object.content_view_label %>
|
15
|
+
# Organization id <%= @object.organization_id %>
|
16
|
+
# Organization name <%= @object.organization_name %>
|
17
|
+
# Organization label <%= @object.organization_label %>
|
18
|
+
# Task label <%= @object.task.label %>
|
19
|
+
# Task started at <%= @object.task.started_at %>
|
20
|
+
# Task ended at <%= @object.task.ended_at %>
|
21
|
+
# Task resulted with <%= @object.task.result %>
|
22
|
+
# Task state <%= @object.task.state %>
|
23
|
+
# Task action output <%= @object.task.action_output %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%#
|
2
|
+
name: Katello Publish
|
3
|
+
description: Example payload for actions.katello.content_view.publish_suceeded
|
4
|
+
snippet: false
|
5
|
+
model: WebhookTemplate
|
6
|
+
-%>
|
7
|
+
#
|
8
|
+
# Example webhook template, @object carries Action instance.
|
9
|
+
# For more information about available helpers visit /templates_doc
|
10
|
+
#
|
11
|
+
# Content view version id <%= @object.content_view_version_id %>
|
12
|
+
# Content view version name <%= @object.content_view_version_name %>
|
13
|
+
# Content view id <%= @object.content_view_id %>
|
14
|
+
# Content view name <%= @object.content_view_name %>
|
15
|
+
# Content view label <%= @object.content_view_label %>
|
16
|
+
# Organization id <%= @object.organization_id %>
|
17
|
+
# Organization name <%= @object.organization_name %>
|
18
|
+
# Organization label <%= @object.organization_label %>
|
19
|
+
# Task label <%= @object.task.label %>
|
20
|
+
# Task started at <%= @object.task.started_at %>
|
21
|
+
# Task ended at <%= @object.task.ended_at %>
|
22
|
+
# Task resulted with <%= @object.task.result %>
|
23
|
+
# Task state <%= @object.task.state %>
|
24
|
+
# Task action output <%= @object.task.action_output %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%#
|
2
|
+
name: Katello Sync
|
3
|
+
description: Example payload for actions.katello.repository.sync_succeeded
|
4
|
+
snippet: false
|
5
|
+
model: WebhookTemplate
|
6
|
+
-%>
|
7
|
+
#
|
8
|
+
# Example webhook template, @object carries Action instance.
|
9
|
+
# For more information about available helpers visit /templates_doc
|
10
|
+
#
|
11
|
+
# Repository id <%= @object.repository_id %>
|
12
|
+
# Repository name <%= @object.repository_name %>
|
13
|
+
# Repository label <%= @object.repository_label %>
|
14
|
+
# Repository contents_changed <%= @object.contents_changed %>
|
15
|
+
# Repository sync_result <%= @object.sync_result %>
|
16
|
+
# Product id <%= @object.product_id %>
|
17
|
+
# Product name <%= @object.product_name %>
|
18
|
+
# Product label <%= @object.product_label %>
|
19
|
+
# Organization id <%= @object.organization_id %>
|
20
|
+
# Organization name <%= @object.organization_name %>
|
21
|
+
# Organization label <%= @object.organization_label %>
|
22
|
+
# Task label <%= @object.task.label %>
|
23
|
+
# Task started at <%= @object.task.started_at %>
|
24
|
+
# Task ended at <%= @object.task.ended_at %>
|
25
|
+
# Task resulted with <%= @object.task.result %>
|
26
|
+
# Task state <%= @object.task.state %>
|
27
|
+
# Task action output <%= @object.task.action_output %>
|
@@ -81,7 +81,7 @@ module ForemanWebhooks
|
|
81
81
|
|
82
82
|
# Include concerns in this config.to_prepare block
|
83
83
|
config.to_prepare do
|
84
|
-
|
84
|
+
(Taxonomy.descendants + [Taxonomy]).each { |klass| klass.send(:include, ForemanWebhooks::TaxonomyExtensions) }
|
85
85
|
rescue StandardError => e
|
86
86
|
Rails.logger.warn "ForemanWebhooks: skipping engine hook (#{e})"
|
87
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_webhooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Goebel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- app/controllers/webhooks_controller.rb
|
57
57
|
- app/jobs/foreman_webhooks/deliver_webhook_job.rb
|
58
58
|
- app/lib/foreman_webhooks/renderer/scope/webhook_template.rb
|
59
|
+
- app/models/concerns/foreman_webhooks/taxonomy_extensions.rb
|
59
60
|
- app/models/webhook.rb
|
60
61
|
- app/models/webhook_template.rb
|
61
62
|
- app/services/foreman_webhooks/webhook_service.rb
|
@@ -74,6 +75,10 @@ files:
|
|
74
75
|
- app/views/api/v2/webhooks/update.json.rabl
|
75
76
|
- app/views/foreman_webhooks/webhook_templates/ansible_tower_-_host_in_inventory.erb
|
76
77
|
- app/views/foreman_webhooks/webhook_templates/empty_payload.erb
|
78
|
+
- app/views/foreman_webhooks/webhook_templates/katello_-_content_view.erb
|
79
|
+
- app/views/foreman_webhooks/webhook_templates/katello_-_promote.erb
|
80
|
+
- app/views/foreman_webhooks/webhook_templates/katello_-_publish.erb
|
81
|
+
- app/views/foreman_webhooks/webhook_templates/katello_-_repo_sync.erb
|
77
82
|
- app/views/foreman_webhooks/webhook_templates/remote_execution_-_host_job.erb
|
78
83
|
- app/views/foreman_webhooks/webhook_templates/webhook_template_-_payload_default.erb
|
79
84
|
- app/views/webhook_templates/_alerts.html.erb
|