Last active
May 12, 2018 18:06
-
-
Save garystafford/7572ae57552a287f9f21a0ed327daf11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task packDeb(type: Deb) { | |
description 'Creates .deb package.' | |
into '/opt/' + project.name // root directory | |
from(jar.outputs.files) { // copy *.jar | |
into 'lib' | |
fileMode 0500 | |
user 'springapp' | |
permissionGroup 'springapp' | |
} | |
from('build/resources/main/' + project.name + '.conf') { // copy .conf | |
into 'conf' | |
fileMode 0400 | |
user 'root' | |
permissionGroup 'root' | |
} | |
// symlinks jar to init.d | |
link('/etc/init.d/election', | |
'/opt/' + project.name + '/lib/' + jar.archiveName) | |
// link init.d to rc2.d | |
link('/opt/' + project.name + '/lib/' + project.name + '-' + project.version + '.conf', | |
'/opt/' + project.name + '/conf/' + project.name + '.conf') | |
// link conf to jar location | |
link('/etc/rc2.d/S02election', '/etc/init.d/election') | |
postInstall 'chattr +i ' + '/opt/' + project.name + '/lib/' + jar.archiveName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment