diff --git a/build.gradle b/build.gradle index 9b5f1537..6c383b47 100644 --- a/build.gradle +++ b/build.gradle @@ -172,6 +172,30 @@ dependencies { } } +buildRpm { + postInstall 'mkdir -p -m 0755 /usr/local/nn-analytics/dfs/name/current && ' + + 'mkdir -p -m 0755 /usr/local/nn-analytics/dfs/name/legacy && ' + + 'chown -R hdfs: /usr/local/nn-analytics/dfs && ' + + 'mkdir -p -m 0755 /usr/local/nn-analytics/db && ' + + 'chown -R hdfs: /usr/local/nn-analytics/db &&' + + 'mkdir -p -m 0755 /var/log/nn-analytics && ' + + 'chown hdfs: /var/log/nn-analytics && ' + + 'cp /usr/local/nn-analytics/bin/nn-analytics /etc/init.d/ && ' + + 'chkconfig --add nn-analytics' +} + +buildDeb { + postInstall 'mkdir -p -m 0755 /usr/local/nn-analytics/dfs/name/current && ' + + 'mkdir -p -m 0755 /usr/local/nn-analytics/dfs/name/legacy && ' + + 'chown -R hdfs: /usr/local/nn-analytics/dfs && ' + + 'mkdir -p -m 0755 /usr/local/nn-analytics/db && ' + + 'chown -R hdfs: /usr/local/nn-analytics/db &&' + + 'mkdir -p -m 0755 /var/log/nn-analytics && ' + + 'chown hdfs: /var/log/nn-analytics && ' + + 'cp /usr/local/nn-analytics/bin/nn-analytics /etc/init.d/ && ' + + 'update-rc.d nn-analytics defaults' +} + ospackage { packageName = 'nn-analytics' version = versioning.info.full.startsWith("null") ? "1.2." + hadoopVersion : versioning.info.full @@ -181,16 +205,6 @@ ospackage { user 'root' permissionGroup 'root' - postInstall 'mkdir -p -m 0755 /usr/local/nn-analytics/dfs/name/current && ' + - 'mkdir -p -m 0755 /usr/local/nn-analytics/dfs/name/legacy && ' + - 'chown -R hdfs: /usr/local/nn-analytics/dfs &&' + - 'mkdir -p -m 0755 /usr/local/nn-analytics/db && ' + - 'chown -R hdfs: /usr/local/nn-analytics/db &&' + - 'mkdir -p -m 0755 /var/log/nn-analytics && ' + - 'chown hdfs: /var/log/nn-analytics &&' + - 'cp /usr/local/nn-analytics/bin/nn-analytics /etc/init.d/ &&' + - 'chkconfig --add nn-analytics' - into '/usr/local/nn-analytics/' from('build/version.properties') {