Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
Closes #51, #109, #130, #129, #125, #119, #123, #112, #114, and #103

See merge request polemarch/ce!29
  • Loading branch information
onegreyonewhite committed Oct 26, 2018
2 parents 490197f + ac4d29c commit acfe77a
Show file tree
Hide file tree
Showing 232 changed files with 25,013 additions and 43,914 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[run]
source = polemarch
parallel = True
concurrency =
thread
multiprocessing
omit =
.tox/*
*/main/management/daemon.py
Expand All @@ -15,9 +20,14 @@ omit =
polemarch/wapp.py
polemarch/main/management/commands/webserver.py
polemarch/main/tests/repos.py
polemarch/main/tests/tasks.py
polemarch/main/tests/project.py
polemarch/main/tests/ansible.py
polemarch/api/v1/*
*celery_beat_scheduler.py

[report]
show_missing = True
exclude_lines =
pragma: no cover
nocv
Expand Down
191 changes: 105 additions & 86 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ variables:
GET_SOURCES_ATTEMPTS: 3
ARTIFACT_DOWNLOAD_ATTEMPTS: 3
RESTORE_CACHE_ATTEMPTS: 3
DJANGO_LOG_LEVEL: 'CRITICAL'
PUBLISH_REMOTE_NAME: "${CI_JOB_NAME}_public_${CI_COMMIT_TAG}"
PUBLISH_REMOTE_USER: ""
PUBLISH_REMOTE_TOKEN: ""
PUBLISH_REMOTE_AUTH: "${PUBLISH_REMOTE_USER}:${PUBLISH_REMOTE_TOKEN}@"
PUBLISH_REMOTE_SERVER: "gitlab.com"
PUBLISH_REMOTE_PROJECT: "vstconsulting/polemarch"
PUBLISH_REMOTE_PROJECT_SUFFIX: ".git"
PUBLISH_REMOTE_URL_SCHEMA: "https://"
PUBLISH_REMOTE_URI: "${PUBLISH_REMOTE_URL_SCHEMA}${PUBLISH_REMOTE_AUTH}${PUBLISH_REMOTE_SERVER}/${PUBLISH_REMOTE_PROJECT}${PUBLISH_REMOTE_PROJECT_SUFFIX}"
DJANGO_LOG_LEVEL: 'ERROR'
TOX_ARGS: "--workdir /cache/.tox_polemarch_${CI_BUILD_REF_NAME}"

stages:
- code_standarts
Expand All @@ -35,16 +27,24 @@ stages:
script:
- make test ENVS=$TOX_ENVS
- make build-clean
- coverage html
artifacts:
name: "coverage_branch(${CI_BUILD_REF_NAME})_${CI_BUILD_ID}"
expire_in: 1 hour
paths:
- htmlcov/
- dist/
except:
- GUI
- tags
refs:
- GUI
- tags
- issue_building
variables:
- $CI_COMMIT_MESSAGE =~ /Merge branch/
only:
changes:
- polemarch/api/*
- polemarch/main/*
- tests.py
- setup.py
- setup.cfg
- MANIFEST.in
- requirements*
- tox.ini
- .giltab-ci.yml
retry: 2

.pack_tamplate: &packing-test
Expand All @@ -55,18 +55,11 @@ stages:
MYSQL_DATABASE: 'polemarch'
MYSQL_USER: 'polemarch'
MYSQL_PASSWORD: 'polemarch'
RABBITMQ_DEFAULT_USER: 'polemarch'
RABBITMQ_DEFAULT_PASS: 'polemarch'
RABBITMQ_DEFAULT_VHOST: 'polemarch'
services:
- name: 'mysql:latest'
- name: 'mariadb:latest'
alias: 'db-server'
- name: 'memcached'
alias: 'cache-server'
- name: 'memcached'
alias: 'locks-server'
- name: 'rabbitmq:latest'
alias: 'rabbitmq-server'
- name: 'redis'
alias: 'redis-server'
artifacts:
name: "package($CI_BUILD_NAME)"
expire_in: 1 hour
Expand All @@ -75,6 +68,7 @@ stages:
allow_failure: false
only:
- master
- issue_building
retry: 2

.publish_template: &publishing
Expand All @@ -94,88 +88,84 @@ stages:
code_style:
stage: code_standarts
image: onegreyonewhite/tox:tox
variables:
TOX_ARGS: "--workdir /cache/.tox_polemarch_code"
script:
- make test ENVS=flake,pylint
except:
refs:
- tags
- issue_building
variables:
- $CI_COMMIT_MESSAGE =~ /Merge branch/
only:
- /^.{0,}issue_.*$/
- developer
- master
refs:
- /^.{0,}issue_.*$/
- developer
- master
changes:
- polemarch/api/*
- polemarch/main/*
- tests.py
- requirements*
- tox.ini
- .giltab-ci.yml
- .pep8
- .pylintrc
retry: 2

py27-django111-install:
py27-install:
<<: *branch_tests
variables:
TOX_ENVS: "$CI_BUILD_NAME"

py36-django111-install:
py36-install:
<<: *branch_tests
variables:
TOX_ENVS: "$CI_BUILD_NAME"

####################################################
# DEPRECATED
default_rpm_tests:
<<: *packing-test
script:
- cat /etc/hosts
- tox -e rpm RELEASE=${CI_BUILD_ID}
- sudo yum install dist/*.rpm -y -q
- sudo cat test_settings.ini > /etc/polemarch/settings.ini
- sudo chown polemarch:polemarch /etc/polemarch/settings.ini
- sudo -H -u polemarch /opt/polemarch/bin/pip install -r requirements-test.txt
- sudo -H -u polemarch /opt/polemarch/bin/polemarchctl test -v2 polemarch.main.tests

default_oracle_tests:
<<: *packing-test
image: onegreyonewhite/tox:oracle
script:
- cat /etc/hosts
- tox -e rpm RELEASE=${CI_BUILD_ID}
- tox ${TOX_ARGS} -e rpm RELEASE=${CI_BUILD_ID}
- sudo yum install dist/*.rpm -y -q
- sudo cat test_settings.ini > /etc/polemarch/settings.ini
- sudo chown polemarch:polemarch /etc/polemarch/settings.ini
- sudo -H -u polemarch /opt/polemarch/bin/pip install -r requirements-test.txt
- sudo -H -u polemarch /opt/polemarch/bin/polemarchctl test -v2 polemarch.main.tests
- sudo -H -u polemarch /opt/polemarch/bin/polemarchctl test -v2 polemarch.main.tests --failfast

default_deb_tests:
<<: *packing-test
image: onegreyonewhite/tox:ubuntu
script:
- cat /etc/hosts
- tox -e deb RELEASE=${CI_BUILD_ID} RELOCATE_BIN=/usr/local/bin/venvctrl-relocate
- tox ${TOX_ARGS} -e deb RELEASE=${CI_BUILD_ID} RELOCATE_BIN=/usr/local/bin/venvctrl-relocate INSTALL_PY=python3
- echo "echo 'hello'" > /bin/systemctl
- sudo apt update
- sudo apt install ./dist/*.deb -y -q
- sudo cat test_settings.ini > /etc/polemarch/settings.ini
- sudo chown polemarch:polemarch /etc/polemarch/settings.ini
- sudo -H -u polemarch /opt/polemarch/bin/pip install -r requirements-test.txt
- sudo -H -u polemarch /opt/polemarch/bin/polemarchctl test -v2 polemarch.main.tests
- sudo -H -u polemarch /opt/polemarch/bin/polemarchctl test -v2 polemarch.main.tests --failfast

# Realese
###########################################
release_rpm:
pages:
stage: release
only:
- tags
script:
# - make rpm
- make test ENVS=rpm
allow_failure: false
- make test ENVS=builddoc
- mv doc/_build/html public
artifacts:
name: "release-rpm-${CI_BUILD_REF_NAME}.${CI_BUILD_ID}"
paths:
- dist/

release_deb:
stage: release
- public
only:
- tags
image: onegreyonewhite/tox:ubuntu
script:
# - make deb RELOCATE_BIN=/usr/local/bin/venvctrl-relocate
- make test ENVS=deb
allow_failure: false
artifacts:
name: "release-rpm-${CI_BUILD_REF_NAME}.${CI_BUILD_ID}"
paths:
- dist/
refs:
- developer
changes:
- doc/*

release_pypi:
stage: release
Expand All @@ -184,7 +174,6 @@ release_pypi:
before_script:
- pip install vstcompile[doc]
script:
# - make compile
- make test ENVS=build
allow_failure: true
artifacts:
Expand All @@ -196,21 +185,51 @@ publish_pypi:
stage: publish
image: onegreyonewhite/tox:ubuntu
only:
- tags
refs:
- tags
variables:
- $PYPI_UPLOAD_PASSWORD
script:
- twine upload -u ${PYPI_UPLOAD_NAME} -p ${PYPI_UPLOAD_PASSWORD} dist/*.tar.gz

publish_gitlab:
<<: *publishing
variables:
PUBLISH_REMOTE_USER: "gitlab-ci-token"
PUBLISH_REMOTE_TOKEN: "${GITLAB_TOKEN}"
# DEPRECATED
release_rpm:
stage: release
only:
- tags
script:
- make test ENVS=rpm
allow_failure: false
artifacts:
name: "release-rpm-${CI_BUILD_REF_NAME}.${CI_BUILD_ID}"
paths:
- dist/

publish_release:
<<: *publishing
variables:
PUBLISH_REMOTE_USER: "${GITHUB_USER}"
PUBLISH_REMOTE_TOKEN: "${GITHUB_TOKEN}"
PUBLISH_REMOTE_SERVER: 'github.com'
after_script:
- make test ENVS=release
release_deb:
stage: release
only:
- tags
image: onegreyonewhite/tox:ubuntu
script:
- make test ENVS=deb
allow_failure: false
artifacts:
name: "release-rpm-${CI_BUILD_REF_NAME}.${CI_BUILD_ID}"
paths:
- dist/

# DEPRECATED
#publish_gitlab:
# <<: *publishing
# variables:
# PUBLISH_REMOTE_USER: "gitlab-ci-token"
# PUBLISH_REMOTE_TOKEN: "${GITLAB_TOKEN}"
#
#publish_release:
# <<: *publishing
# variables:
# PUBLISH_REMOTE_USER: "${GITHUB_USER}"
# PUBLISH_REMOTE_TOKEN: "${GITHUB_TOKEN}"
# PUBLISH_REMOTE_SERVER: 'github.com'
# after_script:
# - make test ENVS=release
6 changes: 3 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
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=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
disable=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


[REPORTS]
Expand Down Expand Up @@ -152,7 +152,7 @@ attr-rgx=[a-z_][a-z0-9_]{1,30}$
attr-name-hint=[a-z_][a-z0-9_]{1,30}$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
class-rgx=[_]{0,2}[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$
Expand Down Expand Up @@ -277,7 +277,7 @@ ignore-mixin-members=yes
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=vstutils.urls,vstutils.api.base,vstutils.api.views,vstutils.gui.views,vstutils.api.permissions,vstutils.api.filters,vstutils.middleware,vstutils.environment,vstutils.utils,vstutils.exceptions,vstutils.models
ignored-modules=vstutils.urls,vstutils.api.base,vstutils.api.views,vstutils.gui.views,vstutils.api.permissions,vstutils.api.filters,vstutils.middleware,vstutils.environment,vstutils.utils,vstutils.exceptions,vstutils.models,vstutils.api.decorators,vstutils.api.swagger,vstutils.api.serializers,
# ignored-modules=vstutils

# List of class names for which member attributes should not be checked (useful
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ include polemarch/main/settings.ini
include polemarch/main/tests/exemplary_complex_inventory
include polemarch/main/tests/facts_stdout
include polemarch/main/tests/stdout.txt
include polemarch/main/tests/test_repo.tar
include polemarch/main/tests/raw_stdout.txt
include polemarch/main/tests/test_repo.tar.gz
include requirements.txt
include requirements-git.txt
include requirements-test.txt
Expand Down
Loading

0 comments on commit acfe77a

Please sign in to comment.