mentorenwahl/.drone.yml
Dominic Grimm a29251e88b
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
Update ci
2022-02-18 19:11:15 +01:00

208 lines
3.8 KiB
YAML

---
kind: pipeline
type: docker
name: default
steps:
- name: shellcheck
image: koalaman/shellcheck-alpine
commands:
- cd scripts
- find -name "*.sh" | xargs shellcheck
- name: markdownlint
image: markdownlint/markdownlint
commands:
- cd docs
- find -name "*.md" | xargs mdl
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./docs
- name: docs
image: michaelfbryan/mdbook-docker-image
volumes:
- name: cache
path: /cache
commands:
- cd docs
- mdbook build
- rm -rf /cache/*
- mkdir /cache/docs
- cp -r book/* /cache/docs
depends_on:
- markdownlint
- restore-cache
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./docs
depends_on:
- docs
volumes:
- name: cache
host:
path: /tmp/cache
---
kind: pipeline
type: docker
name: backend
steps:
- name: ameba
image: veelenga/ameba
commands:
- cd docker/backend
- ameba micrate/src src
- name: pgsanity
image: boechat107/pgsanity
commands:
- pgsanity docker/backend/db/**/*.sql
- name: deps
image: crystallang/crystal:1.3-alpine
volumes:
- name: lib
path: /drone/src/docker/backend/lib
commands:
- cd docker/backend
- shards install
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./docs
- name: docs
image: crystallang/crystal:1.3-alpine
volumes:
- name: lib
path: /drone/src/docker/backend/lib
- name: cache
path: /cache
commands:
- cd docker/backend
- make docs
- mkdir /cache/docs/api
- cp -r docs/* /cache/docs/api
depends_on:
- ameba
- deps
- restore-cache
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./docs
depends_on:
- docs
- name: build
image: tmaier/docker-compose
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- cp .example.env .env
- docker-compose build --build-arg BUILD_ENV=development backend
depends_on:
- ameba
- pgsanity
volumes:
- name: lib
temp: {}
- name: cache
host:
path: /tmp/cache
- name: dockersock
host:
path: /var/run/docker.sock
depends_on:
- default
---
kind: pipeline
type: docker
name: frontend
steps:
- name: build
image: tmaier/docker-compose
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker-compose build --build-arg BUILD_ENV=development frontend
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
depends_on:
- default
---
kind: pipeline
type: docker
name: deploy
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./docs
- name: deploy
image: alpine
environment:
HOST:
from_secret: docs_deploy_ssh_host
USER:
from_secret: docs_deploy_ssh_user
PASSWORD:
from_secret: docs_deploy_ssh_password
volumes:
- name: cache
path: /cache
commands:
- apk add --no-cache sshpass
- ls /cache/docs
volumes:
- name: cache
host:
path: /tmp/cache
depends_on:
- default
- backend
- frontend
trigger:
event:
- promote
target:
- production