2021-11-01 16:45:31 +01:00
|
|
|
#!/bin/bash
|
2021-11-02 19:48:26 +01:00
|
|
|
MF_DOCKERHUB_USER="${MF_DOCKERHUB_USER:=quotengrote}"
|
2021-11-01 16:45:31 +01:00
|
|
|
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
|
|
|
|
|
2021-11-03 18:55:00 +01:00
|
|
|
if ! docker run --rm -i ghcr.io/hadolint/hadolint < dockerfile; then
|
|
|
|
echo "-----------------------------------"
|
|
|
|
echo "warning: fix hadolint errors"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-11-01 16:45:31 +01:00
|
|
|
# pruefe ob kw gesetzt ist
|
2021-11-02 19:48:26 +01:00
|
|
|
if [[ -z "$MF_DOCKERHUB_PASS" ]]; then
|
2021-11-01 16:45:31 +01:00
|
|
|
# shellcheck disable=SC2016
|
2021-11-02 19:48:26 +01:00
|
|
|
echo '"$MF_DOCKERHUB_PASS"' not set.
|
2021-11-01 16:45:31 +01:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
# login
|
2021-11-02 19:48:26 +01:00
|
|
|
docker login --username "$MF_DOCKERHUB_USER" --password "$MF_DOCKERHUB_PASS"
|
2021-11-01 16:45:31 +01:00
|
|
|
# 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
|
2021-11-01 16:45:31 +01:00
|
|
|
# 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"
|