apply plugin: 'com.netflix.nebula.ospackage' // This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name afterEvaluate { ospackage { packageName = "opensearch-${name}" release = isSnapshot ? "0.1" : '1' version = "${project.version}" - "-SNAPSHOT" into '/usr/share/opensearch/plugins' from(zipTree(bundlePlugin.archiveFile)) { into opensearchplugin.name } user 'root' permissionGroup 'root' fileMode 0644 dirMode 0755 requires('opensearch-oss', versions.opensearch, EQUAL) packager = 'Amazon' vendor = 'Amazon' os = 'LINUX' prefix '/usr' license 'ASL-2.0' maintainer 'OpenDistro for Elasticsearch Team ' url 'https://opendistro.github.io/for-elasticsearch/downloads.html' summary ''' OpenSearch Alerting. Reference documentation can be found at https://opendistro.github.io/for-elasticsearch-docs/. '''.stripIndent().replace('\n', ' ').trim() } buildRpm { arch = 'NOARCH' dependsOn 'assemble' finalizedBy 'renameRpm' task renameRpm(type: Copy) { from("$buildDir/distributions") into("$buildDir/distributions") rename "$archiveFileName", "${packageName}-${archiveVersion}.rpm" doLast { delete file("$buildDir/distributions/$archiveFileName") } } } buildDeb { arch = 'all' dependsOn 'assemble' finalizedBy 'renameDeb' task renameDeb(type: Copy) { from("$buildDir/distributions") into("$buildDir/distributions") rename "$archiveFileName", "${packageName}-${archiveVersion}.deb" doLast { delete file("$buildDir/distributions/$archiveFileName") } } } }