From c65a0d4b8d4f0a1652c0199fa73d53834523dee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= Date: Wed, 5 Dec 2018 10:21:01 +0100 Subject: [PATCH 1/2] setting up a test env based in local development in this repo --- .gitignore | 2 ++ .gitlab-ci.yml | 46 ++++++++++++++++++++++++++++++------- Jenkinsfile | 23 ------------------- build.properties | 8 +++++++ build.xml | 50 ++++++++++++++++++++++++++++++++--------- expath-pkg.xml | 10 +++++++-- expath-pkg.xml.tmpl | 13 +++++++++++ master.build.properties | 2 ++ 8 files changed, 111 insertions(+), 43 deletions(-) delete mode 100644 Jenkinsfile create mode 100644 build.properties create mode 100644 expath-pkg.xml.tmpl create mode 100644 master.build.properties diff --git a/.gitignore b/.gitignore index 567609b..1dd9d21 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ build/ +test/ +local.build.properties diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d143cbb..14367a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,25 +1,55 @@ -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" diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index ccf3141..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,23 +0,0 @@ -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 - } -} diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..8f152c6 --- /dev/null +++ b/build.properties @@ -0,0 +1,8 @@ +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 diff --git a/build.xml b/build.xml index 4cbdffd..3b58f79 100644 --- a/build.xml +++ b/build.xml @@ -1,13 +1,43 @@ - - - - - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + diff --git a/expath-pkg.xml b/expath-pkg.xml index 85d1c53..c9bad85 100644 --- a/expath-pkg.xml +++ b/expath-pkg.xml @@ -1,7 +1,13 @@ - + + Scalable Architecture for Digital Editions powered by TextGrid + - + diff --git a/expath-pkg.xml.tmpl b/expath-pkg.xml.tmpl new file mode 100644 index 0000000..c602282 --- /dev/null +++ b/expath-pkg.xml.tmpl @@ -0,0 +1,13 @@ + + + @project.title@ + + + + + + diff --git a/master.build.properties b/master.build.properties new file mode 100644 index 0000000..5429506 --- /dev/null +++ b/master.build.properties @@ -0,0 +1,2 @@ +project.abbrev=SADE +project.name=http://textgrid.de/ns/SADE -- GitLab From 9dcbac7166c9f05435c819842e2f897e871c31cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= Date: Wed, 5 Dec 2018 10:41:16 +0100 Subject: [PATCH 2/2] publish packages from develop and master branch only --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14367a0..a22462e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,9 @@ installation: junit: tests-*.xml upload: + only: + - master + - develop except: - tags stage: deploy -- GitLab