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
|
|
|
|
- pylint *.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-15 16:11:36 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: build
|
2020-02-17 22:09:48 +01:00
|
|
|
#
|
|
|
|
#steps:
|
|
|
|
#- name: build image
|
|
|
|
# image: docker
|
|
|
|
# environment:
|
|
|
|
# DOCKER_HOST: tcp://docker
|
|
|
|
# USERNAME:
|
|
|
|
# from_secret: dockerhub_username
|
|
|
|
# PASSWORD:
|
|
|
|
# from_secret: dockerhub_password
|
|
|
|
# commands:
|
|
|
|
# - docker build -t kleph/beer .
|
|
|
|
# - docker login -u $USERNAME -p $PASSWORD
|
|
|
|
# - docker image push kleph/beer
|
|
|
|
#
|
|
|
|
#services:
|
|
|
|
#- name: docker
|
|
|
|
# image: docker:dind
|
|
|
|
# environment:
|
|
|
|
# DOCKER_TLS_CERTDIR: ""
|
|
|
|
# command: ["--storage-driver=vfs", "--tls=false"]
|
|
|
|
# privileged: true
|
2020-02-15 16:11:36 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
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-15 18:38:57 +01:00
|
|
|
- lint
|
2020-02-15 17:40:58 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: deploy
|
|
|
|
|
|
|
|
steps:
|
2020-02-17 22:18:23 +01:00
|
|
|
- name: deploy app
|
2020-02-15 19:02:13 +01:00
|
|
|
image: bitnami/kubectl
|
2020-02-15 17:40:58 +01:00
|
|
|
environment:
|
|
|
|
KUBE_USERNAME:
|
|
|
|
from_secret: kubectl_username
|
|
|
|
KUBE_PASSWORD:
|
|
|
|
from_secret: kubectl_password
|
|
|
|
KUBE_URI:
|
|
|
|
from_secret: kubectl_uri
|
|
|
|
KUBE_CA:
|
|
|
|
form_secret: kubectl_ca
|
|
|
|
commands:
|
2020-02-17 22:18:23 +01:00
|
|
|
- sudo apt-get update
|
|
|
|
- sudo apt-get install gettext-base
|
2020-02-15 18:38:57 +01:00
|
|
|
- cat kube/kubeconfig_template.yaml | envsubst > /.kube/config
|
|
|
|
- kubectl get pods
|
|
|
|
- kubectl get deployments
|
|
|
|
- kubectl get svc
|
|
|
|
- kubectl apply -f kube/beer-deployment.yaml
|
2020-02-15 17:40:58 +01:00
|
|
|
|
|
|
|
depends_on:
|
2020-02-15 18:38:57 +01:00
|
|
|
- build
|