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:
|
2020-02-15 18:38:57 +01:00
|
|
|
- hadolint --ignore DL3013 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
|
2020-02-17 22:09:48 +01:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: kleph/beer
|
2020-02-22 03:17:33 +01:00
|
|
|
tags: latest
|
2020-02-17 22:09:48 +01:00
|
|
|
username:
|
2020-02-15 12:48:36 +01:00
|
|
|
from_secret: dockerhub_username
|
2020-02-17 22:09:48 +01:00
|
|
|
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:
|
2020-02-17 22:56:48 +01:00
|
|
|
- name: deploy
|
|
|
|
image: sinlead/drone-kubectl
|
|
|
|
settings:
|
|
|
|
kubernetes_server:
|
2020-02-15 17:40:58 +01:00
|
|
|
from_secret: kubectl_uri
|
2020-02-17 22:56:48 +01:00
|
|
|
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
|