Lint dockerfiles and add CI pipeline for linting #67

Merged
mwalbeck merged 9 commits from linting into master 2021-02-03 14:52:14 +00:00
3 changed files with 22 additions and 12 deletions
Showing only changes of commit 3073d6f018 - Show all commits

View File

@ -8,10 +8,20 @@ steps:
- name: Lint Dockerfiles
image: hadolint/hadolint
commands:
- hadolint 1.6/Dockerfile
- hadolint 1.6/Dockerfile.prod
- hadolint 1.7/Dockerfile
- hadolint 1.7/Dockerfile.prod
- hadolint */Dockerfile*
when:
status:
- failure
- success
- name: Lint entrypoint scripts
image: koalaman/shellcheck-alpine
commands:
- shellcheck entrypoint*.sh
when:
status:
- failure
- success
trigger:
event:

View File

@ -3,8 +3,8 @@ set -eu
GRAV_FOLDER=${GRAV_FOLDER:-html}
mkdir -p /var/www/$GRAV_FOLDER
cd /var/www/$GRAV_FOLDER
mkdir -p /var/www/"$GRAV_FOLDER"
cd /var/www/"$GRAV_FOLDER"
rsync -rlD --delete \
--exclude /backup/ \
@ -12,7 +12,7 @@ rsync -rlD --delete \
--exclude /tmp/ \
--exclude /vendor/ \
--exclude /user/ \
/usr/share/grav/ /var/www/$GRAV_FOLDER
/usr/share/grav/ /var/www/"$GRAV_FOLDER"
mkdir -p assets backup cache images logs tmp
@ -20,6 +20,6 @@ bin/grav install
bin/grav clearcache
chown www-data /proc/self/fd/1 /proc/self/fd/2
chown -R --from=root:root www-data:www-data /var/www/$GRAV_FOLDER
chown -R --from=root:root www-data:www-data /var/www/"$GRAV_FOLDER"
exec gosu www-data "$@"

View File

@ -8,8 +8,8 @@ GRAV_FOLDER=${GRAV_FOLDER:-html}
usermod -o -u "$UID" foo
groupmod -o -g "$GID" foo
mkdir -p /var/www/$GRAV_FOLDER
cd /var/www/$GRAV_FOLDER
mkdir -p /var/www/"$GRAV_FOLDER"
cd /var/www/"$GRAV_FOLDER"
rsync -rlD --delete \
--exclude /backup/ \
@ -17,7 +17,7 @@ rsync -rlD --delete \
--exclude /tmp/ \
--exclude /vendor/ \
--exclude /user/ \
/usr/share/grav/ /var/www/$GRAV_FOLDER
/usr/share/grav/ /var/www/"$GRAV_FOLDER"
mkdir -p assets backup cache images logs tmp
@ -25,6 +25,6 @@ bin/grav install
bin/grav clearcache
chown foo /proc/self/fd/1 /proc/self/fd/2
chown -R --from=root:root foo:foo /var/www/$GRAV_FOLDER
chown -R --from=root:root foo:foo /var/www/"$GRAV_FOLDER"
exec gosu foo "$@"