smeserver-git/createlinks

118 lines
3.5 KiB
Plaintext
Raw Permalink Normal View History

#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# our event specific for updating with yum without reboot
$event = 'smeserver-git-update';
#add here the path to your templates needed to expand
#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
foreach my $file (qw(
/etc/systemd/system-preset/49-koozali.preset
/etc/httpd/conf/httpd.conf
))
{
templates2events( $file, $event );
}
#action needed in case we have a systemd unit
event_link('systemd-default', $event, '10');
event_link('systemd-reload', $event, '50');
#action specific to this package
#event_link('action', $event, '30');
#services we need to restart
safe_symlink('restart',"root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
#and Server Manager panel link
#panel_link('somefunction', 'manager');
use File::Basename;
# Overview of Events, Actions, Template & Services
# ================================================
# git-create
# ----------
# git-modify
# ----------
# git-delete
# ----------
# git-repository-create
# ---------------------
# git-repository-modify
# ---------------------
# git-repository-delete
# ---------------------
# user-delete
# -----------
# group-modify
# ------------
# group-delete
# ------------
# domain-modify
# -------------
# The domain/server name is used in the GitWeb view.
# domain-delete
# -------------
# If a domain is deleted, we need to check if the deleted domain may have been the in use for Git.
# Git Contrib Modified or Deleted
# -------------------------------
for my $event ( qw( git-modify
git-delete ) )
{
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
templates2events("/etc/httpd/conf/httpd.conf", $event)
}
# Git Repository Create / Modify
# ------------------------------
# Repository setting created or updated. regenerate the httpd.conf file and signal the
# server restart.
for my $event ( qw( git-repository-create
git-repository-modify ) )
{
event_link("git-repository-create-modify", $event, "05");
templates2events("/etc/httpd/conf/httpd.conf", $event);
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
}
# Git Repository Delete
# ---------------------
# Perform the repository delete action and then regenerate the httpd.conf file.
for my $event (qw( git-repository-delete ))
{
event_link("git-repository-delete", $event, "05");
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
templates2events("/etc/httpd/conf/httpd.conf", $event)
}
# User Delete / Group Delete / Group Modify
# -----------------------------------------
# For either Users or Groups being deleted or Groups being modified, we need
# to go through all the git repositiories and update the UserRead, UserWrite,
# GroupRead and GroupWrite entries. We then need to expand the httpd.conf
# template to ensure that the expanded user names there are still the right
# ones and also we need to update the git repositories themselves to update
# the mailing list for each repository.
for my $event ( qw( user-delete
group-delete
group-modify ) )
{
event_link("git-delete-user-or-group-from-access-list", $event, "05");
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
templates2events("/etc/httpd/conf/httpd.conf", $event)
}
panel_link('git', 'manager');