From f83a8a06f5c553b6accc9b3d2a0e0952c1ea3edb Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sun, 9 Feb 2020 14:12:54 -0600 Subject: [PATCH] Initial commit --- Dockerfile | 22 ++++++++++++++++++++++ README.md | 5 +++++ check_movies.sh | 24 ++++++++++++++++++++++++ pipeline.yml | 30 ++++++++++++++++++++++++++++++ upload_pipeline.sh | 11 +++++++++++ 5 files changed, 92 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 check_movies.sh create mode 100644 pipeline.yml create mode 100644 upload_pipeline.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5751a8e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:buster-slim + +LABEL maintainer="Drew Short " + +RUN mkdir -p /opt/checker \ + /source + +VOLUME /source + +COPY . /opt/checker + +RUN chmod +x /opt/checker/check_movies.sh + +RUN apt-get -y update \ + && apt-get -y --no-install-recommends install \ + bsdmainutils \ + ffmpeg \ + jq \ + util-linux \ + && rm -Rf /var/lib/apt/lists/* + +WORKDIR /opt/checker diff --git a/README.md b/README.md new file mode 100644 index 0000000..57545aa --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Ren'Py Movie Checker + +[![Concourse](https://concourse.nulloctet.com/api/v1/teams/docker/pipelines/renpy-movie-checker/jobs/build-image/badge)](https://concourse.nulloctet.com/teams/docker/pipelines/renpy-movie-checker) + +Docker image build for checking renpy movies diff --git a/check_movies.sh b/check_movies.sh new file mode 100644 index 0000000..c329996 --- /dev/null +++ b/check_movies.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -e + +usage(){ + echo "usage: check_movies.sh " + exit 1 +} + +start_dir=$(pwd) + +source_dir="$1" +video_length_temp="$(mktemp)" + +cd "$source_dir" + +printf "File:\tLength:\n" > "$video_length_temp" +find . -type f -name "*.webm" | xargs -I{} ffprobe -v quiet -print_format json -show_format {} | jq -r '.format | "\(.filename)\t\(.duration)"' | cut -c 3- >> "$video_length_temp" +column -t < "$video_length_temp" +rm "$video_length_temp" + +cd "$start_dir" + +exit 0 \ No newline at end of file diff --git a/pipeline.yml b/pipeline.yml new file mode 100644 index 0000000..368ef41 --- /dev/null +++ b/pipeline.yml @@ -0,0 +1,30 @@ +--- +resources: + - name: git-resource + type: git + icon: git + source: + uri: https://git.nulloctet.com/docker/renpy-movie-checker.git + ignore_paths: + - pipeline.yml + - upload_pipeline.sh + - README.md + - name: git-resource-image + type: docker-image + icon: docker + source: + repository: ((nexus_docker_write.host))/sothr/renpy-movie-checker + username: ((nexus_docker_write.username)) + password: ((nexus_docker_write.password)) + +jobs: + - name: build-image + plan: + - get: git-resource + trigger: true + - put: git-resource-image + params: + build: git-resource + tag_file: git-resource/tag + tag_as_latest: true + get_params: {skip_download: true} diff --git a/upload_pipeline.sh b/upload_pipeline.sh new file mode 100644 index 0000000..04ae890 --- /dev/null +++ b/upload_pipeline.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +TEAM=docker +PIPELINE=renpy-movie-checker + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +pushd "${DIR}" || true + +fly -t ${TEAM} set-pipeline --pipeline ${PIPELINE} --config pipeline.yml + +popd || true