Newer
Older
David Schwarzmann
committed
- eval $(ssh-agent -s)
- echo "$CI_DEPLOYMENT_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo "$UBERSPACE_KNOWN_HOST" >> ~/.ssh/known_hosts
include:
- project: 'fit-connect/pipeline'
ref: main
file: 'workflows/no-duplicate-pipelines.gitlab-ci.yml'
David Schwarzmann
committed
David Schwarzmann
committed
stages:
David Schwarzmann
committed
image: ${CI_REGISTRY}/fit-connect/images/baseimage:latest
- redocly bundle spec/submission-api.yaml -o dist/submission-api.yaml
artifacts:
expose_as: 'Built API spec'
paths:
- dist/
David Schwarzmann
committed
stage: lint
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/stoplight/spectral:6
David Schwarzmann
committed
script:
- spectral lint spec/submission-api.yaml --verbose --display-only-failures
- spectral lint dist/submission-api.yaml --verbose --display-only-failures
variables:
DOCS_SERVER: fitko@dorado.uberspace.de
PREVIEW_LOCATION: preview.docs.fitko.dev/submission-api
LIVE_LOCATION: schema.fitko.de/fit-connect/submission-api
image: ${CI_REGISTRY}/fit-connect/images/baseimage:latest
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$PREVIEW_LOCATION/$CI_COMMIT_REF_SLUG/
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
before_script:
- ssh -o CheckHostIP=no $DOCS_SERVER mkdir -p $PREVIEW_LOCATION/$CI_COMMIT_REF_SLUG/
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./ci/index.html $DOCS_SERVER:$PREVIEW_LOCATION/$CI_COMMIT_REF_SLUG/
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./ci/rapidoc.js $DOCS_SERVER:$PREVIEW_LOCATION/$CI_COMMIT_REF_SLUG/
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/submission-api.yaml $DOCS_SERVER:$PREVIEW_LOCATION/$CI_COMMIT_REF_SLUG/
variables:
CRAWLER_URL: "https://schema.fitko.de/fit-connect/submission-api/"
CRAWLER_DOMAIN: "schema.fitko.de"
CRAWL_ONE_DOMAIN_ONLY: "yes"
trigger:
strategy: depend
project: fit-connect/schema-link-checker
branch: main
David Schwarzmann
committed
stage: upload
image: ${CI_REGISTRY}/fit-connect/images/baseimage:latest
David Schwarzmann
committed
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
David Schwarzmann
committed
script:
- sed -i "s,API_VERSION,latest-dev,g" dist/submission-api.yaml
- ssh -o CheckHostIP=no $DOCS_SERVER mkdir -p $LIVE_LOCATION/latest-dev/
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/submission-api.yaml $DOCS_SERVER:$LIVE_LOCATION/latest-dev/
David Schwarzmann
committed
stage: upload
image: ${CI_REGISTRY}/fit-connect/images/baseimage:latest
David Schwarzmann
committed
rules:
- if: $CI_COMMIT_TAG
- sed -i "s,API_VERSION,$CI_COMMIT_TAG,g" dist/submission-api.yaml
- ssh -o CheckHostIP=no $DOCS_SERVER mkdir -p $LIVE_LOCATION/$CI_COMMIT_TAG/
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/submission-api.yaml $DOCS_SERVER:$LIVE_LOCATION/$CI_COMMIT_TAG/
- ssh -o CheckHostIP=no $DOCS_SERVER mkdir -p $LIVE_LOCATION/latest/
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/submission-api.yaml $DOCS_SERVER:$LIVE_LOCATION/latest/
image: ${CI_REGISTRY}/fit-connect/images/baseimage:latest
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
needs:
rules:
- if: $CI_MERGE_REQUEST_ID
when: manual
before_script:
- ssh $DOCS_SERVER "rm -rf $PREVIEW_LOCATION/$CI_COMMIT_REF_SLUG/"