[INIT] - V1.0

This commit is contained in:
Prof Isen 2023-09-26 22:29:03 +02:00
commit b14e59c76e
3 changed files with 74 additions and 0 deletions

18
Dockerfile.agg Normal file
View File

@ -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" ]

25
Dockerfile.asciinema Normal file
View File

@ -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"]

31
term2gif Executable file
View File

@ -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}
##################################################
"