Skip to content
Snippets Groups Projects
Commit 74b06bbf authored by Andreas Huber's avatar Andreas Huber
Browse files

.gitlab-ci.yml hinzugefügt

parent ca249cb6
No related branches found
No related tags found
No related merge requests found
.pre-deploy-uber-space-setup: &pre-deploy-uber-space-setup
- 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
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
stages:
- lint
- build
- upload
lint:
stage: lint
image:
name: $CI_REGISTRY/node:current-alpine
before_script:
- yarn
- yarn bundle
script:
- yarn lint
- yarn test
build:
stage: build
image: $CI_REGISTRY/node:current-alpine
before_script:
- yarn
script:
- yarn bundle
artifacts:
expose_as: 'Built Schema'
paths:
- dist/
expire_in: 30 days
upload:latest:
stage: upload
image: $CI_REGISTRY/alpine:latest
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
- *pre-deploy-uber-space-setup
script:
- sed -i "s,API_VERSION,latest,g" dist/set-payload.schema.json
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/set-payload.schema.json fitko@dorado.uberspace.de:schema.fitko.de/fit-connect/set-payload/latest/
upload:release:
stage: upload
image: $CI_REGISTRY/alpine:latest
rules:
- if: $CI_COMMIT_TAG
before_script:
- *pre-deploy-uber-space-setup
script:
- sed -i "s,API_VERSION,$CI_COMMIT_TAG,g" dist/set-payload.schema.json
- rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/set-payload.schema.json fitko@dorado.uberspace.de:schema.fitko.de/fit-connect/set-payload/$CI_COMMIT_TAG/
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