This commit is contained in:
parent
33e5367369
commit
857812a58c
13
.drone.yml
13
.drone.yml
@ -1,6 +1,6 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: default
|
name: dj-embe
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: check
|
- name: check
|
||||||
@ -12,7 +12,16 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- docker build --target check .
|
- docker build --target check .
|
||||||
|
|
||||||
- name: build
|
- name: test
|
||||||
|
image: docker:24.0.6-cli
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- name: docker-socket
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
commands:
|
||||||
|
- docker build --target test .
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
image: docker/compose:alpine-1.29.2
|
image: docker/compose:alpine-1.29.2
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
|
24
Dockerfile
24
Dockerfile
@ -5,33 +5,43 @@ RUN --mount=type=cache,target=/var/cache/apk \
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
FROM core as check
|
FROM core as build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
pip install poethepoet
|
pip install poethepoet
|
||||||
|
|
||||||
COPY ./poetry.lock ./pyproject.toml poetry.toml ./
|
COPY ./poetry.lock ./pyproject.toml ./poetry.toml ./
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pypoetry\
|
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||||
poetry install --sync
|
poetry install --sync
|
||||||
|
|
||||||
COPY ./test ./test
|
COPY ./test ./test
|
||||||
COPY ./dj-embe ./dj-embe
|
COPY ./dj-embe ./dj-embe
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM build as check
|
||||||
|
|
||||||
RUN poe lint
|
RUN poe lint
|
||||||
#RUN poe test
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FROM core as build
|
FROM build as test
|
||||||
|
|
||||||
|
RUN poe test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM core as run
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./poetry.lock ./pyproject.toml poetry.toml ./
|
COPY ./poetry.lock ./pyproject.toml ./poetry.toml ./
|
||||||
COPY ./dj-embe ./dj-embe
|
COPY ./dj-embe ./dj-embe
|
||||||
|
|
||||||
RUN poetry install --without dev --sync
|
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||||
|
poetry install --without dev --sync
|
||||||
|
|
||||||
CMD poetry run python dj-embe
|
CMD poetry run python dj-embe
|
||||||
|
@ -7,7 +7,10 @@ services:
|
|||||||
- apps
|
- apps
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: build
|
target: run
|
||||||
|
volumes:
|
||||||
|
- /tmp/dj-embe/config.toml:/app/config.toml:ro
|
||||||
|
- /tmp/dj-embe/download:/download:rw
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
apps:
|
apps:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user