kind: pipeline type: docker name: default steps: - name: test image: python:3.9 volumes: - name: poetry_cache path: /root/.cache/pypoetry/virtualenvs - name: pip_cache path: /root/.cache/pip/ - name: poetry_bin path: /root/.local/bin - name: pre_commit_environments path: /root/.cache/pre-commit commands: - curl -sSL https://install.python-poetry.org | python3 - - export PATH="/root/.local/bin:$PATH" - poetry install - poetry run pre-commit run -a - name: build-only image: plugins/docker settings: repo: drone-ci/${DRONE_REPO_NAMESPACE,,}/${DRONE_REPO_NAME,,} dry_run: true volumes: - name: docker_sock path: /var/run/docker.sock when: ref: exclude: - refs/tags/* - name: build-and-push image: plugins/docker settings: username: from_secret: NUCNAS_DOCKER_USERNAME password: from_secret: NUCNAS_DOCKER_PASSWORD repo: docker.snas.black-burn.ch/${DRONE_REPO_NAMESPACE,,}/${DRONE_REPO_NAME,,} registry: docker.snas.black-burn.ch volumes: - name: docker_sock path: /var/run/docker.sock when: ref: - refs/tags/* - name: discord notification image: appleboy/drone-discord when: status: - failure - success settings: username: drone-ci webhook_id: from_secret: DISCORD_WEBHOOK_ID webhook_token: from_secret: DISCORD_WEBHOOK_TOKEN message: > {{#success build.status}} :green_square: {{repo.name}} #{{build.number}} {{commit.branch}} / {{truncate commit.sha 8}} / {{commit.author}} Build succeeded! {{else}} :red_square: {{repo.name}} #{{build.number}} {{commit.branch}} / {{truncate commit.sha 8}} / {{commit.author}} Build failed! {{/success}} volumes: - name: pip_cache host: path: /tmp/drone/cache/pip - name: poetry_cache host: path: /tmp/drone/cache/poetry - name: poetry_bin host: path: /tmp/drone/cache/poetry_bin - name: pre_commit_environments host: path: /tmp/drone/cache/pre_commit_environments