From 993a94ddb14c92d4f5bb28a17e0586982b8e9d5f Mon Sep 17 00:00:00 2001 From: Chris Plaatjes Date: Tue, 14 Feb 2023 15:06:39 -0500 Subject: [PATCH] Updated build task --- .drone.yml | 34 ++++++++++++++++------------------ Dockerfile | 13 ++++++++----- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index bb8bee7..dc7d8bc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,24 +1,22 @@ --- kind: pipeline type: docker -name: build-app +name: publish-bot -steps: -- name: build-dotnet - image: mcr.microsoft.com/dotnet/sdk:6.0 - commands: - - dotnet build - -steps: -- name: build-docker - image: docker:dind - volumes: - - name: dockersock - path: /var/run/docker.sock +- name: build-image + image: plugins/docker + settings: + registry: git.kizaing.ca + username: + from_secret: DOCKER_USER + password: + from_secret: DOCKER_PASS + repo: git.kizaing.ca/kizaing/TeleTok + tags: latest # Commented out until stuff actually works -#trigger: -# branch: -# - main -# event: -# - push \ No newline at end of file +trigger: + branch: + - main + event: + - push \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9afbfcd..c2f75c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ +#Builds the bot from source +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-task + +COPY . /build +RUN cd /build && dotnet publish + +# Actually runs the bot FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3 WORKDIR /app/teletok -RUN apk update && apk add --update nodejs nodejs-npm - -RUN npm i -g tiktok-scraper - -COPY bin/Debug/net6.0/* /app/teletok/ +COPY --from=build-task /build/bin/Debug/net6.0/publish/* /app/teletok/ CMD [ "TeleTok" ] \ No newline at end of file