Repository: bigtop Updated Branches: refs/heads/master 1715e03ab -> be1fbfccd
BIGTOP-1917: Simplify gradle creating apt/yum repositories for better CI Signed-off-by: Konstantin Boudnik <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/be1fbfcc Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/be1fbfcc Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/be1fbfcc Branch: refs/heads/master Commit: be1fbfccd5704bf77bb6f69acf06e8a7e0bdce56 Parents: 1715e03 Author: Olaf Flebbe <[email protected]> Authored: Mon Jul 6 22:06:33 2015 +0200 Committer: Konstantin Boudnik <[email protected]> Committed: Tue Aug 4 14:11:15 2015 -0700 ---------------------------------------------------------------------- packages.gradle | 80 ++++++++++++++++++++-------------------------------- 1 file changed, 31 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/be1fbfcc/packages.gradle ---------------------------------------------------------------------- diff --git a/packages.gradle b/packages.gradle index 412de56..0d864ef 100644 --- a/packages.gradle +++ b/packages.gradle @@ -366,32 +366,6 @@ def genTasks = { target, variable -> } touchTargetFile(BOM_map[variable + '_TARGET_SDEB']) } - task "$target-apt" (dependsOn: "$target-deb", - description: "Creating APT repository for $target packages", - group: PACKAGES_GROUP) << { - if (new File(BOM_map[variable + '_TARGET_APT'])?.exists()) { - println "\tNothing to do. Exiting..." - return - } - def final PKG_NAME = BOM_map[variable + '_NAME'] - def final PKG_RELEASE = BOM_map[variable + '_PKG_RELEASE'] - def final PKG_VERSION = BOM_map[variable + '_PKG_VERSION'] - def final PKG_OUTPUT_DIR = BOM_map[variable + '_OUTPUT_DIR'] - mkdir("$OUTPUT_DIR/apt/conf") - copy { - from "$REPO_DIR/apt/distributions" - into "$OUTPUT_DIR/apt/conf" - } - fileTree (PKG_OUTPUT_DIR) { - include "*.changes" - }.each { changeFile -> - exec { - workingDir BUILD_DIR - commandLine "reprepro -Vb $OUTPUT_DIR/apt include bigtop $changeFile".split(' ') - } - } - touchTargetFile(BOM_map["${variable}_TARGET_APT"]) - } // Keeping the reference to task to be used later for correct sequencing Task trpm = task "$target-rpm" (dependsOn: ["${target}-srpm"], @@ -527,19 +501,6 @@ def genTasks = { target, variable -> group: PACKAGES_GROUP) << { } } - task "$target-yum" (dependsOn: "$target-rpm", - description: "Creating YUM repository for $target packages", - group: PACKAGES_GROUP) << { - if (new File(BOM_map[variable + '_TARGET_YUM'])?.exists()) { - println "\tNothing to do. Exiting..." - return - } - exec { - workingDir BUILD_DIR - commandLine "createrepo -o $OUTPUT_DIR $OUTPUT_DIR".split(' ') - } - touchTargetFile(BOM_map["${variable}_TARGET_YUM"]) - } task "$target-version" (description: "Show version of $target component", group: PACKAGES_GROUP) << { println "Base: ${BOM_map[variable + '_BASE_VERSION']}" } @@ -571,10 +532,8 @@ def genTasks = { target, variable -> BOM_map[variable + '_TARGET_TAR'] = BOM_map[variable + '_BUILD_DIR'] + '/.tar' BOM_map[variable + '_TARGET_SRPM'] = BOM_map[variable + '_BUILD_DIR'] + '/.srpm' BOM_map[variable + '_TARGET_RPM'] = BOM_map[variable + '_BUILD_DIR'] + '/.rpm' - BOM_map[variable + '_TARGET_YUM'] = BOM_map[variable + '_BUILD_DIR'] + '/.yum' BOM_map[variable + '_TARGET_SDEB'] = BOM_map[variable + '_BUILD_DIR'] + '/.sdeb' BOM_map[variable + '_TARGET_DEB'] = BOM_map[variable + '_BUILD_DIR'] + '/.deb' - BOM_map[variable + '_TARGET_APT'] = BOM_map[variable + '_BUILD_DIR'] + '/.apt' BOM_map[variable + '_TARGET_RELNOTES'] = BOM_map[variable + '_BUILD_DIR'] + '/.relnotes' if (System.getProperty(VERBOSE)) { @@ -659,10 +618,6 @@ project.afterEvaluate { description: "Build all RPM packages for the stack", group: PACKAGES_GROUP ) << { } - task "yum" (dependsOn: tasks.findAll { alltask -> alltask.name.endsWith("-yum")}*.name, - description: "Create YUM repository for all pre-built RPM packages", - group: PACKAGES_GROUP - ) << { } task "sdeb" (dependsOn: tasks.findAll { alltask -> alltask.name.endsWith("-sdeb")}*.name, description: "Build all SDEB packages for the stack components", group: PACKAGES_GROUP @@ -671,10 +626,6 @@ project.afterEvaluate { description: "Build all DEB packages for the stack components", group: PACKAGES_GROUP ) << { } - task "apt" (dependsOn: tasks.findAll { alltask -> alltask.name.endsWith("-apt")}*.name, - description: "Create APT repository for all pre-built DEB packages", - group: PACKAGES_GROUP - ) << { } task allclean (dependsOn: [clean, tasks.findAll { alltask -> alltask.name.endsWith("-clean")}*.name], description: "Removing $BUILD_DIR, $OUTPUT_DIR, and $DIST_DIR.\n\t\t" + @@ -690,3 +641,34 @@ project.afterEvaluate { delete (DL_DIR) } } + +task "apt" ( + description: "Creating APT repository", + group: PACKAGES_GROUP) << { + + delete ( "$OUTPUT_DIR/apt") + mkdir ("$OUTPUT_DIR/apt/conf") + + copy { + from "$REPO_DIR/apt/distributions" + into "$OUTPUT_DIR/apt/conf" + } + fileTree (OUTPUT_DIR) { + include "*/*.changes" + }.each { changeFile -> + exec { + workingDir BUILD_DIR + commandLine "reprepro -Vb $OUTPUT_DIR/apt include bigtop $changeFile".split(' ') + } + } +} + +task "yum" ( + description: "Creating YUM repository", + group: PACKAGES_GROUP) << { + delete ( "$OUTPUT_DIR/repodata") + exec { + workingDir BUILD_DIR + commandLine "createrepo -o $OUTPUT_DIR $OUTPUT_DIR".split(' ') + } +}
