image: docker:19.03.12-dind services: - name: docker:dind entrypoint: ["env", "-u", "DOCKER_HOST"] command: ["dockerd-entrypoint.sh"] variables: DOCKER_TLS_CERTDIR: "" DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 stages: - lint_python - lint_helm - deploy lint_helm: image: alpine/helm stage: lint_helm script: - helm lint ./helm rules: - changes: - helm/* lint_python: image: python:alpine stage: lint_python script: - pip install -q black && black --fast --check . rules: - changes: - app/* build_and_push_container: stage: deploy script: - echo "Wait for Docker daemon at tcp://localhost:2375" - while ! nc -z localhost 2375; do sleep 0.1; done # Wait until docker socket is available - docker login -u ldooks -p $DOCKER_ACCESS_TOKEN - docker build -t ldooks/dragon-bot:$CI_PIPELINE_ID -t ldooks/dragon-bot:latest . - docker push ldooks/dragon-bot:latest - docker push ldooks/dragon-bot:$CI_PIPELINE_ID - apt-get update && apt-get install -y curl - /bin/sh -c curl -sSL -o /tmp/argocd https://github.com/argoproj/argo-cd/releases/download/v2.2.4/argocd-linux-amd64 && chmod u+x /tmp/argocd - /tmp/argocd --insecure --server 192.168.1.205 --auth-token $ARGOCD_TOKEN app sync dragon-bot rules: - changes: - app/* - Dockerfile