From 861fa1959631141ee8f06329c8b1597d416202c4 Mon Sep 17 00:00:00 2001 From: Lin Yang Date: Tue, 15 Oct 2013 21:38:33 +0800 Subject: [PATCH] Auto create symlinks to jobs/configuration In %post section, automatically create symlinks /var/lib/jenkins/userContent/ configuration to /var/lib/jenkins/jobs/configuration. Fixes: #1356 Change-Id: Ic2e45eb14b647b9a57c94b908f7ce8d3aa5aed36 Signed-off-by: Lin Yang --- packaging/jenkins-jobs.spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packaging/jenkins-jobs.spec b/packaging/jenkins-jobs.spec index 80ae335..c29e247 100644 --- a/packaging/jenkins-jobs.spec +++ b/packaging/jenkins-jobs.spec @@ -57,6 +57,17 @@ Jenkins jobs for tzs customer appliance instance install -d %{buildroot}%{destdir} cp -rf jobs/* %{buildroot}%{destdir}/ +%post +if [ ! -d /var/lib/jenkins/userContent ]; then + mkdir -p /var/lib/jenkins/userContent +fi +ln -sf %{destdir}/configuration /var/lib/jenkins/userContent/configuration + +%postun +if [ -L /var/lib/jenkins/userContent/configuration ]; then + rm -f /var/lib/jenkins/userContent/configuration +fi + %files %defattr(-,jenkins,jenkins) %dir /var/lib/jenkins -- 2.7.4