diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..5382f21 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,24 @@ +kind: pipeline +type: kubernetes +name: default +metadata: + namespace: git +concurrency: + limit: 1 +trigger: + branch: + - main + event: + - push +steps: + - name: build + image: docker + privileged: true + environment: + TOKEN_DOCKER: + from_secret: docker_hub + commands: + - dockerd & + - docker login -u voidic -p $TOKEN_DOCKER + - docker buildx build --push -t voidic/tiktok-dvm:latest . + - kill $(cat /var/run/docker.pid) \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 50fa710..02bb4a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1713,25 +1713,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rust_dvm" -version = "0.1.0" -dependencies = [ - "anyhow", - "base64", - "clap", - "env_logger", - "hex", - "log", - "nostr-sdk", - "reqwest", - "serde", - "sha2", - "tokio", - "url", - "yt-dlp", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -2123,6 +2104,25 @@ dependencies = [ "syn", ] +[[package]] +name = "tiktok_dvm" +version = "0.1.0" +dependencies = [ + "anyhow", + "base64", + "clap", + "env_logger", + "hex", + "log", + "nostr-sdk", + "reqwest", + "serde", + "sha2", + "tokio", + "url", + "yt-dlp", +] + [[package]] name = "time" version = "0.3.37" diff --git a/Cargo.toml b/Cargo.toml index 6f98d7c..ac394cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rust_dvm" +name = "tiktok_dvm" version = "0.1.0" edition = "2021" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e1166ba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +ARG IMAGE=rust:bookworm +ARG FEATURES + +FROM $IMAGE AS build +WORKDIR /app/src +COPY src src +COPY Cargo.lock Cargo.lock +COPY Cargo.toml Cargo.toml +RUN cargo install --path . --root /app/build --features "${FEATURES}" + +FROM $IMAGE AS runner +LABEL org.opencontainers.image.source="https://git.v0l.io/Kieran/tiktok-dvm" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.authors="Kieran" +WORKDIR /app +COPY --from=build /app/build . +ENTRYPOINT ["./bin/tiktok_dvm"] \ No newline at end of file