Commit c65a0d4b authored by Mathias Goebel's avatar Mathias Goebel
Browse files

setting up a test env based in local development in this repo

parent e0651b20
build/
test/
local.build.properties
image: frekele/ant
image: docker.gitlab.gwdg.de/fontane-notizbuecher/build:latest
stages:
- build
- test
- deploy
ant:
build-develop:
except:
- master
- tags
stage: build
script:
- echo "starting ant build"
- ant
artifacts:
paths:
- build/*.xar
build-master:
only:
- master
stage: build
script:
- cp master.build.properties local.build.properties
- ant
artifacts:
paths:
- build/*.xar
installation:
except:
- tags
stage: test
script:
- ant test
- bash test/eXist-db-*/bin/startup.sh | tee output.log &
# wait for eXist
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done
# shutdown eXist
- bash test/eXist-db-*/bin/shutdown.sh
- ls -al /tmp; mv /tmp/tests-* . || true
artifacts:
paths:
- output.log
- test/eXist-db-*/webapp/WEB-INF/logs/expath-repo.log
reports:
junit: tests-*.xml
upload:
except:
- tags
stage: deploy
script:
- FILENAME=$(ls build/*.xar)
- curl -u ci:${EXIST_UPLOAD_PW} -X POST -F file=@${FILENAME} https://ci.de.dariah.eu/exist-upload
trigger_build:
stage: deploy
script:
- "curl -X POST -F token=${GITLAB_TRIGGER_TOKEN} -F ref=develop https://gitlab.gwdg.de/api/v4/projects/2056/trigger/pipeline"
node {
stage('Preparation') {
checkout scm
sh 'rm -f build/*.xar'
}
stage('Build') {
sh 'ant'
}
stage('Publish') {
archiveArtifacts artifacts: 'build/*.xar', onlyIfSuccessful: true
FILENAME = sh (
script: "find build/ -name '*.xar' -exec basename {} \\;",
returnStdout: true
).trim()
sh "curl -X POST -F 'file=@build/${FILENAME}' http://localhost:8181/exist/apps/receiver.xql"
}
stage('Server') {
build job: 'SADE_Server', wait: false
}
}
project.name=http://textgrid.de/ns/SADE-develop
project.version=3.0.1
project.title=Scalable Architecture for Digital Editions powered by TextGrid
project.abbrev=SADE-develop
project.processorversion=4.5.0
destfile=${build.dir}/${project.abbrev}-${project.version}.xar
test.dir=test
<project default="xar" name="SADE">
<xmlproperty file="expath-pkg.xml"/>
<property name="project.version" value="${package(version)}"/>
<property name="project.app" value="${package(abbrev)}"/>
<property name="build.dir" value="build"/>
<target name="xar">
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="SADE" xmlns:xdb="http://exist-db.org/ant">
<property environment="env"/>
<property name="build.dir" value="build"/>
<property file="local.build.properties"/>
<property file="build.properties"/>
<xmlproperty file="expath-pkg.xml.tmpl"/>
<target name="xar" depends="cleanup">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
<filter token="project.title" value="${project.title}"/>
<filter token="project.abbrev" value="${project.abbrev}"/>
<filter token="project.name" value="${project.name}"/>
<filter token="project.processorversion" value="${project.processorversion}"/>
</filterset>
</copy>
<mkdir dir="${build.dir}"/>
<zip
basedir="."
destfile="${build.dir}/${project.app}-${project.version}.xar"
excludes="${build.dir}/*,${build.dir},Jenkinsfile,git.branches,**/.hooks,**/.hooks/*"/>
<zip basedir="." destfile="${destfile}"
excludes="${build.dir}/*,${test.dir}/*"/>
</target>
<target name="cleanup">
<delete dir="${test.dir}"/>
</target>
<target name="test" depends="xar">
<get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${project.processorversion}.tar.bz2" dest="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" skipexisting="true" />
<untar src="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" dest="${test.dir}" compression="bzip2" />
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=cv&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/codeview-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=fontane-lucene-exist-module&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/fontane-lucene-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/markdown-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/functx-latest.xar" ignoreerrors="true"/>
<copy file="${destfile}" todir="${test.dir}/eXist-db-${project.processorversion}/autodeploy" />
</target>
</project>
<package xmlns="http://expath.org/ns/pkg" name="https://sade.textgrid.de/ns/SADE" abbrev="SADE" version="3.0.0" spec="1.0">
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg"
name="http://textgrid.de/ns/SADE-develop"
abbrev="SADE-develop"
version="3.0.1"
spec="1.0">
<title>Scalable Architecture for Digital Editions powered by TextGrid</title>
<dependency processor="http://exist-db.org" semver-min="4.5.0"/>
<dependency package="http://exist-db.org/apps/shared"/>
<dependency package="https://sade.textgrid.de/ns/assets"/>
<dependency package="http://www.functx.com"/>
<dependency package="http://exist-db.org/apps/markdown"/>
<dependency package="http://exist-db.org/apps/markdown"/>
</package>
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg"
name="@project.name@"
abbrev="@project.abbrev@"
version="@project.version@"
spec="1.0">
<title>@project.title@</title>
<dependency processor="http://exist-db.org" semver-min="@project.processorversion@"/>
<dependency package="http://exist-db.org/apps/shared"/>
<dependency package="https://sade.textgrid.de/ns/assets"/>
<dependency package="http://www.functx.com"/>
<dependency package="http://exist-db.org/apps/markdown"/>
</package>
project.abbrev=SADE
project.name=http://textgrid.de/ns/SADE
Supports Markdown
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