Compare commits

..

No commits in common. "44c2ebcb432e063cffb5fc5b89c93e059dcc1a5b" and "092f3368709f7c8a1a95d1b28965a763e2a4fd83" have entirely different histories.

3 changed files with 16 additions and 48 deletions

View file

@ -29,13 +29,13 @@ LABEL maintainer="Sebastian Ramirez <tiangolo@gmail.com>"
WORKDIR /usr/local/share/uvicorn-gunicorn WORKDIR /usr/local/share/uvicorn-gunicorn
# install uvicorn-gunicorn # install uvicorn-gunicorn
COPY ./deploy/mini-tiangolo ./ COPY "./deploy/mini-tiangolo/" "."
RUN set -ex; \ RUN set -ex; \
chmod +x start.sh; \ chmod +x start.sh; \
python3 -m pip --no-cache-dir install gunicorn; python3 -m pip --no-cache-dir install gunicorn;
CMD "/usr/local/share/uvicorn-gunicorn/start.sh" CMD ["/usr/local/share/uvicorn-gunicorn/start.sh"]
########### ###########
# web app # # web app #
@ -53,21 +53,17 @@ EXPOSE 8000
COPY api ./ COPY api ./
RUN set -ex; \ RUN set -ex; \
# building hiredis # install libs
BUILD_DEPS="${BUILD_DEPS:-} gcc libc6-dev"; \
\
# install dependencies
export DEBIAN_FRONTEND=noninteractive; \ export DEBIAN_FRONTEND=noninteractive; \
apt-get update; apt-get install --yes --no-install-recommends \ apt-get update; apt-get install --yes --no-install-recommends \
libmagic1 \ libmagic1 \
${BUILD_DEPS:-} \ # need to build hiredis
gcc \
libc-dev \
; rm -rf /var/lib/apt/lists/*; \ ; rm -rf /var/lib/apt/lists/*; \
\ \
# install ovdashboard_api # install ovdashboard_api
python3 -m pip --no-cache-dir install ./; \ python3 -m pip --no-cache-dir install ./
\
# remove buildtime dependencies
apt-get autoremove --yes --purge ${BUILD_DEPS:-};
# add prepared ovdashboard_ui # add prepared ovdashboard_ui
COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui

View file

@ -3,31 +3,10 @@
script="$( readlink -f "${0}" )" script="$( readlink -f "${0}" )"
script_dir="$( dirname "${script}" )" script_dir="$( dirname "${script}" )"
[ "$( git rev-parse --abbrev-ref HEAD )" = "develop" ] \ git_version="$( \
&& git_status="developing" git rev-parse --abbrev-ref HEAD \
git rev-parse --abbrev-ref HEAD | grep -E 'release|hotfix/' >/dev/null \ | cut -d '/' -f 2
&& git_status="releasing" )"
if [ "${git_status}" = "developing" ]; then
echo "Status: Developing"
# => version from most recent tag
git_version="$( \
git describe --tags --abbrev=0 \
| sed -E 's/^v[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9]).*$/\1/'
)"
elif [ "${git_status}" = "releasing" ]; then
echo "Status: Releasing"
# => version from releasing branch
git_version="$( \
git rev-parse --abbrev-ref HEAD \
| cut -d '/' -f 2
)"
else
echo "ERROR: Invalid git branch"
echo "ERROR: Chores cannot be run on '$( git rev-parse --abbrev-ref HEAD )'!"
exit 2
fi
api_version="$( \ api_version="$( \
grep '^version' "${script_dir}/../../api/pyproject.toml" \ grep '^version' "${script_dir}/../../api/pyproject.toml" \
@ -35,8 +14,8 @@ api_version="$( \
)" )"
ui_version="$( \ ui_version="$( \
grep '"version":' "${script_dir}/../../ui/package.json" \ python3 -c 'import sys, json; print(json.load(sys.stdin)["version"])' \
| sed -E 's/.*"version":[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9]).*$/\1/' < "${script_dir}/../../ui/package.json" \
)" )"
install_version="$( \ install_version="$( \

View file

@ -6,19 +6,12 @@ script_dir="$( dirname "${script}" )"
# shellcheck disable=SC1091 # shellcheck disable=SC1091
. "${script_dir}/check_version" . "${script_dir}/check_version"
# vars defined in `check_version` script # defined in `check_version` script
# shellcheck disable=SC2154 # shellcheck disable=SC2154
if [ "${git_status}" = "releasing" ]; then echo "${git_version}" >/dev/null
# shellcheck disable=SC2154
image_tag="${git_version}"
else
image_tag="latest"
fi
echo "Building Tag '${image_tag}'"
docker buildx build \ docker buildx build \
--pull --push \ --pull --push \
--tag "code.yavook.de/oekzident.de/ovdashboard:${image_tag}" \ --tag "code.yavook.de/oekzident.de/ovdashboard:${git_version}" \
--platform "linux/amd64,linux/arm64" \ --platform "linux/amd64,linux/arm64" \
"${script_dir}/../.." "${script_dir}/../.."