Skip to content
Snippets Groups Projects
Commit cec8562f authored by David Schwarzmann's avatar David Schwarzmann
Browse files

extend ci to build a spec and release on tags

parent 149fb0ee
No related branches found
No related tags found
1 merge request!18Umbenennung von Antragsformular / Dokument in Anhang
stages:
- lint
- build
# - upload
- release
lint-job:
stage: lint
......@@ -8,4 +11,50 @@ lint-job:
name: stoplight/spectral:latest
entrypoint: [""]
script:
- spectral lint reference/*.yml reference/*.json
\ No newline at end of file
- spectral lint spec/*.yml
build:
stage: build
image: node:current-alpine
before_script:
- npm install -g @apidevtools/swagger-cli
- mkdir dist
script: swagger-cli bundle -t yaml -o dist/combined.yml spec/combined.yml' \;
# find ./spec -type f -name "*.yml" -exec sh -c 'swagger-cli bundle -t yaml -o dist/$(basename {}) {}' \;
artifacts:
expose_as: 'Built API spec'
paths:
- dist/
# upload:
# stage: upload
# image: curlimages/curl:latest
# only:
# refs:
# - master
# - tags
# except:
# - $CI_COMMIT_TAG
# script: >
# curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file dist/*.yml ${PACKAGE_REGISTRY_URL}
release-new-api-version:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: build
artifacts: true
only:
refs:
- master
- tags
variables:
- $CI_COMMIT_TAG
script:
- release-cli -v
- echo "Releasing new API version"
- release-cli create --name "v$CI_COMMIT_TAG" --description './CHANGELOG.md'
--tag-name $CI_COMMIT_TAG
# --assets-link '{"name":"matrixregistration-$CI_COMMIT_TAG","url":"https://git.fitko.de/fit-connect/FIT-Connect-PoC/-/jobs/artifacts/$CI_COMMIT_TAG/download?job=build"}'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment