Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
dcache-cta
Commits
6546593b
Commit
6546593b
authored
Nov 16, 2021
by
Tigran Mkrtchyan
☕
Browse files
gitlab-ci: add gitlab pipeline
parent
085fec6b
Pipeline
#12847
passed with stages
in 2 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
6546593b
stages
:
-
build
-
package
-
publish
# - visualize
variables
:
MAVEN_CLI_OPTS
:
"
--batch-mode
--errors
--fail-at-end
--show-version
-DinstallAtEnd=true
-DdeployAtEnd=true
-Dmaven.repo.local=.m2/repository"
REPO_NAME
:
dcache-cta
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache
:
key
:
files
:
-
pom.xml
prefix
:
"
$CI_JOB_NAME"
paths
:
-
./.m2/repository
package
:
stage
:
package
image
:
maven:3.6.3-openjdk-11
script
:
-
mvn $MAVEN_CLI_OPTS clean -DskipTests package
artifacts
:
name
:
"
$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths
:
-
"
target/dcache-cta*.tar.gz"
publish
:
only
:
-
tags
stage
:
publish
image
:
centos:8
script
:
-
yum install -y curl
-
PACKAGE=$(ls -1 target/dcache-cta*.tar.gz)
-
PACKAGENAME=$(basename ${PACKAGE})
-
VERSION_1=${PACKAGENAME##*-}
-
VERSION=${VERSION_1%.tar.gz}
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${PACKAGE}
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/v${VERSION}/${PACKAGENAME}'
test
:
stage
:
build
image
:
maven:3.6.3-openjdk-11
script
:
-
mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report
artifacts
:
reports
:
junit
:
-
"
target/surefire-reports/TEST-*.xml"
-
"
target/failsafe-reports/TEST-*.xml"
paths
:
-
"
target/site/jacoco/jacoco.xml"
#coverage-jdk11:
# # Must be in a stage later than test-jdk11's stage.
# # The `visualize` stage does not exist by default.
# # Please define it first, or choose an existing stage like `deploy`.
# stage: visualize
# image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
# script:
# - 'python /opt/cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml'
# - 'python /opt/source2filename.py target/site/cobertura.xml'
# needs: ["test"]
# artifacts:
# reports:
# cobertura: target/site/cobertura.xml
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment