Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Add new sidekiq service files #149

Merged
merged 1 commit into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build/vanagon/components/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
]
end

pkg.install_service('../puppet-webhook.service', '../puppetwebhook', 'puppet-webhook')
pkg.install_service('../puppet-webhook.service', nil, 'puppet-webhook')
pkg.install_service('../puppet-webhook-app.service', '../puppetwebhook', 'puppet-webhook-app')
pkg.install_service('../puppet-webhook-sidekiq.service', '../puppetwebhook', 'puppet-webhook-sidekiq')

pkg.add_postinstall_action('install', 'cd /opt/voxpupuli/webhook && bin/bundle update --bundler')

Expand Down
4 changes: 3 additions & 1 deletion resources/postinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export GEM_PATH=$GEM_HOME
export LD_PATH=/opt/voxpupuli/webhook/lib
export PATH=/opt/voxpupuli/webhook/bin:$PATH

cd /opt/voxpupuli/webhook && bin/bundle install && bin/bundle exec rake db:migrate
cd /opt/voxpupuli/webhook && bin/bundle install && bin/bundle exec rake db:migrate > /dev/null 2>&1

echo "Redis is required to start Puppet Webhook. Please install and start Redis first."
15 changes: 15 additions & 0 deletions resources/puppet-webhook-app.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Puppet Webhook Web Application
PartOf=puppet-webhook.service
After=puppet-webhook.service

[Service]
EnvironmentFile=-/etc/sysconfig/puppet-webhook
EnvironmentFile=-/etc/default/puppet-webhook
WorkingDirectory=/opt/voxpupuli/webhook
ExecStart=/opt/voxpupuli/webhook/bin/bundle exec puma config.ru
ExecReload=/bin/kill -HUP $PID
KillMode=process

[Install]
WantedBy=puppet-webhook.service
15 changes: 15 additions & 0 deletions resources/puppet-webhook-sidekiq.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Puppet Webhook Sidekiq
PartOf=puppet-webhook.service
After=puppet-webhook.service

[Service]
EnvironmentFile=-/etc/sysconfig/puppet-webhook
EnvironmentFile=-/etc/default/puppet-webhook
WorkingDirectory=/opt/voxpupuli/webhook
ExecStart=/opt/voxpupuli/webhook/bin/bundle exec sidekiq -C config/sidekiq.yml -r $WorkingDirectory/config/environment.rb
ExecReload=/bin/kill -HUP $PID
KillMode=process

[Install]
WantedBy=puppet-webhook.service
10 changes: 4 additions & 6 deletions resources/puppet-webhook.service
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[Unit]
Description=Puppet Webhook API Server
After=network.target

[Service]
EnvironmentFile=-/etc/sysconfig/puppet-webhook
EnvironmentFile=-/etc/default/puppet-webhook
WorkingDirectory=/opt/voxpupuli/webhook
ExecStart=/opt/voxpupuli/webhook/bin/bundle exec puma config.ru
ExecReload=/bin/kill -HUP $PID
KillMode=process
Type=oneshot
ExecStart=/bin/true
igalic marked this conversation as resolved.
Show resolved Hide resolved
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target