Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #371

Merged
merged 9 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/BuildDockerPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,13 @@ jobs:
tags: |
docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'debian-testing' || 'debian-testing-develop' }}

# TODO: No Alpine stable until 3.20 is released
# Alpine Stable:
# - file: ./Docker/Alpine.Stable.Dockerfile
# platforms: linux/amd64,linux/arm64
# cache-scope: alpine
# secrets: SAVOURY_PPA_AUTH
# tags: |
# docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'alpine' || 'alpine-develop' }}
- file: ./Docker/Alpine.Stable.Dockerfile
platforms: linux/amd64,linux/arm64
cache-scope: alpine
secrets: SAVOURY_PPA_AUTH
tags: |
docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'alpine' || 'alpine-develop' }}

# Alpine Edge:
- file: ./Docker/Alpine.Edge.Dockerfile
Expand Down Expand Up @@ -222,9 +221,8 @@ jobs:
file: debian.ver
- tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'debian-testing' || 'debian-testing-develop' }}
file: debian-testing.ver
# TODO: No Alpine stable until 3.20 is released
# - tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'alpine' || 'alpine-develop' }}
# file: alpine.ver
- tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'alpine' || 'alpine-develop' }}
file: alpine.ver
- tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'alpine-edge' || 'alpine-edge-develop' }}
file: alpine-edge.ver
- tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'ubuntu' || 'ubuntu-develop' }}
Expand Down
25 changes: 4 additions & 21 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"name": "Process Snippets Test",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/PlexCleaner/bin/Debug/net8.0/PlexCleaner.dll",
"args": [],
"cwd": "${workspaceFolder}/PlexCleaner",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"args": ["process", "--logfile", "PlexCleaner.log", "--settingsfile", "PlexCleaner.json", "--testsnippets", "--mediafiles", "D:\\Test"],
"cwd": "${workspaceFolder}/PlexCleaner/bin/Debug/net8.0",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "Docker .NET Core Attach",
"type": "docker",
"request": "attach",
"platform": "netCore",
"processId": "${command:pickRemoteProcess}"
}
}
]
}
14 changes: 8 additions & 6 deletions Docker/Alpine.Edge.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# Platforms: linux/amd64, linux/arm64
# Tag: ptr727/plexcleaner:alpine-edge

# Docker build debugging:
# --progress=plain
# --no-cache

# Test image in shell:
# docker run -it --rm --pull always --name Testing alpine:edge /bin/sh
# docker run -it --rm --pull always --name Testing ptr727/plexcleaner:alpine-edge /bin/sh
Expand Down Expand Up @@ -94,12 +98,6 @@ RUN apk add \
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/dotnet8-runtime
RUN apk add dotnet8-runtime

# Install VS debug tools
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
RUN wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh

# Install media tools
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/ffmpeg
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/mediainfo
Expand All @@ -118,6 +116,10 @@ COPY --from=builder /Builder/Publish/PlexCleaner/. /PlexCleaner
COPY /Docker/Test.sh /Test/
RUN chmod -R ugo+rwx /Test

# Copy debug tools installer script
COPY ./Docker/DebugTools.sh ./
RUN chmod ugo+rwx ./DebugTools.sh

# Copy version script
COPY /Docker/Version.sh /PlexCleaner/
RUN chmod ugo+rwx /PlexCleaner/Version.sh
Expand Down
24 changes: 12 additions & 12 deletions Docker/Alpine.Stable.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Description: Alpine Stable (3.19)
# Description: Alpine Stable (3.20)
# Based on: alpine:latest
# .NET: Alpine repository
# Platforms: linux/amd64, linux/arm64
# Tag: ptr727/plexcleaner:alpine

# TODO: 3.19 does not support Handbrake or .NET 8, wait for 3.20 to be released
# Docker build debugging:
# --progress=plain
# --no-cache

# Test image in shell:
# docker run -it --rm --pull always --name Testing alpine:latest /bin/sh
Expand Down Expand Up @@ -96,17 +98,11 @@ RUN apk add \
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/dotnet8-runtime
RUN apk add dotnet8-runtime

# Install VS debug tools
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
RUN wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh

# Install media tools
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/ffmpeg
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/mediainfo
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/mkvtoolnix
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/handbrake
# https://pkgs.alpinelinux.org/package/v3.20/community/x86_64/ffmpeg
# https://pkgs.alpinelinux.org/package/v3.20/community/x86_64/mediainfo
# https://pkgs.alpinelinux.org/package/v3.20/community/x86_64/mkvtoolnix
# https://pkgs.alpinelinux.org/package/v3.20/community/x86_64/handbrake
RUN apk add \
ffmpeg\
handbrake \
Expand All @@ -120,6 +116,10 @@ COPY --from=builder /Builder/Publish/PlexCleaner/. /PlexCleaner
COPY /Docker/Test.sh /Test/
RUN chmod -R ugo+rwx /Test

# Copy debug tools installer script
COPY ./Docker/DebugTools.sh ./
RUN chmod ugo+rwx ./DebugTools.sh

# Copy version script
COPY /Docker/Version.sh /PlexCleaner/
RUN chmod ugo+rwx /PlexCleaner/Version.sh
Expand Down
20 changes: 11 additions & 9 deletions Docker/Debian.Stable.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# Platforms: linux/amd64, linux/arm64, linux/arm/v7
# Tag: ptr727/plexcleaner:debian

# TODO: Update Msft repository when Trixie is released
# Docker build debugging:
# --progress=plain
# --no-cache

# Test image in shell:
# docker run -it --rm --pull always --name Testing debian:stable-slim /bin/bash
Expand Down Expand Up @@ -46,10 +48,11 @@ RUN apt-get update \
# Install dependencies
RUN apt-get install -y --no-install-recommends \
ca-certificates \
lsb-release \
wget

# Install .NET SDK
RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
RUN wget https://packages.microsoft.com/config/debian/$(lsb_release -sr)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
Expand Down Expand Up @@ -94,6 +97,7 @@ RUN apt-get install -y --no-install-recommends \
ca-certificates \
locales \
locales-all \
lsb-release \
p7zip-full \
tzdata \
wget \
Expand All @@ -107,19 +111,13 @@ ENV TZ=Etc/UTC \
LC_ALL=en_US.UTF-8

# Install .NET Runtime
RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
RUN wget https://packages.microsoft.com/config/debian/$(lsb_release -sr)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dotnet-runtime-8.0

# Install VS debug tools
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
RUN wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh

# Install media tools
# https://tracker.debian.org/pkg/ffmpeg
# https://tracker.debian.org/pkg/handbrake
Expand All @@ -143,6 +141,10 @@ COPY --from=builder /Builder/Publish/PlexCleaner/. /PlexCleaner
COPY /Docker/Test.sh /Test/
RUN chmod -R ugo+rwx /Test

# Copy debug tools installer script
COPY ./Docker/DebugTools.sh ./
RUN chmod ugo+rwx ./DebugTools.sh

# Copy version script
COPY /Docker/Version.sh /PlexCleaner/
RUN chmod ugo+rwx /PlexCleaner/Version.sh
Expand Down
18 changes: 11 additions & 7 deletions Docker/Debian.Testing.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# Platforms: linux/amd64, linux/arm64, linux/arm/v7
# Tag: ptr727/plexcleaner:debian-testing

# TODO: Trixie is not supported in the Msft repository, using 12/Bookworm.
# Docker build debugging:
# --progress=plain
# --no-cache

# Test image in shell:
# docker run -it --rm --pull always --name Testing debian:testing-slim /bin/bash
Expand Down Expand Up @@ -46,9 +48,11 @@ RUN apt-get update \
# Install dependencies
RUN apt-get install -y --no-install-recommends \
ca-certificates \
lsb-release \
wget

# Install .NET SDK
# TODO: Keep version number in sync with release, or use latest version published by Msft
RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
Expand Down Expand Up @@ -94,6 +98,7 @@ RUN apt-get install -y --no-install-recommends \
ca-certificates \
locales \
locales-all \
lsb-release \
p7zip-full \
tzdata \
wget \
Expand All @@ -107,19 +112,14 @@ ENV TZ=Etc/UTC \
LC_ALL=en_US.UTF-8

# Install .NET Runtime
# TODO: Keep version number in sync with release, or use latest version published by Msft
RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dotnet-runtime-8.0

# Install VS debug tools
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
RUN wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh

# Install media tools
# https://tracker.debian.org/pkg/ffmpeg
# https://tracker.debian.org/pkg/handbrake
Expand All @@ -143,6 +143,10 @@ COPY --from=builder /Builder/Publish/PlexCleaner/. /PlexCleaner
COPY /Docker/Test.sh /Test/
RUN chmod -R ugo+rwx /Test

# Copy debug tools installer script
COPY ./Docker/DebugTools.sh ./
RUN chmod ugo+rwx ./DebugTools.sh

# Copy version script
COPY /Docker/Version.sh /PlexCleaner/
RUN chmod ugo+rwx /PlexCleaner/Version.sh
Expand Down
27 changes: 27 additions & 0 deletions Docker/DebugTools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# Echo commands
set -x

# Exit on error
set -e

# Install VS debug tools to /vsdbg
# https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-dotnet-core-linux-with-ssh
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
echo "Installing VS debug tools to /vsdbg"
wget -O ./getvsdbg.sh https://aka.ms/getvsdbgsh
chmod ugo+rwx getvsdbg.sh
./getvsdbg.sh -v latest -l /vsdbg
rm getvsdbg.sh

# Install .NET diagnostic tools /dotnet-tools
# https://learn.microsoft.com/en-us/dotnet/core/diagnostics/tools-overview
# https://github.com/dotnet/diagnostics/blob/main/documentation/single-file-tools.md
RID=$(dotnet --info | grep "RID" | awk '{print $2}')
echo "Installing .NET diagnostic tools for $RID to /dotnet-tools"
mkdir -p /dotnet-tools
wget -O /dotnet-tools/dotnet-counters https://aka.ms/dotnet-counters/$RID
chmod ugo+rwx /dotnet-tools/dotnet-counters
wget -O /dotnet-tools/dotnet-dump https://aka.ms/dotnet-dump/$RID
chmod ugo+rwx /dotnet-tools/dotnet-dump
4 changes: 3 additions & 1 deletion Docker/README.m4
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ include({{debian-testing.ver}})

### `ptr727/plexcleaner:alpine`

*Alpine is [not](https://github.com/ptr727/PlexCleaner/issues/344) currently being built.*
```text
include({{alpine.ver}})
```

### `ptr727/plexcleaner:alpine-edge`

Expand Down
14 changes: 8 additions & 6 deletions Docker/Ubuntu.Devel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# Platforms: linux/amd64, linux/arm64, linux/arm/v7
# Tag: ptr727/plexcleaner:ubuntu-devel

# Docker build debugging:
# --progress=plain
# --no-cache

# Test image in shell:
# docker run -it --rm --pull always --name Testing ubuntu:devel /bin/bash
# docker run -it --rm --pull always --name Testing ptr727/plexcleaner:ubuntu-devel /bin/bash
Expand Down Expand Up @@ -99,12 +103,6 @@ ENV TZ=Etc/UTC \
RUN apt-get install -y --no-install-recommends \
dotnet-runtime-8.0

# Install VS debug tools
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
RUN wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh

# Install media tools
# https://packages.ubuntu.com/noble/ffmpeg
# https://packages.ubuntu.com/noble/handbrake-cli
Expand All @@ -128,6 +126,10 @@ COPY --from=builder /Builder/Publish/PlexCleaner/. /PlexCleaner
COPY /Docker/Test.sh /Test/
RUN chmod -R ugo+rwx /Test

# Copy debug tools installer script
COPY ./Docker/DebugTools.sh ./
RUN chmod ugo+rwx ./DebugTools.sh

# Copy version script
COPY /Docker/Version.sh /PlexCleaner/
RUN chmod ugo+rwx /PlexCleaner/Version.sh
Expand Down
14 changes: 8 additions & 6 deletions Docker/Ubuntu.Rolling.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# Platforms: linux/amd64, linux/arm64, linux/arm/v7
# Tag: ptr727/plexcleaner:ubuntu

# Docker build debugging:
# --progress=plain
# --no-cache

# Test image in shell:
# docker run -it --rm --pull always --name Testing ubuntu:rolling /bin/bash
# docker run -it --rm --pull always --name Testing ptr727/plexcleaner:ubuntu /bin/bash
Expand Down Expand Up @@ -99,12 +103,6 @@ ENV TZ=Etc/UTC \
RUN apt-get install -y --no-install-recommends \
dotnet-runtime-8.0

# Install VS debug tools
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
RUN wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh

# Install media tools
# https://packages.ubuntu.com/noble/ffmpeg
# https://packages.ubuntu.com/noble/handbrake-cli
Expand All @@ -128,6 +126,10 @@ COPY --from=builder /Builder/Publish/PlexCleaner/. /PlexCleaner
COPY /Docker/Test.sh /Test/
RUN chmod -R ugo+rwx /Test

# Copy debug tools installer script
COPY ./Docker/DebugTools.sh ./
RUN chmod ugo+rwx ./DebugTools.sh

# Copy version script
COPY /Docker/Version.sh /PlexCleaner/
RUN chmod ugo+rwx /PlexCleaner/Version.sh
Expand Down
Loading