Skip to content

Commit

Permalink
2.0.0b1
Browse files Browse the repository at this point in the history
#### 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
onegreyonewhite committed Apr 8, 2022
2 parents 3c4f983 + 8a442f9 commit 6ef1175
Show file tree
Hide file tree
Showing 126 changed files with 13,661 additions and 17,542 deletions.
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ stages:
.branch_tests_template: &branch_tests
stage: test
image: vstconsulting/images:tox
coverage: '/\d+\%\s*$/'
variables:
TOX_ENVS: ""
before_script:
Expand Down Expand Up @@ -158,7 +159,7 @@ publish_docker:
- pip install tox
- tox -e release-docker
rules:
- if: '$CI_COMMIT_TAG && $POLEMARCH_DOCKER_USER && $POLEMARCH_DOCKER_PASSWORD && $POLEMARCH_DOCKER_EMAIL && $POLEMARCH_DOCKER_IMAGE_NAME'
- if: '$CI_COMMIT_TAG && $POLEMARCH_DOCKER_USER && $POLEMARCH_DOCKER_PASSWORD && $POLEMARCH_DOCKER_IMAGE_NAME'
when: on_success
- when: never

Expand Down
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ignore=CVS,migrations,unittests,tests,settings.py,settings_production.py

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=pylint_django
# load-plugins=pylint_django

# Use multiple processes to speed up Pylint.
jobs=4
Expand Down Expand Up @@ -65,7 +65,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=logging-fstring-interpolation,unexpected-keyword-arg,no-name-in-module,useless-super-delegation,len-as-condition,super-init-not-called,keyword-arg-before-vararg,no-else-return,no-self-argument,inconsistent-return-statements,unsubscriptable-object,too-many-branches,deprecated-lambda,old-style-class,no-init,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,bad-continuation,bad-whitespace,redefined-builtin,missing-docstring,redefined-variable-type,no-self-use,line-too-long,suppressed-message,cmp-method,no-absolute-import,xrange-builtin,using-cmp-argument,basestring-builtin,backtick,unpacking-in-except,old-raise-syntax,getslice-method,long-builtin,print-statement,reduce-builtin,filter-builtin-not-iterating,import-star-module-level,unichr-builtin,dict-iter-method,range-builtin-not-iterating,file-builtin,old-division,standarderror-builtin,coerce-builtin,setslice-method,old-ne-operator,long-suffix,execfile-builtin,oct-method,metaclass-assignment,intern-builtin,apply-builtin,dict-view-method,raw_input-builtin,raising-string,coerce-method,unicode-builtin,next-method-called,hex-method,nonzero-method,round-builtin,cmp-builtin,reload-builtin,buffer-builtin,useless-suppression,zip-builtin-not-iterating,indexing-exception,map-builtin-not-iterating,delslice-method,old-octal-literal,input-builtin,parameter-unpacking,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,bad-mcs-classmethod-argument,useless-object-inheritance
disable=logging-fstring-interpolation,unexpected-keyword-arg,no-name-in-module,useless-super-delegation,len-as-condition,super-init-not-called,keyword-arg-before-vararg,no-else-return,no-self-argument,inconsistent-return-statements,unsubscriptable-object,too-many-branches,deprecated-lambda,old-style-class,no-init,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,bad-continuation,bad-whitespace,redefined-builtin,missing-docstring,redefined-variable-type,no-self-use,line-too-long,suppressed-message,cmp-method,no-absolute-import,xrange-builtin,using-cmp-argument,basestring-builtin,backtick,unpacking-in-except,old-raise-syntax,getslice-method,long-builtin,print-statement,reduce-builtin,filter-builtin-not-iterating,import-star-module-level,unichr-builtin,dict-iter-method,range-builtin-not-iterating,file-builtin,old-division,standarderror-builtin,coerce-builtin,setslice-method,old-ne-operator,long-suffix,execfile-builtin,oct-method,metaclass-assignment,intern-builtin,apply-builtin,dict-view-method,raw_input-builtin,raising-string,coerce-method,unicode-builtin,next-method-called,hex-method,nonzero-method,round-builtin,cmp-builtin,reload-builtin,buffer-builtin,useless-suppression,zip-builtin-not-iterating,indexing-exception,map-builtin-not-iterating,delslice-method,old-octal-literal,input-builtin,parameter-unpacking,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,bad-mcs-classmethod-argument,useless-object-inheritance,duplicate-code,unused-argument


[REPORTS]
Expand Down
92 changes: 66 additions & 26 deletions Dockerfile
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"]
25 changes: 25 additions & 0 deletions autobuild.sh
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
Loading

0 comments on commit 6ef1175

Please sign in to comment.