Skip to content

Commit

Permalink
gitlab: add rpm publishing (part I)
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Dec 22, 2021
1 parent 45209d5 commit b6d1857
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ package:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- "target/dcache-cta*.tar.gz"
- "target/SPECS"

publish:
only:
Expand All @@ -41,6 +42,22 @@ publish:
- 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}'

publish_rpm:
# only:
# - tags
stage: publish
image: centos:8
script:
- yum install -y curl rpm-build
- mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- cp target/dcache-cta*.tar.gz rpmbuild/SOURCES
- rpmbuild -ba --define "_topdir `pwd`/rpmbuild" target/SPECS/dcache-cta.spec
- 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
Expand Down

0 comments on commit b6d1857

Please sign in to comment.