-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#### Changelog: * Feature: Added support of vstutils 5. * Feature: Support centrifugo for autoupdate notifications. * Feature: Infinite group nesting (for databases with CTE support). * Feature: Mapping api and gui for execution templates. * Feature: Add 2FA auth support. * Chore: Update interface for new standards. * Fix: Celery not starting in docker. * Fix: Managing Children Group via WebUI. * Fix: Cannot install from docker-compose. #### Breaking changes: * Move some api endpoints. Migrate to V3 (default version). * Changed api for templates. Closes: vstconsulting/polemarch#121 Closes: vstconsulting/polemarch#120 Closes: vstconsulting/polemarch#113 Closes: vstconsulting/polemarch#111 See merge request polemarch/ce!231
- Loading branch information
Showing
126 changed files
with
13,661 additions
and
17,542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,80 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM vstconsulting/images:tox AS build | ||
|
||
WORKDIR /usr/local/project | ||
WORKDIR /usr/local/polemarch | ||
|
||
COPY . . | ||
|
||
ENV WORKER=ENABLE \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 | ||
|
||
RUN tox -c tox_build.ini -e py36-build && \ | ||
mv dist/ environment/docker_data/ | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
--mount=type=cache,target=/cache \ | ||
--mount=type=cache,target=/usr/local/polemarch/.tox \ | ||
rm -rf dist/* && \ | ||
tox -c tox_build.ini -e py36-build | ||
|
||
############################################################### | ||
|
||
FROM alpine:3.11 | ||
FROM vstconsulting/images:python | ||
|
||
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache | ||
|
||
ENV WORKER=ENABLE \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 | ||
|
||
COPY --from=build /usr/local/project/environment/docker_data/ /etc/polemarch/ | ||
|
||
RUN cat /etc/polemarch/system_requirements.txt | xargs apk --update add && \ | ||
cat /etc/polemarch/system_requirements_build.txt | xargs apk add --virtual .build-deps && \ | ||
virtualenv -p python3 /opt/polemarch && \ | ||
/opt/polemarch/bin/pip3 install -U pip wheel setuptools && \ | ||
/opt/polemarch/bin/pip3 install -U -r /etc/polemarch/system_requirements_pip.txt && \ | ||
mkdir -p /projects /hooks && \ | ||
/opt/polemarch/bin/pip3 install -U /etc/polemarch/dist/$(ls /etc/polemarch/dist/ | grep "\.tar\.gz" | tail -1)[mysql,postgresql] && \ | ||
/opt/polemarch/bin/pip3 install paramiko && \ | ||
mkdir -p /run/openldap && \ | ||
apk --purge del .build-deps && \ | ||
rm -rf ~/.cache/pip/* && \ | ||
rm -rf /var/cache/apk/* | ||
LANG=en_US.UTF-8 \ | ||
POLEMARCH_PROJECTS_DIR=/projects | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt \ | ||
--mount=type=cache,target=/var/lib/apt \ | ||
--mount=type=cache,target=/root/.cache/pip \ | ||
--mount=type=bind,from=build,source=/usr/local/polemarch/,target=/polemarch_env \ | ||
apt update && \ | ||
apt -y install --no-install-recommends \ | ||
git \ | ||
sudo \ | ||
sshpass \ | ||
python3.8-dev \ | ||
libldap2-dev \ | ||
libldap-2.4-2 \ | ||
libsasl2-dev \ | ||
libsasl2-2 \ | ||
libffi-dev \ | ||
libffi7 \ | ||
libkrb5-dev \ | ||
krb5-multidev \ | ||
libssl-dev \ | ||
libssl1.1 \ | ||
gcc && \ | ||
python3.8 -m pip install --upgrade pip -U \ | ||
wheel \ | ||
setuptools \ | ||
cryptography \ | ||
paramiko && \ | ||
ln -s /usr/bin/python3.8 /usr/bin/python && \ | ||
mkdir -p /projects /hooks /run/openldap /etc/polemarch/hooks && \ | ||
python3.8 -m pip install /polemarch_env/dist/$(ls /polemarch_env/dist/ | grep "\.tar\.gz" | tail -1)[mysql,postgresql] && \ | ||
apt remove -y \ | ||
python3.8-dev \ | ||
libldap2-dev \ | ||
libsasl2-dev \ | ||
libssl-dev \ | ||
libkrb5-dev \ | ||
libffi-dev \ | ||
default-libmysqlclient-dev \ | ||
gcc && \ | ||
apt autoremove -y && \ | ||
rm -rf /tmp/* \ | ||
/var/tmp/* \ | ||
/var/log/apt/* | ||
|
||
RUN useradd -m -s /bin/bash -U polemarch && \ | ||
chown -R polemarch /projects /hooks /run/openldap /etc/polemarch | ||
|
||
USER polemarch | ||
|
||
WORKDIR /home/polemarch | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT [ "/opt/polemarch/bin/polemarchctl" ] | ||
CMD ["dockerrun"] | ||
ENTRYPOINT [] | ||
|
||
CMD ["/usr/local/bin/polemarchctl", "dockerrun"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
CURRENT_VERSION=$(python3 setup.py --version | tr -d '\n') | ||
TAG=$(git tag -l | tail -1 | tr -d '\n') | ||
REGISTRY_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}" | ||
|
||
export DOCKER_BUILDKIT=1 | ||
export COMPOSE_DOCKER_CLI_BUILD=1 | ||
|
||
docker_worker (){ | ||
docker tag ce_polemarch $1:$2 | ||
docker push $1:$2 | ||
} | ||
|
||
docker-compose build polemarch | ||
|
||
docker login -u "${CI_REGISTRY_USER}" -p "${CI_BUILD_TOKEN}" "${CI_REGISTRY}" | ||
docker login -u "${POLEMARCH_DOCKER_USER}" -p "${POLEMARCH_DOCKER_PASSWORD}" | ||
|
||
docker_worker ${REGISTRY_IMAGE} ${CURRENT_VERSION} | ||
docker_worker ${POLEMARCH_DOCKER_IMAGE_NAME} ${CURRENT_VERSION} | ||
|
||
if [ "${CURRENT_VERSION}" != "${TAG}" ]; then | ||
docker_worker ${REGISTRY_IMAGE} "latest" | ||
docker_worker ${POLEMARCH_DOCKER_IMAGE_NAME} "latest" | ||
fi |
Oops, something went wrong.