Add Drone CI pipeline configuration and Docker setup for Jellyfin
This commit is contained in:
47
.drone.yml
Normal file
47
.drone.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: default
|
||||
|
||||
node_selector:
|
||||
physical-node: dev1
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
workspace:
|
||||
path: /drone/src
|
||||
|
||||
steps:
|
||||
- name: build multiarch from dev
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
settings:
|
||||
cache-from: [ "registry.dev.format.hu/jellyfin-init-container" ]
|
||||
registry: registry.dev.format.hu
|
||||
repo: registry.dev.format.hu/jellyfin-init-container
|
||||
tags: latest
|
||||
dockerfile: Dockerfile
|
||||
username:
|
||||
from_secret: dev-hu-registry-username
|
||||
password:
|
||||
from_secret: dev-hu-registry-password
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
|
||||
- name: pull image to dockerhub
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
settings:
|
||||
cache-from: [ "safebox/jellyfin-init-container" ]
|
||||
repo: safebox/jellyfin-init-container
|
||||
tags: latest
|
||||
username:
|
||||
from_secret: dockerhub-username
|
||||
password:
|
||||
from_secret: dockerhub-password
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk --update --no-cache add yq
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod a+x /entrypoint.sh
|
||||
|
||||
CMD /entrypoint.sh
|
20
entrypoint.sh
Normal file
20
entrypoint.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
SELECTOR=${JELLYFIN:-jellyfin}
|
||||
JELLYFIN_IP=$(hostname -i | awk '{print $1}')
|
||||
HOST_FILE=/etc/system/data/dns/hosts.local
|
||||
|
||||
EXISTS=$(grep -w -F $SELECTOR $HOST_FILE)
|
||||
if [ -n "$EXISTS" ]; then
|
||||
# selector already exists in hosts file and SCALE is not in use
|
||||
IP=$(echo $EXISTS | cut -d ' ' -f1)
|
||||
sed "s/$IP/$JELLYFIN_IP/g" $HOST_FILE >/tmp/hosts.local
|
||||
mv /tmp/hosts.local $HOST_FILE
|
||||
else
|
||||
echo "$JELLYFIN_IP $SELECTOR" >>$HOST_FILE
|
||||
fi
|
||||
|
||||
# create neccesary directories
|
||||
mkdir -p /etc/user/data/jellyfin/config
|
||||
mkdir -p /etc/system/data/jellyfin/cache
|
||||
mkdir -p /etc/user/data/jellyfin/media
|
Reference in New Issue
Block a user