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: w3c validator image: validator/validator:latest commands: - vnu static/*.html - name: markdown lint image: pipelinecomponents/markdownlint:latest commands: - mdl --style all --warnings . --- kind: pipeline name: build steps: - name: build image image: docker:stable 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:18.09-dind environment: DOCKER_TLS_CERTDIR: "" command: [ "--storage-driver=vfs", "--tls=false" ] privileged: true depends_on: - lint --- kind: pipeline name: deploy steps: - name: build image image: docker:stable environment: DOCKER_HOST: tcp://docker:2375 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: - 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