miniflux-filter/build.sh

34 lines
1,007 B
Bash
Raw Normal View History

#!/bin/bash
2021-11-02 19:48:26 +01:00
MF_DOCKERHUB_USER="${MF_DOCKERHUB_USER:=quotengrote}"
db_projectname="miniflux-filter"
db_commit_id=$(git rev-parse --short HEAD)
if ! shellcheck ./filter.sh; then
echo "-----------------------------------"
echo "warning: fix shellcheck errors"
exit 1
fi
if ! docker run --rm -i ghcr.io/hadolint/hadolint < dockerfile; then
echo "-----------------------------------"
echo "warning: fix hadolint errors"
exit 1
fi
# pruefe ob kw gesetzt ist
2021-11-02 19:48:26 +01:00
if [[ -z "$MF_DOCKERHUB_PASS" ]]; then
# shellcheck disable=SC2016
2021-11-02 19:48:26 +01:00
echo '"$MF_DOCKERHUB_PASS"' not set.
exit 2
fi
# login
2021-11-02 19:48:26 +01:00
docker login --username "$MF_DOCKERHUB_USER" --password "$MF_DOCKERHUB_PASS"
# latest
2021-11-02 19:48:26 +01:00
docker build -t "$MF_DOCKERHUB_USER"/"$db_projectname" .
docker push "$MF_DOCKERHUB_USER"/"$db_projectname":latest
# commit-id
2021-11-02 19:48:26 +01:00
docker tag "$MF_DOCKERHUB_USER"/"$db_projectname":latest "$MF_DOCKERHUB_USER"/"$db_projectname":"$db_commit_id"
docker push "$MF_DOCKERHUB_USER"/"$db_projectname":"$db_commit_id"