commit b14e59c76e8f5b6eda0c851061081a4b27bc77b6 Author: Guillaume Astier Ruiz Date: Tue Sep 26 22:29:03 2023 +0200 [INIT] - V1.0 diff --git a/Dockerfile.agg b/Dockerfile.agg new file mode 100644 index 0000000..6c1ec6d --- /dev/null +++ b/Dockerfile.agg @@ -0,0 +1,18 @@ +FROM rust:buster as builder + +COPY . /usr/src/ + +WORKDIR /usr/src + +RUN ["cargo", "build", "-r"] + +FROM rust:buster + +LABEL org.opencontainers.image.authors="guillaume@gazl.fr" + +COPY --from=builder /usr/src/target/release/agg /usr/local/bin/ + +WORKDIR /data + +ENTRYPOINT [ "/usr/local/bin/agg" ] + diff --git a/Dockerfile.asciinema b/Dockerfile.asciinema new file mode 100644 index 0000000..225ba0b --- /dev/null +++ b/Dockerfile.asciinema @@ -0,0 +1,25 @@ +FROM docker.io/library/ubuntu:22.04 + +ENV DEBIAN_FRONTEND="noninteractive" + +RUN apt-get update +RUN apt-get install -y ca-certificates locales python3 python3-pip +RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +COPY pyproject.toml setup.cfg *.md /usr/src/app/ +COPY doc/*.md /usr/src/app/doc/ +COPY man/asciinema.1 /usr/src/app/man/ +COPY asciinema/ /usr/src/app/asciinema/ +COPY README.md LICENSE /usr/src/app/ + +WORKDIR /usr/src/app + +RUN pip3 install . + +WORKDIR /root + +ENV LANG="en_US.utf8" +ENV SHELL="/bin/bash" + +ENTRYPOINT ["/usr/local/bin/asciinema"] +CMD ["--help"] + diff --git a/term2gif b/term2gif new file mode 100755 index 0000000..c01293d --- /dev/null +++ b/term2gif @@ -0,0 +1,31 @@ +#!/bin/bash + + +usage () { + + echo "$0 [Path To File]" + echo "Ex : $0 /home/guillaume/File.cast" + echo ".cast extension is mandatory" + exit + +} + +[[ -z $1 ]] && usage + +Dir=$(realpath $(dirname $1)) +OrigFile=$(basename $1) +BaseFile=$(echo $OrigFile| sed 's/.cast//g') +DestFile=$(basename $1| sed 's/cast/gif/g') + + + +docker run --rm -it --hostname ${BaseFile} -v "${HOME}/.config/asciinema:/root/.config/asciinema" -v ${Dir}:/data docker.tuxme.net/term2gif-run rec /data/${OrigFile} + +docker run --rm -it -u $(id -u):$(id -g) -v ${Dir}:/data docker.tuxme.net/term2gif-gif ${OrigFile} ${DestFile} + +echo " +################################################## +cast file : ${Dir}/${OrigFile} +cast file : ${Dir}/${DestFile} +################################################## +"