diff --git a/.drone.yml b/.drone.yml index 0948702..039e308 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,22 +1,23 @@ +--- kind: pipeline name: lint steps: -- name: pylint - image: eeacms/pylint - commands: - - pip install -r requirements.txt - - pylint *.py - -- name: docker lint - image: hadolint/hadolint - commands: - - hadolint --ignore DL3013 Dockerfile # ignore pinning version in pip - - name: yaml lint image: cytopia/yamllint commands: - - yamllint . + - yamllint . + +- name: pylint + image: eeacms/pylint + commands: + - pip install -r requirements.txt + - pylint *.py + +- name: docker lint + image: hadolint/hadolint + commands: + - hadolint --ignore DL3013 Dockerfile # ignore pinning version in pip - name: w3c validator image: validator/validator:latest @@ -26,7 +27,7 @@ steps: - name: markdown lint image: pipelinecomponents/markdownlint:latest commands: - - mdl --style all --warnings . + - mdl --style all --warnings . --- kind: pipeline @@ -47,15 +48,15 @@ steps: - docker image push kleph/beer services: - - name: docker - image: docker:18.09-dind - environment: - DOCKER_TLS_CERTDIR: "" - command: [ "--storage-driver=vfs", "--tls=false" ] - privileged: true +- name: docker + image: docker:18.09-dind + environment: + DOCKER_TLS_CERTDIR: "" + command: ["--storage-driver=vfs", "--tls=false"] + privileged: true depends_on: - - lint +- lint --- kind: pipeline @@ -75,12 +76,12 @@ steps: KUBE_CA: form_secret: kubectl_ca commands: - - kubectl - - cat kube/kubeconfig_template.yaml | envsubst > /.kube/config - - kubectl get pods - - kubectl get deployments - - kubectl get svc - - kubectl apply -f kube/beer-deployment.yaml + - kubectl + - cat kube/kubeconfig_template.yaml | envsubst > /.kube/config + - kubectl get pods + - kubectl get deployments + - kubectl get svc + - kubectl apply -f kube/beer-deployment.yaml depends_on: - - build +- build diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..9eaf5ea --- /dev/null +++ b/.yamllint @@ -0,0 +1,6 @@ +--- +extends: default + +rules: + indentation: + indent-sequences: consistent diff --git a/kube/beer-deployment.yaml b/kube/beer-deployment.yaml index f3aad88..bc17b38 100644 --- a/kube/beer-deployment.yaml +++ b/kube/beer-deployment.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -18,4 +19,3 @@ spec: imagePullPolicy: Always ports: - containerPort: 5000 - diff --git a/kube/beer-ingress.yaml b/kube/beer-ingress.yaml index c0c769c..d003247 100644 --- a/kube/beer-ingress.yaml +++ b/kube/beer-ingress.yaml @@ -1,3 +1,4 @@ +--- apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: @@ -13,4 +14,3 @@ spec: backend: serviceName: beer servicePort: 80 - diff --git a/kube/beer-service.yaml b/kube/beer-service.yaml index 5a2de90..7e7b673 100644 --- a/kube/beer-service.yaml +++ b/kube/beer-service.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Service metadata: @@ -9,4 +10,3 @@ spec: - protocol: TCP port: 80 targetPort: 5000 - diff --git a/kube/kubeconfig_template.yaml b/kube/kubeconfig_template.yaml index e2bd7e0..0832edf 100644 --- a/kube/kubeconfig_template.yaml +++ b/kube/kubeconfig_template.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 clusters: - cluster: @@ -17,4 +18,3 @@ users: user: password: ${KUBE_PASSWORD} username: ${KUBE_USERNAME} -