mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 12:54:50 +01:00
Merge branch 'ml/ci' into 'main'
Refactor CI/CD pipeline See merge request naaice/poet!28
This commit is contained in:
commit
9addc002a2
117
.gitlab-ci.yml
117
.gitlab-ci.yml
@ -19,8 +19,8 @@
|
|||||||
image: git.gfz-potsdam.de:5000/naaice/poet:ci
|
image: git.gfz-potsdam.de:5000/naaice/poet:ci
|
||||||
|
|
||||||
stages: # List of stages for jobs, and their order of execution
|
stages: # List of stages for jobs, and their order of execution
|
||||||
- build
|
|
||||||
- release
|
- release
|
||||||
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
@ -31,13 +31,16 @@ variables:
|
|||||||
build-poet: # This job runs in the build stage, which runs first.
|
build-poet: # This job runs in the build stage, which runs first.
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- mkdir build && cd build
|
- mkdir -p build && cd build
|
||||||
- cmake -DPOET_ENABLE_TESTING=ON ..
|
- cmake -DPOET_ENABLE_TESTING=ON ..
|
||||||
- make -j$(nproc)
|
- make -j$(nproc)
|
||||||
|
cache:
|
||||||
|
key: build-$CI_COMMIT_BRANCH
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build
|
- build
|
||||||
expire_in: 1 day
|
|
||||||
|
|
||||||
test-poet:
|
test-poet:
|
||||||
stage: test
|
stage: test
|
||||||
@ -47,59 +50,6 @@ test-poet:
|
|||||||
- cd build
|
- cd build
|
||||||
- make -j$(nproc) check
|
- make -j$(nproc) check
|
||||||
|
|
||||||
archive-sources: # This job runs in the build stage, which runs first.
|
|
||||||
image: python:3
|
|
||||||
stage: release
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- pip install git-archive-all
|
|
||||||
- echo ARCHIVE_JOB_ID=${CI_JOB_ID} >> archives.env
|
|
||||||
script:
|
|
||||||
- git-archive-all ${SOURCE_ARCHIVE_NAME}
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- ${SOURCE_ARCHIVE_NAME}
|
|
||||||
expire_in: never
|
|
||||||
reports:
|
|
||||||
dotenv: archives.env
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
|
|
||||||
release-description:
|
|
||||||
image: golang:bullseye
|
|
||||||
stage: release
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
before_script:
|
|
||||||
- go install github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.2
|
|
||||||
script:
|
|
||||||
- git-chglog -o ${CHANGELOG_FILE} ${CI_COMMIT_TAG}
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- ${CHANGELOG_FILE}
|
|
||||||
|
|
||||||
|
|
||||||
release-create:
|
|
||||||
stage: release
|
|
||||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
script:
|
|
||||||
- echo "Running release job"
|
|
||||||
needs:
|
|
||||||
- job: archive-sources
|
|
||||||
artifacts: true
|
|
||||||
- job: release-description
|
|
||||||
artifacts: true
|
|
||||||
release:
|
|
||||||
tag_name: $CI_COMMIT_TAG
|
|
||||||
name: 'POET $CI_COMMIT_TAG'
|
|
||||||
description: ${CHANGELOG_FILE}
|
|
||||||
assets:
|
|
||||||
links:
|
|
||||||
- name: '${SOURCE_ARCHIVE_NAME}'
|
|
||||||
url: 'https://git.gfz-potsdam.de/naaice/poet/-/jobs/${ARCHIVE_JOB_ID}/artifacts/file/${SOURCE_ARCHIVE_NAME}'
|
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
stage: release
|
stage: release
|
||||||
before_script:
|
before_script:
|
||||||
@ -113,4 +63,57 @@ pages:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG
|
||||||
|
|
||||||
|
#archive-sources: # This job runs in the build stage, which runs first.
|
||||||
|
# image: python:3
|
||||||
|
# stage: release
|
||||||
|
#
|
||||||
|
# before_script:
|
||||||
|
# - pip install git-archive-all
|
||||||
|
# - echo ARCHIVE_JOB_ID=${CI_JOB_ID} >> archives.env
|
||||||
|
# script:
|
||||||
|
# - git-archive-all ${SOURCE_ARCHIVE_NAME}
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - ${SOURCE_ARCHIVE_NAME}
|
||||||
|
# expire_in: never
|
||||||
|
# reports:
|
||||||
|
# dotenv: archives.env
|
||||||
|
# rules:
|
||||||
|
# - if: $CI_COMMIT_TAG
|
||||||
|
|
||||||
|
#release-description:
|
||||||
|
# image: golang:bullseye
|
||||||
|
# stage: release
|
||||||
|
# rules:
|
||||||
|
# - if: $CI_COMMIT_TAG
|
||||||
|
# before_script:
|
||||||
|
# - go install github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.2
|
||||||
|
# script:
|
||||||
|
# - git-chglog -o ${CHANGELOG_FILE} ${CI_COMMIT_TAG}
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - ${CHANGELOG_FILE}
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#release-create:
|
||||||
|
# stage: release
|
||||||
|
# image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
# rules:
|
||||||
|
# - if: $CI_COMMIT_TAG
|
||||||
|
# script:
|
||||||
|
# - echo "Running release job"
|
||||||
|
# needs:
|
||||||
|
# - job: archive-sources
|
||||||
|
# artifacts: true
|
||||||
|
# - job: release-description
|
||||||
|
# artifacts: true
|
||||||
|
# release:
|
||||||
|
# tag_name: $CI_COMMIT_TAG
|
||||||
|
# name: 'POET $CI_COMMIT_TAG'
|
||||||
|
# description: ${CHANGELOG_FILE}
|
||||||
|
# assets:
|
||||||
|
# links:
|
||||||
|
# - name: '${SOURCE_ARCHIVE_NAME}'
|
||||||
|
# url: 'https://git.gfz-potsdam.de/naaice/poet/-/jobs/${ARCHIVE_JOB_ID}/artifacts/file/${SOURCE_ARCHIVE_NAME}'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user