Commit a81bc7bc authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

Migrating Sphinx build to Gradle

parent feeb8351
Loading
Loading
Loading
Loading
Loading
+4 −38
Original line number Diff line number Diff line
@@ -29,48 +29,14 @@ test:
deploy:
  stage: deploy
  script:
    - ./gradlew publish $NEXUS_CREDENTIALS
    - ./gradlew publish -x :dme-docs:publish $NEXUS_CREDENTIALS
  only:
    - master

docs:
  stage: deploy
  script:
    - |
      if [[ $VERSION = *"SNAPSHOT" || $VERSION = *"RELEASE" ]]; then
        echo "Building documentation for $ARTIFACT $VERSION"
        cd docs

        echo "-- Setting up Virtualenv"
        virtualenv venv
        pwd
        . venv/bin/activate

        echo "-- Installing requirements"
        pip install -r requirements.txt

        echo "-- Building HTML version within $(pwd)"
        make clean html

        echo "-- Creating package"
        fpm -t deb -a noarch -s dir --name dme-doc \
                              --description='DARIAH-DE DME Documentation' \
                              --maintainer='DARIAH-DE <info@de.dariah.eu>' \
                              --vendor='DARIAH-DE' \
                              --url='https://dme.de.dariah.eu' \
                              --version $VERSION \
                              -x ".git**" \
                              -x "**/.git**" \
                              -x "**/.hg**" \
                              -x "**/.svn**" \
                              -x ".buildinfo" \
                              -x "**/*.deb" \
                              --prefix /var/www/doc/dme \
                              -C _build/html .
        
        ~/scripts/push_deb_packages.sh ./
        
      fi
    - ./gradlew :dme-docs:publish $NEXUS_CREDENTIALS 
  only:
    - master
    - docs
+17 −13
Original line number Diff line number Diff line
@@ -16,18 +16,22 @@ plugins {
    id 'nebula.ospackage' version '8.0.3'
}

allprojects {
    group = 'de.unibamberg.minf'
version = '3.6.0-SNAPSHOT'
    version = '3.6.0-SNAPSHOOT'
    description = 'DARIAH-DE Data Modeling Environment'

def mavenRepo     = 'https://minfba.de.dariah.eu/nexus/repository/minfba-central/'
def releasesRepo  = "https://minfba.de.dariah.eu/nexus/repository/minfba-releases/"
def snapshotsRepo = "https://minfba.de.dariah.eu/nexus/repository/minfba-snapshots/"
def aptRepo       = 'https://minfba.de.dariah.eu/nexus/repository/minfba-apt/'
def yumRepo       = 'https://minfba.de.dariah.eu/nexus/repository/minfba-yum/'
    ext {
        mavenRepo     = 'https://minfba.de.dariah.eu/nexus/repository/minfba-central/'
        releasesRepo  = "https://minfba.de.dariah.eu/nexus/repository/minfba-releases/"
        snapshotsRepo = "https://minfba.de.dariah.eu/nexus/repository/minfba-snapshots/"
        aptRepo       = 'https://minfba.de.dariah.eu/nexus/repository/minfba-apt/'
        yumRepo       = 'https://minfba.de.dariah.eu/nexus/repository/minfba-yum/'
        
def repoUser = project.hasProperty('nexususer') ? project.getProperty('nexususer') : '?';
def repoPass = project.hasProperty('nexuspass') ? project.getProperty('nexuspass') : ''
        repoUser = project.hasProperty('nexususer') ? project.getProperty('nexususer') : '?';
        repoPass = project.hasProperty('nexuspass') ? project.getProperty('nexuspass') : ''
    }
}

repositories {
    mavenLocal()
@@ -145,9 +149,9 @@ ospackage {

    into "var/dfa/webapps/$project.name/"

    /*from(configurations.runtime) {
    from(configurations.runtime) {
        into "WEB-INF/lib"
    }*/
    }

    from("$buildDir/classes/java/main") {
        into "WEB-INF/classes"
+70 −0
Original line number Diff line number Diff line

plugins {
  id "kr.motd.sphinx" version "2.6.1"
  id "nebula.ospackage"
}

// Apply the 'base' plugin, which adds the 'site' task.
@@ -7,7 +9,75 @@ plugins {
//       other plugin that extends 'base', such as 'java'.
apply plugin: 'base'

ext {
    // Filled dynamically by packaging tasks
    debFile = ""
    rpmFile = ""
}

sphinx {
  sourceDirectory = "${projectDir}"
  outputDirectory = "${project.buildDir}/html"
}

build.dependsOn site

tasks.withType(Deb) {
    dependsOn(site)
    doLast {
        project.debFile = archiveName;
    }
}

tasks.withType(Rpm) {
    dependsOn(site)
    doLast {
        project.rpmFile = archiveName;
    }
}

ospackage {
    os = LINUX
    arch = 'noarch'
    packageName "dariah-$project.name"
    replaces "$project.name"
    maintainer 'info@de.dariah.eu'
    signingKeyId('CB012F105B632B46C2A7B4918FC46DAC1BC3E238')

    from("$buildDir/html") {
        into "var/www/doc/dariah-$project.name/"
    }
}

task publishDebPackage {
    dependsOn buildDeb
    def distroPath = "$buildDir/distributions/"
    doLast {
        if (version.endsWith('SNAPSHOT') || version.endsWith('RELEASE')) {
            println "Publishing Debian package $debFile as user $repoUser";
            exec {
                executable "curl"
                args "-f", "-u", "$repoUser:$repoPass", "-H", "Content-Type: multipart/form-data", "--data-binary", "@$distroPath$debFile", "$aptRepo";
            }
        }
    }
}

task publishRpmPackage {
    dependsOn buildRpm
    def distroPath = "$buildDir/distributions/"
    doLast {
        if (version.endsWith('SNAPSHOT') || version.endsWith('RELEASE')) {
            println "Publishing Rpm package $rpmFile as user $repoUser";
            exec {
                executable "curl"
                args "-f", "-u", "$repoUser:$repoPass", "--upload-file", "$distroPath$rpmFile", "$yumRepo/dariah/${project.name}/${project.version}/$rpmFile";
            }
        }
    }
}

task publish {
  dependsOn publishDebPackage
  dependsOn publishRpmPackage
}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
rootProject.name = 'dme'

include(':dme-docs')
project(':dme-docs').projectDir = new File('./docs')
 No newline at end of file