Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DARIAH-DE OAI-PMH Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DARIAH-DE
DARIAH-DE OAI-PMH Services
Commits
29870192
Commit
29870192
authored
3 years ago
by
Stefan E. Funk
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of
https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services
into develop
parents
e25b4d2f
dd7e66de
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+98
-0
98 additions, 0 deletions
.gitlab-ci.yml
with
98 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
98
−
0
View file @
29870192
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment