Newer
Older
David Schwarzmann
committed
stages:
David Schwarzmann
committed
lint-job:
stage: lint
name: $CI_REGISTRY/stoplight/spectral:latest
David Schwarzmann
committed
script:
- spectral lint spec/*.yml
build:
stage: build
image: $CI_REGISTRY/node:current-alpine
before_script:
- npm install -g @apidevtools/swagger-cli
- mkdir dist
script: swagger-cli bundle -t yaml -o dist/zustelldienst.yml spec/zustelldienst.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/
image: $CI_REGISTRY/alpine:latest
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG
before_script:
- apk add rsync openssh-client
- eval $(ssh-agent -s)
- echo "$CI_DEPLOYMENT_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$UBERSPACE_KNOWN_HOST" >> ~/.ssh/known_hosts
script:
- sed "s,REPLACEME,$CI_COMMIT_TAG/zustelldienst.yml,g" ui/config.js.template > ui/config.js
- rsync -rLvz --size-only --checksum -e "ssh -o CheckHostIP=no" --ipv4 --progress ./ui/. fitko@dorado.uberspace.de:html/
- rsync -rLvz --size-only --checksum -e "ssh -o CheckHostIP=no" --ipv4 --progress ./dist/. fitko@dorado.uberspace.de:html/$CI_COMMIT_TAG/
#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 "$CI_COMMIT_TAG" --description './CHANGELOG.md'
# --tag-name $CI_COMMIT_TAG
# --assets-link '{"name":"combined-$CI_COMMIT_TAG","url":"https://fitko.uber.space/$CI_COMMIT_TAG/zustelldienst.yml"}'