Skip to content

Commit 143f6e9

Browse files
Release 0.1.6
Changelog: * Fix GUI bugs * Update sidebar menu * Add execution time to history * Add template history list * Refactoring history: user is `executor`, initiators is projects, periodic tasks and templates * Add Template option to history object * Add synced hooks (experimental) * Add user notes for all objects * Add option to project means that project updates on execute See merge request polemarch/ce!1
2 parents bbbcaf3 + ae5210a commit 143f6e9

File tree

151 files changed

+9610
-2695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+9610
-2695
lines changed

.gitlab-ci.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ variables:
77
ARTIFACT_DOWNLOAD_ATTEMPTS: 3
88
RESTORE_CACHE_ATTEMPTS: 3
99

10+
cache:
11+
paths:
12+
- .tox/
13+
14+
1015
stages:
1116
- code_standarts
1217
- build
@@ -17,7 +22,7 @@ stages:
1722

1823
.branch_tests_template: &branch_tests
1924
stage: test
20-
image: git.vst.lan/vst/tests:tox
25+
image: onegreyonewhite/tox:tox
2126
variables:
2227
TOX_ENVS: ""
2328
script:
@@ -39,7 +44,7 @@ stages:
3944

4045
.pack_tamplate: &packing-test
4146
stage: packaging-test
42-
image: git.vst.lan/vst/tests:tox
47+
image: onegreyonewhite/tox:tox
4348
variables:
4449
MYSQL_ROOT_PASSWORD: 'polemarch'
4550
MYSQL_DATABASE: 'polemarch'
@@ -86,13 +91,9 @@ stages:
8691
###########################################
8792
code_style:
8893
stage: code_standarts
89-
image: git.vst.lan/vst/tests:tox
94+
image: onegreyonewhite/tox:tox
9095
script:
9196
- make test ENVS=flake,pylint
92-
cache:
93-
paths:
94-
- .tox/pylint
95-
- .tox/flake
9697
only:
9798
- /^.{0,}issue_.*$/
9899
- developer
@@ -121,7 +122,7 @@ default_rpm_tests:
121122

122123
default_oracle_tests:
123124
<<: *packing-test
124-
image: git.vst.lan/vst/tests:oracle
125+
image: onegreyonewhite/tox:oracle
125126
script:
126127
- cat /etc/hosts
127128
- make rpm RELEASE=${CI_BUILD_ID}
@@ -133,7 +134,7 @@ default_oracle_tests:
133134

134135
default_deb_tests:
135136
<<: *packing-test
136-
image: git.vst.lan/vst/tests:ubuntu
137+
image: onegreyonewhite/tox:ubuntu
137138
script:
138139
- cat /etc/hosts
139140
- make deb RELEASE=${CI_BUILD_ID}
@@ -203,7 +204,7 @@ release_deb:
203204
stage: release
204205
only:
205206
- tags
206-
image: git.vst.lan/vst/tests:ubuntu
207+
image: onegreyonewhite/tox:ubuntu
207208
script:
208209
- make deb
209210
allow_failure: false

.pep8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[pep8]
22
ignore = E221,E222,E121,E123,E126,E226,E24,E704,E116,E731,E722,E741
33
exclude = ./polemarch/*/migrations/*,./polemarch/main/settings*.py,.tox/*,./etc/*,./*/__init__.py,./t_openstack.py
4+
max-line-length=90
45

56
[flake8]
67
ignore = E221,E222,E121,E123,E126,E226,E24,E704,E116,E731,E722,E741
78
exclude = ./polemarch/*/migrations/*,./polemarch/main/settings*.py,.tox/*,./etc/*,./*/__init__.py,./t_openstack.py,./polemarch/projects/*
9+
max-line-length=90

MANIFEST.in

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ include polemarch/main/tests/test_repo.tar
88
include requirements.txt
99
include requirements-git.txt
1010
include requirements-doc.txt
11-
recursive-include etc *
1211
recursive-include polemarch/*.c *
1312
recursive-include polemarch/doc/html *
1413
recursive-include polemarch/*.so *
1514
recursive-include polemarch/static *
16-
recursive-include polemarch/*/templates *
17-
recursive-include initbin *
18-
include Makefile
19-
include deb.mk
20-
include rpm.mk
15+
recursive-include polemarch/*/templates *

Makefile

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ COMPOSE = docker-compose-testrun.yml
2121
COMPOSE_ARGS = --abort-on-container-exit
2222
COMPLEX_TESTS_COMPOSE = docker-compose-tests.yml
2323
COMPLEX_TESTS_COMPOSE_ARGS = '--abort-on-container-exit --build'
24+
DEFAULT_PREFIX = /opt
25+
INSTALL_PREFIX = $(shell if [[ ! -z "${prefix}" ]]; then echo -n $(prefix); else echo -n $(DEFAULT_PREFIX); fi)
26+
INSTALL_DIR = $(INSTALL_PREFIX)/${NAME}
27+
INSTALL_BINDIR = $(INSTALL_DIR)/bin
28+
REQUIREMENTS = -r requirements.txt -r requirements-doc.txt
29+
TMPDIR := $(shell mktemp -d)
30+
BUILD_DIR= $(TMPDIR)
31+
PREBUILD_DIR = $(BUILD_DIR)/$(INSTALL_DIR)
32+
PREBUILD_BINDIR = $(BUILD_DIR)/$(INSTALL_BINDIR)
33+
SOURCE_DIR = $(shell pwd)
34+
2435

2536
include rpm.mk
2637
include deb.mk
2738

28-
all: compile
39+
all: compile clean_prebuild prebuild
2940

3041

3142
docs:
@@ -52,11 +63,44 @@ compile: build-clean
5263
-rm -rf polemarch/doc/*
5364
$(PY) setup.py compile -v
5465

66+
prebuild:
67+
# Create virtualenv
68+
$(PY) -m virtualenv --no-site-packages $(PREBUILD_DIR)
69+
# Install required packages
70+
$(PREBUILD_BINDIR)/pip install -U pip
71+
$(PREBUILD_BINDIR)/pip install -U dist/$(NAME)-$(VER).tar.gz $(REQUIREMENTS)
72+
$(PREBUILD_BINDIR)/pip install -U -r requirements-git.txt
73+
# RECORD files are used by wheels for checksum. They contain path names which
74+
# match the buildroot and must be removed or the package will fail to build.
75+
find $(PREBUILD_DIR) -name "RECORD" -exec rm -rf {} \;
76+
# Change the virtualenv path to the target installation direcotry.
77+
venvctrl-relocate --source=$(PREBUILD_DIR) --destination=$(INSTALL_DIR)
78+
# Remove sources for Clang
79+
find $(PREBUILD_DIR)/lib -type f -name "*.c" -print0 | xargs -0 rm -rf
80+
# Remove broken link
81+
-rm -rf $(PREBUILD_DIR)/local
82+
# Install settings
83+
-install -Dm 755 $(NAME)/main/settings.ini $(BUILD_DIR)/etc/$(USER)/settings.ini.template
84+
# Install systemd services
85+
-install -Dm 755 initbin/$(NAME)web.service $(BUILD_DIR)/etc/systemd/system/$(NAME)web.service
86+
-install -Dm 755 initbin/$(NAME)worker.service $(BUILD_DIR)/etc/systemd/system/$(NAME)worker.service
87+
# Install tmpdirs config
88+
-install -Dm 755 initbin/$(NAME).conf $(BUILD_DIR)/etc/tmpfiles.d/$(NAME).conf
89+
# Create tmpdirs
90+
-mkdir -p $(BUILD_DIR)/var/{log,run,lock}/$(NAME)
91+
5592
install:
56-
$(PIP) install dist/$(ARCHIVE) django\>=1.8,\<1.12
93+
# Change owner for packages
94+
-chown -R $(USER):$(USER) $(PREBUILD_DIR) $(BUILD_DIR)/var/{log,run,lock}/$(NAME) $(BUILD_DIR)/etc/$(USER)
95+
# Copy build
96+
cp -rf $(BUILD_DIR)/* /
97+
$(MAKE) clean_prebuild
5798

5899
uninstall:
59-
$(PIP) uninstall $(NAME)
100+
-rm -rf $(INSTALL_DIR)
101+
102+
clean_prebuild:
103+
-rm -rf $(BUILD_DIR)/*
60104

61105
clean: build-clean
62106
find ./polemarch -name "*.c" -print0 | xargs -0 rm -rf
@@ -79,13 +123,13 @@ fclean: clean
79123
find ./polemarch -name "*.c" -print0 | xargs -0 rm -rf
80124
-rm -rf .tox
81125

82-
rpm: compile
126+
rpm:
83127
echo "$$RPM_SPEC" > polemarch.spec
84128
rm -rf ~/rpmbuild
85129
mkdir -p ~/rpmbuild/SOURCES/
86130
ls -la
87-
cp -vf dist/$(ARCHIVE) ~/rpmbuild/SOURCES
88131
rpmbuild --verbose -bb polemarch.spec
132+
mkdir -p dist
89133
cp -v ~/rpmbuild/RPMS/x86_64/*.rpm dist/
90134
rm polemarch.spec
91135

@@ -108,11 +152,14 @@ deb:
108152
chmod +x debian/prerm
109153
chmod +x debian/postrm
110154
# build
111-
dpkg-buildpackage -uc -us
155+
dpkg-buildpackage -d -uc -us
112156
mv -v ../$(NAME)_$(VER)*.deb dist/
113157
# cleanup
114158
rm -rf debian
115159

160+
compose_down:
161+
docker-compose -f $(COMPOSE) down
162+
116163
compose:
117164
docker-compose -f $(COMPOSE) build
118165

deb.mk

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ export DEBIAN_COPYRIGHT
4242

4343
# paths and executables variables
4444
BUILDROOT = debian/$(NAME)
45-
INSTALLDIR = opt/$(NAME)
4645
define DEBIAN_RULES
4746
#!/usr/bin/make -f
4847
# maximum verbosity during deb build
4948
DH_VERBOSE = 1
5049
export DH_OPTIONS=-v
5150
# targets, that we want to override with no actions
51+
override_dh_auto_build:
52+
# don't need becouse all makes in 'override_dh_auto_install' target
5253
override_dh_auto_test:
5354
# don't want to test during package build
5455
override_dh_strip:
@@ -65,27 +66,7 @@ override_dh_auto_install:
6566
mkdir -p $(BUILDROOT)
6667
touch $(BUILDROOT)/dummy
6768
rm -rf $(BUILDROOT)/*
68-
# install our package with all required python dependencies in virtualenv
69-
virtualenv --no-site-packages $(BUILDROOT)/$(INSTALLDIR)
70-
rm -rf $(BUILDROOT)/$(INSTALLDIR)/local
71-
$(BUILDROOT)/$(INSTALLDIR)/bin/pip install $(PIPARGS) -r requirements-doc.txt
72-
$(BUILDROOT)/$(INSTALLDIR)/bin/pip install $(PIPARGS) dist/$(NAME)-$(VER).tar.gz
73-
$(BUILDROOT)/$(INSTALLDIR)/bin/pip install $(PIPARGS) -r requirements-git.txt
74-
find $(BUILDROOT)/ -name "RECORD" -exec rm -rf {} \;
75-
venvctrl-relocate --source=$(BUILDROOT)/$(INSTALLDIR) --destination=/$(INSTALLDIR)
76-
find $(BUILDROOT)/$(INSTALLDIR)/lib -type f -name "*.c" -print0 | xargs -0 rm -rf
77-
# system folders which is needed for application to work (lob, lock, etc)
78-
mkdir -p $(BUILDROOT)/var/log/$(NAME)
79-
mkdir -p $(BUILDROOT)/var/run/$(NAME)
80-
mkdir -p $(BUILDROOT)/var/lock/$(NAME)
81-
mkdir -p $(BUILDROOT)/etc/$(NAME)
82-
# systemd services
83-
mkdir -p $(BUILDROOT)/etc/systemd/system/
84-
mkdir -p $(BUILDROOT)/etc/tmpfiles.d/
85-
cp initbin/*.service $(BUILDROOT)/etc/systemd/system/
86-
cp initbin/*.conf $(BUILDROOT)/etc/tmpfiles.d/
87-
# settings
88-
cp $(NAME)/main/settings.ini $(BUILDROOT)/etc/$(NAME)/
69+
make BUILD_DIR=$(BUILDROOT)
8970
%:
9071
dh $$@
9172
endef

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
#
6565
# This is also used if you do content translation via gettext catalogs.
6666
# Usually you set "language" from the command line for these cases.
67-
language = None
67+
language = 'en'
6868

6969
# List of patterns, relative to source directory, that match files and
7070
# directories to ignore when looking for source files.

0 commit comments

Comments
 (0)