Commit 47e22654 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

GitLab CI

parent c1a5a9e7
Pipeline #6657 failed with stages
in 2 seconds
......@@ -3,7 +3,11 @@ image: maven:latest
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
# GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- ARTIFACT=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
cache:
paths:
......@@ -13,7 +17,7 @@ cache:
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS compile
- mvn $MAVEN_CLI_OPTS clean compile
test:
stage: test
......@@ -28,41 +32,7 @@ deploy:
echo "Building Debian package for $VERSION"
mvn $MAVEN_CLI_OPTS -U -Pdariah.deb -Dmaven.test.failure.ignore package
cd target
for f in *.deb; do
if [[ ! -e "$f" ]]; then continue; fi
debversion="$(dpkg-deb -f $f Version)"
package="$(dpkg-deb -f $f Package)"
echo "Found built package $package $debversion"
if [[ $debversion = *"SNAPSHOT" ]]; then
component="snapshot"
codename="testing"
else
component="main"
codename="stable"
fi
REPPACKAGE="$(reprepro -b $REPREPRO_BASE -C $component listfilter $codename 'Package (==$package), Version (==$debversion)')"
if [ ! -z "$REPPACKAGE" ]; then
echo "Pushing new package to Debian repository: $package $debversion"
reprepro -b $REPREPRO_BASE -C $component includedeb $codename $f
fi
done
fi
only:
- master
docs:
stage: deploy
only:
- master
script:
- |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ $VERSION = *"SNAPSHOT" || $VERSION = *"RELEASE" ]]; then
echo "Building documentation for v$VERSION"
echo "Building documentation for $ARTIFACT $VERSION"
cd docs
echo "-- Setting up Virtualenv"
......@@ -92,27 +62,8 @@ docs:
--prefix /var/www/doc/cosmotool \
-C _build/html .
for f in *.deb; do
if [[ ! -e "$f" ]]; then continue; fi
debversion="$(dpkg-deb -f $f Version)"
package="$(dpkg-deb -f $f Package)"
echo "Found built package $package $debversion"
if [[ $debversion = *"SNAPSHOT" ]]; then
component="snapshot"
codename="testing"
else
component="main"
codename="stable"
fi
REPPACKAGE="$(reprepro -b $REPREPRO_BASE -C $component listfilter $codename 'Package (==$package), Version (==$debversion)')"
if [ ! -z "$REPPACKAGE" ]; then
echo "Pushing new package to Debian repository: $package $debversion"
reprepro -b $REPREPRO_BASE -C $component includedeb $codename $f
fi
done
mv *.deb ../target
~/push_deb_packages.sh ../target
fi
\ No newline at end of file
#!/usr/bin/env groovy
node {
def mvnHome
stage('Preparation') {
git 'https://github.com/tgradl/cosmotool.git'
mvnHome = tool 'Maven 3.5.0'
}
stage('Build') {
sh '''
#echo "-- Updating submodules"
#git submodule init &&
#git submodule update --force --remote &&
umask 0022
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"
VERSION=$(grep ^version conf.py | sed \'s/version = \'\\\'\'\\(.*\\)\'\\\'\'/\\1/g\')
fpm -t deb -a noarch -s dir --name dariah-de-cosmotool-doc \
--description='DARIAH-DE Cosmotool Documentation' \
--maintainer='DARIAH-DE <info@de.dariah.eu>' \
--vendor='DARIAH-DE' \
--url='https://cosmotool.de.dariah.eu' \
--iteration $(expr $BUILD_NUMBER + 299) \
--version $VERSION \
-x ".git**" \
-x "**/.git**" \
-x "**/.hg**" \
-x "**/.svn**" \
-x ".buildinfo" \
-x "**/*.deb" \
--prefix /var/www/doc/cosmotool \
-C _build/html .
'''
}
stage('Publish') {
def dVersion = sh(returnStdout: true, script: 'grep ^version ./docs/conf.py | sed \'s/version = \'\\\'\'\\(.*\\)\'\\\'\'/\\1/g\'').trim()
def snapshot = dVersion.contains("SNAPSHOT")
if (snapshot) {
doDebSnapshot('dariah-de-cosmotool-doc', dVersion)
}
else {
doDebRelease('dariah-de-cosmotool-doc', dVersion)
}
}
}
def doDebRelease(pname, pversion) {
echo "Publishing Debian package ${pname} for RELEASE version ${pversion}"
sh "PLOC=\$(ls ./docs/*.deb); curl -X POST -F file=@\${PLOC} http://localhost:8008/api/files/${pname}-${pversion}"
sh "curl -X POST http://localhost:8008/api/repos/releases/file/${pname}-${pversion}"
sh "curl -X PUT -H 'Content-Type: application/json' --data '{}' http://localhost:8008/api/publish/:./trusty"
sh "rm ./docs/*.deb"
}
def doDebSnapshot(pname, pversion) {
echo "Publishing Debian package ${pname} for SNAPSHOT version ${pversion}"
sh "PLOC=\$(ls ./docs/*.deb); curl -X POST -F file=@\${PLOC} http://localhost:8008/api/files/${pname}-${pversion}"
sh "curl -X POST http://localhost:8008/api/repos/snapshots/file/${pname}-${pversion}"
sh "curl -X PUT -H 'Content-Type: application/json' --data '{}' http://localhost:8008/api/publish/:./trusty"
sh "rm ./docs/*.deb"
}
......@@ -12,7 +12,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<eu.dariah.de.minfba-search-commons.version>1.5.3</eu.dariah.de.minfba-search-commons.version>
<eu.dariah.de.minfba-search-commons.version>1.8.0</eu.dariah.de.minfba-search-commons.version>
<org.springframework-version>4.3.6.RELEASE</org.springframework-version>
<org.springsecurity-version>4.2.1.RELEASE</org.springsecurity-version>
......
......@@ -11,10 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import eu.dariah.de.search.es.service.AggregationService;
import eu.dariah.de.search.es.service.SearchService;
import eu.dariah.de.search.model.ExtendedDatamodelContainer;
import eu.dariah.de.search.pojo.TagPojo;
import eu.dariah.de.search.query.execution.AggregationService;
import eu.dariah.de.search.service.DatamodelService;
@Component
......@@ -41,9 +41,9 @@ public class EntityAggregationServiceImpl implements EntityAggregationService {
public List<TagPojo> getTags() {
ExtendedDatamodelContainer esc = schemaService.findById(this.getWikipediaIndexName().replace(indexNamePrefix, ""));
if (esc!=null) {
List<ExtendedDatamodelContainer> escs = new ArrayList<ExtendedDatamodelContainer>(1);
/*List<ExtendedDatamodelContainer> escs = new ArrayList<ExtendedDatamodelContainer>(1);
escs.add(esc);
return aggregationService.aggregateTags(escs, "Wordcloud", 100);
return aggregationService.aggregateTags(analyzer, size)(escs, "Wordcloud", 100);*/
}
return null;
}
......
......@@ -34,8 +34,8 @@ import eu.dariah.de.minfba.cosmotool.result.Human;
import eu.dariah.de.minfba.cosmotool.result.Place;
import eu.dariah.de.minfba.cosmotool.result.SearchResult;
import eu.dariah.de.minfba.cosmotool.service.base.BaseQueryService;
import eu.dariah.de.search.es.service.DocumentService;
import eu.dariah.de.search.es.service.SearchService;
import eu.dariah.de.search.query.execution.DocumentService;
@Component
public class EntityQueryServiceImpl extends BaseQueryService implements EntityQueryService {
......
......@@ -115,7 +115,7 @@
<property name="maxParallelThreads" value="6" />
</bean>
<bean class="de.unibamberg.minf.processing.service.xml.XmlStringProcessingService" scope="prototype">
<bean class="de.unibamberg.minf.processing.service.xml.XmlProcessingService" scope="prototype">
<property name="elementProcessors">
<list>
<ref bean="gtfElementProcessor" />
......@@ -123,7 +123,7 @@
</property>
</bean>
<bean class="de.unibamberg.minf.processing.service.text.TextStringProcessingService" scope="prototype">
<bean class="de.unibamberg.minf.processing.service.text.TextProcessingService" scope="prototype">
<property name="elementProcessors">
<list>
<ref bean="gtfElementProcessor" />
......@@ -131,7 +131,7 @@
</property>
</bean>
<bean class="de.unibamberg.minf.processing.service.text.CsvStringProcessingService" scope="prototype">
<bean class="de.unibamberg.minf.processing.service.tabular.CsvProcessingService" scope="prototype">
<property name="elementProcessors">
<list>
<ref bean="gtfElementProcessor" />
......
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