Added drone
This commit is contained in:
parent
4b28396134
commit
62ba975afd
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
target/
|
||||||
|
.git/
|
||||||
|
.env
|
||||||
|
data/
|
31
.drone.yml
Normal file
31
.drone.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
type: docker
|
||||||
|
steps:
|
||||||
|
- name: server
|
||||||
|
image: plugins/docker
|
||||||
|
environment:
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
|
settings:
|
||||||
|
username: kasperhermansen
|
||||||
|
password:
|
||||||
|
from_secret:
|
||||||
|
docker_secret
|
||||||
|
repo: kasperhermansen/scel
|
||||||
|
tags: latest
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
cache_from: kasperhermansen/scel:latest
|
||||||
|
|
||||||
|
- name: send telegram notification
|
||||||
|
image: appleboy/drone-telegram
|
||||||
|
settings:
|
||||||
|
token:
|
||||||
|
from_secret: telegram_token
|
||||||
|
to: 2129601481
|
||||||
|
format: markdown
|
||||||
|
depends_on:
|
||||||
|
- server
|
||||||
|
when:
|
||||||
|
status: [failure]
|
||||||
|
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM rust:1.60 as builder
|
||||||
|
|
||||||
|
WORKDIR /usr/src/scel
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN --mount=type=cache,target=/usr/src/scel/target cargo build --release
|
||||||
|
RUN --mount=type=cache,target=/usr/src/scel/target cargo install --path src/cmd/scel
|
||||||
|
|
||||||
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
|
# Install YTD
|
||||||
|
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
|
||||||
|
apt-get update && apt-get install -y python3 python3-pip
|
||||||
|
RUN python3 -m pip install -U yt-dlp
|
||||||
|
|
||||||
|
# Copy binary
|
||||||
|
COPY --from=builder /usr/local/cargo/bin/scel /usr/local/bin/scel
|
||||||
|
|
||||||
|
CMD ["scel"]
|
Loading…
Reference in New Issue
Block a user