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

Migrating Sphinx build to Gradle

parent feeb8351
Pipeline #13426 passed with stages
in 5 minutes and 4 seconds
......@@ -28,49 +28,15 @@ test:
deploy:
stage: deploy
script:
- ./gradlew publish $NEXUS_CREDENTIALS
script:
- ./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
\ No newline at end of file
- docs
......@@ -16,18 +16,22 @@ plugins {
id 'nebula.ospackage' version '8.0.3'
}
group = 'de.unibamberg.minf'
version = '3.6.0-SNAPSHOT'
description = 'DARIAH-DE Data Modeling Environment'
allprojects {
group = 'de.unibamberg.minf'
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/'
def repoUser = project.hasProperty('nexususer') ? project.getProperty('nexususer') : '?';
def repoPass = project.hasProperty('nexuspass') ? project.getProperty('nexuspass') : ''
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/'
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"
......
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
rootProject.name = 'dme'
include(':dme-docs')
project(':dme-docs').projectDir = new File('./docs')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment