This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from LizardByte/nightly
v0.0.2
- Loading branch information
Showing
11 changed files
with
258 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# ignore git files | ||
.git* | ||
|
||
# ignore hidden files | ||
.* | ||
|
||
# ignore directories | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
linux/amd64,linux/arm64/v8,linux/arm/v7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
name: CI Docker | ||
|
||
on: | ||
pull_request: | ||
branches: [master, nightly] | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: [master, nightly] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check_dockerfile: | ||
name: Check Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check | ||
id: check | ||
run: | | ||
if [ -f "./Dockerfile" ] | ||
then | ||
FOUND=true | ||
else | ||
FOUND=false | ||
fi | ||
echo "::set-output name=dockerfile::${FOUND}" | ||
outputs: | ||
dockerfile: ${{ steps.check.outputs.dockerfile }} | ||
|
||
lint_dockerfile: | ||
name: Lint Dockerfile | ||
needs: [check_dockerfile] | ||
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Lint Dockerfile | ||
uses: actions/checkout@v3 | ||
|
||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: ./Dockerfile | ||
|
||
check_changelog: | ||
name: Check Changelog | ||
needs: [check_dockerfile] | ||
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Verify Changelog | ||
id: verify_changelog | ||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} | ||
# base_ref for pull request check, ref for push | ||
uses: LizardByte/.github/actions/verify_changelog@master | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
outputs: | ||
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }} | ||
|
||
docker: | ||
name: Docker | ||
needs: [check_dockerfile, check_changelog] | ||
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Prepare | ||
id: prepare | ||
env: | ||
NEXT_VERSION: ${{ needs.check_changelog.outputs.next_version }} | ||
run: | | ||
# get branch name | ||
BRANCH=${GITHUB_HEAD_REF} | ||
if [ -z "$BRANCH" ] | ||
then | ||
echo "This is a PUSH event" | ||
BRANCH=${{ github.ref_name }} | ||
fi | ||
# determine to push image to dockerhub and ghcr or not | ||
if [[ $GITHUB_EVENT_NAME == "push" ]]; then | ||
PUSH=true | ||
else | ||
PUSH=false | ||
fi | ||
# setup the tags | ||
REPOSITORY=${{ github.repository }} | ||
BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]') | ||
COMMIT=${{ github.sha }} | ||
TAGS="${BASE_TAG}:${COMMIT:0:7},ghcr.io/${BASE_TAG}:${COMMIT:0:7}" | ||
if [[ $GITHUB_REF == refs/heads/master ]]; then | ||
TAGS="${TAGS},${BASE_TAG}:latest,ghcr.io/${BASE_TAG}:latest" | ||
TAGS="${TAGS},${BASE_TAG}:master,ghcr.io/${BASE_TAG}:master" | ||
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then | ||
TAGS="${TAGS},${BASE_TAG}:nightly,ghcr.io/${BASE_TAG}:nightly" | ||
else | ||
TAGS="${TAGS},${BASE_TAG}:test,ghcr.io/${BASE_TAG}:test" | ||
fi | ||
if [[ ${NEXT_VERSION} != "" ]]; then | ||
TAGS="${TAGS},${BASE_TAG}:${NEXT_VERSION},ghcr.io/${BASE_TAG}:${NEXT_VERSION}" | ||
fi | ||
# read the platforms from `.docker_platforms` | ||
PLATFORMS=$(<.docker_platforms) | ||
echo ::set-output name=branch::${BRANCH} | ||
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
echo ::set-output name=commit::${COMMIT} | ||
echo ::set-output name=platforms::${PLATFORMS} | ||
echo ::set-output name=push::${PUSH} | ||
echo ::set-output name=tags::${TAGS} | ||
- name: Set Up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
id: buildx | ||
|
||
- name: Cache Docker Layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Log in to Docker Hub | ||
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Log in to the Container registry | ||
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GH_BOT_NAME }} | ||
password: ${{ secrets.GH_BOT_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./ | ||
file: ./Dockerfile | ||
push: ${{ steps.prepare.outputs.push }} | ||
platforms: ${{ steps.prepare.outputs.platforms }} | ||
build-args: | | ||
BRANCH=${{ steps.prepare.outputs.branch }} | ||
BUILD_DATE=${{ steps.prepare.outputs.build_date }} | ||
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} | ||
COMMIT=${{ steps.prepare.outputs.commit }} | ||
tags: ${{ steps.prepare.outputs.tags }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: Update Docker Hub Description | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported | ||
repository: ${{ env.BASE_TAG }} | ||
short-description: ${{ github.event.repository.description }} | ||
readme-filepath: ./DOCKER_README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Changelog | ||
|
||
## [0.0.2] - 2022-09-11 | ||
### Added | ||
- Add docker-mod for linuxserver plex image | ||
- | ||
## [0.0.1] - 2022-09-09 | ||
### Added | ||
- Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Docker | ||
|
||
This is a docker mod for Plex which adds [PlexyGlass](https://github.com/LizardByte/PlexyGlass) to Plex as a plugin, | ||
to be downloaded/updated during container start. | ||
|
||
In plex docker arguments, set an environment variable `DOCKER_MODS=lizardbyte/plexyglass:latest` | ||
|
||
If adding multiple mods, enter them in an array separated by `|`, such as | ||
`DOCKER_MODS=lizardbyte/plexyglass:latest|linuxserver/mods:other-plex-mod` | ||
|
||
For more information about linuxserver docker-mods, see [here](https://linuxserver.github.io/docker-mods/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# buildstage | ||
FROM python:2.7.18-alpine3.11 as buildstage | ||
|
||
# build args | ||
ARG BUILD_VERSION | ||
ARG COMMIT | ||
ARG GITHUB_SHA=$COMMIT | ||
# note: BUILD_VERSION may be blank, COMMIT is also available | ||
# note: build_plist.py uses BUILD_VERSION and GITHUB_SHA | ||
|
||
# setup build directory | ||
RUN mkdir /build | ||
WORKDIR /build/ | ||
|
||
# copy repo | ||
COPY . . | ||
|
||
RUN python # update pip \ | ||
-m pip --no-python-version-warning --disable-pip-version-check install --upgrade pip==20.3.4 setuptools \ | ||
&& python -m pip install --upgrade -r requirements-dev.txt # install dev requirements \ | ||
&& python ./scripts/install_requirements.py # install plugin requirements \ | ||
&& python ./scripts/build_plist.py # build plist \ | ||
&& rm -r ./scripts/ # remove scripts dir | ||
|
||
# single layer deployed image | ||
FROM scratch | ||
|
||
# variables | ||
ARG PLUGIN_NAME="PlexyGlass.bundle" | ||
ARG PLUGIN_DIR="/config/Library/Application Support/Plex Media Server/Plug-ins" | ||
|
||
# add files from buildstage | ||
COPY --from=buildstage /build/ $PLUGIN_DIR/$PLUGIN_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:github_url: https://github.com/LizardByte/PlexyGlass/tree/nightly/DOCKER_README.md | ||
|
||
.. mdinclude:: ../../../DOCKER_README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
about/overview | ||
about/installation | ||
about/docker | ||
about/usage | ||
|
||
.. toctree:: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters