Skip to content
This repository was archived by the owner on Nov 11, 2019. It is now read-only.
Open
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
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine
MAINTAINER Shamil Ganiev <samolander@yandex.ru>

WORKDIR /srv

COPY cmd.sh /usr/bin

RUN apk add --no-cache optipng bash git \
&& echo 'PS1="\[\e[1;32m\][\u@\h \[\e[1;34m\]\W \[\e[1;32m\]]\[\033[00m\] "' > /root/.bashrc

CMD [ "cmd.sh" ]
11 changes: 11 additions & 0 deletions cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

modified_files=`git diff --cached --name-only | grep .png`
current_dir=`pwd`
echo $modified_files
if [ -z "$modified_files" ];then
exit 0
else
for i in ${modified_files}; do optipng -o7 -quiet ${i}; done
fi