diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..73feddeb61de1d47fc8630e9f670ee031459ad7e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,98 @@ +variables: + # This will suppress any download for dependencies and plugins or upload messages which would clutter the console log. + # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work. + MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" + # As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used + # when running from the command line. + #MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" + # Nexus Deployment settings, please use env vars in Settings -> CI/CD -> Variables. + MAVEN_SETTINGS_PATH: ".m2/settings.xml" + MAVEN_DEPLOY_OPTS: "--settings=$MAVEN_SETTINGS_PATH" + # File for storing the POM project.version + VARIABLES_FILE: ./variables.txt + +################### +### TEMPLATES ### +################### +.webapp: &webapp + image: alpine:3.14 + stage: deploy_deb + script: + - source $VARIABLES_FILE + - 'apk add --no-cache bash' + - 'apk add --no-cache curl' + - export PLOC="$(ls ./${PPATH}/*.deb)" + - DEB_NAME=$PNAME-$PVERSION.deb + - echo $DEB_NAME + - echo $PKEY + - echo $PLOC + - 'if [[ $PVERSION =~ .*${PKEY}$ ]]; then' + - echo "---A ${PKEY} BUILD IS BEING PERFORMED---" + - 'curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST --header "Content-Type:multipart/form-data" -F file=@${PLOC} ${APTLY_URL}/files/${DEB_NAME}' + - 'curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X POST ${APTLY_URL}/repos/${APTLY_TARGET}/file/${DEB_NAME}' + - 'curl -u ${APTLY_USER}:${APTLY_PASSWORD} -X PUT -H "Content-Type: application/json" --data "{}" ${APTLY_URL}/publish/:./indy' + - fi + +stages: + - build_version + - deploy_java + - deploy_deb + +# Cache downloaded dependencies and plugins between builds. +# To keep cache across branches add 'key: "$CI_JOB_NAME"' +cache: + key: $CI_JOB_NAME + paths: + - .m2/repository + +# Get the project version from main POM file and store it to artifact. +get_version: + image: maven:3.8.3-jdk-8 + only: + - develop +# - main + stage: build_version + script: + - 'PVERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.1:evaluate -Dexpression=project.version -q -DforceStdout)' + - echo "export PVERSION=$PVERSION" > $VARIABLES_FILE + - echo "Project version from main pom file is $PVERSION" + artifacts: + name: POM_VERSION + paths: + - $VARIABLES_FILE + +# Build and deploy all the JARs to GWDG Nexus, and build all the DEBs and store DEBs to artifacts. +build_and_deploy: + image: maven:3.8.3-jdk-8 + only: + - develop +# - main + stage: deploy_java + script: + - 'mvn $MAVEN_OPTS $MAVEN_CLI_OPTS $MAVEN_DEPLOY_OPTS -U clean deploy -Pdhrep.deb' + artifacts: + name: WEBAPP_DEB_PACKAGES + paths: + - ./oaipmh-webapp/target/*.deb + +# Deploy DEB files to APTLY repository. +deploy_oaipmh-webapp_dev: + only: + - develop + variables: + PNAME: 'oaipmh-webapp' + PPATH: '${PNAME}/target' + PKEY: 'SNAPSHOT' + APTLY_TARGET: 'indy-snapshots' + <<: *webapp + +deploy_oaipmh-webapp_prd: + only: +# - main + variables: + PNAME: 'oaipmh-webapp' + PPATH: '${PNAME}/target' + PKEY: 'RELEASE' + APTLY_TARGET: 'indy-releases' + <<: *webapp diff --git a/.m2/settings.xml b/.m2/settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..3fdd646dd2e5a9034694c303e6321db0575e4024 --- /dev/null +++ b/.m2/settings.xml @@ -0,0 +1,11 @@ +<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + <servers> + <server> + <id>${env.NEXUS_REPO_ID}</id> + <username>${env.NEXUS_REPO_USER}</username> + <password>${env.NEXUS_REPO_PW}</password> + </server> + </servers> +</settings> diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..3b549b8e7fe2fa9b60ff7169bc1e2d852a379ecc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +# 4.0.15-SNAPSHOT + +* Move repository, issues, and ci/cd from projects.gwdg.de to gitlab.gwdg.de +* Implement Gitlab CI/CD workflow diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a0054d834b2bfe384986d2e5135235341b1e1892 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# The DARIAH-DE OAI-PMH Service + +## Overview + +The OAI-PMH Data Provider Service is used for both TextGrid and the DARIAH-DE Repository, one instance for every installation. + +## Technical Information + +**TODO** + +## Documentation + +For service and API documentation please have a look at the [TG-oaipmh Documentation](https://textgridlab.org/doc/services/submodules/oai-pmh/docs_tgrep/index.html), and the [DH-oaipmh Documentation](https://repository.de.dariah.eu/doc/services/submodules/oai-pmh/docs_dhrep/index.html). + +## Installation + +The service is provided with a Gitlab CI workflow to build .DEB files to be deployed and installed on TextGrid and DARIAH-DE servers. + +### Building from GIT using Maven + +You can check out the PID Service from our [GIT Repository](https://gitlab.gwdg.de/dariah-de/dariah-de-oaipmh-services), develop or main branch, or get yourself a certain tag, and then use Maven to build the PID Service WAR file: + + git clone https://gitlab.gwdg.de/dariah-de/dariah-de-oaipmh-services.git + +... build the WAR packages via: + + mvn clean package + +... build the DEB packagea using: + + mvn clean package -Pdhrep.deb + +You will get a PID Service WAR and/or DEB file in the folders ./oaipmh-webapp/target. + +### Using DEB File + +Or you can use a DEB file from the DARIAH-DE [APTLY Repository](https://ci.de.dariah.eu/packages/) + + +## Deploying the PID Service + +The service is deployed just by installing the appropriate DEB package. + +## Links and References + +* [OAI-PMH Service Gitlab page](https://gitlab.gwdg.de/dariah-de/dariah-de-oaipmh-services) diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000000000000000000000000000000000000..1dc638babe61b140b75b10aaf40cc6d4628d3c81 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +For releasing a new version, please have a look at the [DARIAH-DE Release Management Page] (https://wiki.de.dariah.eu/display/DARIAH3/DARIAH-DE+Release+Management). + +Specials in OAI-PMH Service releases are the following: + +* Please set the **RELEASE** version to “x.y.z-RELEASE" + +* Please set the **SNAPSHOT** version to “x.y.z-SNAPSHOT“ diff --git a/docs_dhrep/index.rst b/docs_dhrep/index.rst index c61d46e1a7aac0c358e2eb04039965426c337395..d905c42c03a30931bf14c42a87dcc5908b7e9032 100644 --- a/docs_dhrep/index.rst +++ b/docs_dhrep/index.rst @@ -218,6 +218,6 @@ License See LICENCE_ -.. _LICENCE: https://projects.gwdg.de/projects/oai-pmh/repository/revisions/master/entry/LICENSE.txt -.. _oaipmh_sources: https://projects.gwdg.de/projects/oai-pmh/repository -.. _oaipmh_bugtracking: https://projects.gwdg.de/projects/dariah-de-repository/work_packages +.. _LICENCE: https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/-/blob/main/LICENSE.txt +.. _oaipmh_sources: https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/ +.. _oaipmh_bugtracking: https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/-/issues