From ae42e5c8c4d46ce5359e4a5547bb4703021c4333 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 13 Sep 2021 22:00:22 +0200 Subject: [PATCH] add .drone.yml --- .drone.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..ed62668 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,35 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: test + image: python:3.8-alpine + pull: if-not-exists + environment: + YOUTUBE_API_KEY: + from_secret: YOUTUBE_API_KEY + YOUTUBE_CHANNEL_ID: 'UCmpilcSVu1T-AsAiiHbfpcA' + TZ: 'Europe/Berlin' + commands: + - apk --no-cache add gcc musl-dev tzdata + - pip3 install --no-cache-dir -r requirements.txt + - | + python3 -c ' + from GetLatestVideo import API + import os + + YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY') + YOUTUBE_CHANNEL_ID = os.getenv('YOUTUBE_CHANNEL_ID') + + CHANNEL_ID = [ + YOUTUBE_CHANNEL_ID + ] + + videos = [] + yt = API(YOUTUBE_API_KEY) + + for channel in CHANNEL_ID: + videos.append(yt.get_latest_video(channel)) + + print(videos)'