This commit is contained in:
parent
3ac428d04c
commit
aa11ec65e8
2 changed files with 20 additions and 61 deletions
48
.drone.yml
48
.drone.yml
|
|
@ -12,35 +12,27 @@ environment:
|
||||||
DESTINATION_PREFIX: git.roboces.dev/catalin/halig
|
DESTINATION_PREFIX: git.roboces.dev/catalin/halig
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build_base
|
- name: restore cache
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
image: meltwater/drone-cache
|
||||||
environment:
|
settings:
|
||||||
REGISTRY_USERNAME:
|
restore: true
|
||||||
from_secret: REGISTRY_USERNAME
|
mount:
|
||||||
REGISTRY_PASSWORD:
|
- .venv
|
||||||
from_secret: REGISTRY_PASSWORD
|
|
||||||
|
- name: install dependencies
|
||||||
|
image: git.roboces.dev/catalin/poetry:beta
|
||||||
commands:
|
commands:
|
||||||
- set -euo pipefail
|
- poetry config virtualenvs.in-project 1
|
||||||
- mkdir -p /kaniko/.docker
|
- poetry install --with linters
|
||||||
- echo "{\"auths\":{\"$REGISTRY_HOST\":{\"username\":\"$REGISTRY_USERNAME\",\"password\":\"$REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
|
||||||
- >
|
- name: rebuild cache
|
||||||
/kaniko/executor \
|
image: meltwater/drone-cache
|
||||||
--cache=true \
|
settings:
|
||||||
--target base \
|
restore: true
|
||||||
--context /drone/src \
|
mount:
|
||||||
--dockerfile Dockerfile \
|
- .venv
|
||||||
--destination "$DESTINATION_PREFIX:base-$DRONE_COMMIT_SHA"
|
|
||||||
- >
|
|
||||||
/kaniko/executor \
|
|
||||||
--cache=true \
|
|
||||||
--target linters \
|
|
||||||
--context /drone/src \
|
|
||||||
--dockerfile Dockerfile \
|
|
||||||
--destination "$DESTINATION_PREFIX:linters-$DRONE_COMMIT_SHA"
|
|
||||||
|
|
||||||
- name: lint
|
- name: lint
|
||||||
image: $$DESTINATION_PREFIX:linters-c84d285a66f69b9e426d52cd67c74e464a4605f6
|
image: python:3.10-slim
|
||||||
# image: git.roboces.dev/catalin/halig:linters-$$DRONE_COMMIT_SHA}
|
|
||||||
# $DESTINATION_PREFIX:linters-$DRONE_COMMIT_SHA
|
|
||||||
commands:
|
commands:
|
||||||
- pre-commit run --all-files --color always
|
- ./venv/bin/pre-commit run --all-files --color always
|
||||||
|
|
|
||||||
33
Dockerfile
33
Dockerfile
|
|
@ -1,33 +0,0 @@
|
||||||
FROM python:3.10-alpine AS base
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
curl \
|
|
||||||
gcc \
|
|
||||||
libressl-dev \
|
|
||||||
musl-dev \
|
|
||||||
git \
|
|
||||||
libffi-dev \
|
|
||||||
tzdata \
|
|
||||||
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal \
|
|
||||||
&& source $HOME/.cargo/env \
|
|
||||||
&& curl -sSL https://install.python-poetry.org | python3 - --preview \
|
|
||||||
&& ln -fs /root/.local/bin/poetry /usr/local/bin \
|
|
||||||
&& rm -rf /root/.rustup \
|
|
||||||
&& apk del \
|
|
||||||
curl \
|
|
||||||
gcc \
|
|
||||||
libressl-dev \
|
|
||||||
musl-dev \
|
|
||||||
libffi-dev \
|
|
||||||
&& mkdir /app
|
|
||||||
|
|
||||||
ENV TZ Europe/Madrid
|
|
||||||
|
|
||||||
COPY poetry.lock /app
|
|
||||||
COPY pyproject.toml /app
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
RUN poetry config virtualenvs.create false \
|
|
||||||
&& poetry install --without linters
|
|
||||||
|
|
||||||
FROM base AS linters
|
|
||||||
RUN poetry install --only linters
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue