beer/.drone.yml

86 lines
1.4 KiB
YAML
Raw Normal View History

2020-02-15 18:38:57 +01:00
---
2020-02-14 01:06:37 +01:00
kind: pipeline
2020-02-15 16:11:36 +01:00
name: lint
2020-02-14 01:06:37 +01:00
steps:
2020-02-15 18:38:57 +01:00
- name: yaml lint
image: cytopia/yamllint
commands:
- yamllint .
2020-02-14 01:06:37 +01:00
- name: pylint
2020-02-15 16:28:58 +01:00
image: eeacms/pylint
2020-02-14 01:06:37 +01:00
commands:
2020-02-15 18:38:57 +01:00
- pip install -r requirements.txt
2020-02-24 23:20:20 +01:00
- pylint beer/*.py tests/*.py
2020-02-14 01:06:37 +01:00
2020-02-15 00:42:17 +01:00
- name: docker lint
2020-02-15 18:38:57 +01:00
image: hadolint/hadolint
2020-02-14 01:06:37 +01:00
commands:
- hadolint Dockerfile # ignore pinning version in pip
2020-02-15 18:31:59 +01:00
2020-02-14 01:06:37 +01:00
- name: w3c validator
image: validator/validator:latest
commands:
2020-02-15 00:42:17 +01:00
- vnu static/*.html
2020-02-15 12:57:50 +01:00
- name: markdown lint
image: pipelinecomponents/markdownlint:latest
commands:
2020-02-15 18:38:57 +01:00
- mdl --style all --warnings .
2020-02-15 12:57:50 +01:00
2020-02-24 23:20:20 +01:00
---
kind: pipeline
name: unit tests
steps:
- name: unit test
image: python:slim
commands:
- pip install -r requirements.txt
- python -m pytest tests
depends_on:
- lint
2020-02-15 16:11:36 +01:00
---
kind: pipeline
name: build
steps:
2020-02-15 00:42:17 +01:00
- name: build image
image: plugins/docker
settings:
repo: kleph/beer
2020-02-22 03:17:33 +01:00
tags: latest
username:
2020-02-15 12:48:36 +01:00
from_secret: dockerhub_username
password:
2020-02-15 12:48:36 +01:00
from_secret: dockerhub_password
2020-02-15 17:02:19 +01:00
depends_on:
2020-02-24 23:20:20 +01:00
- unit tests
2020-02-15 17:40:58 +01:00
---
kind: pipeline
name: deploy
steps:
- name: deploy
image: sinlead/drone-kubectl
settings:
kubernetes_server:
2020-02-15 17:40:58 +01:00
from_secret: kubectl_uri
kubernetes_cert:
from_secret: kubectl_cert
kubernetes_token:
from_secret: kubectl_token
2020-02-15 17:40:58 +01:00
commands:
2020-02-22 02:52:32 +01:00
- kubectl get pods --namespace=beer
- kubectl get deployments --namespace=beer
- kubectl get svc --namespace=beer
- kubectl apply -f kube/beer-deployment.yaml --namespace=beer
2020-02-15 17:40:58 +01:00
depends_on:
2020-02-15 18:38:57 +01:00
- build