Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit 1a9358b

Browse files
arjunrnhjacobs
authored andcommitted
Refactor code, Add Pipenv and Stackset support (#20)
* Basic refactor Signed-off-by: Arjun Naik <[email protected]> * Fixed tests and make command * Refactoring the resource types. * Fixed travis config. * Install dev packages as well. * Fixed errors from test stage * Added initial tests * Changed pipenv install. * Removed Python3.6 as target test environment * Added coverage reporting. * Added tests for forced uptime and scale up.
1 parent ff5ba65 commit 1a9358b

23 files changed

+813
-241
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
dist: xenial
2+
sudo: yes
13
language: python
24
python:
3-
- "3.6"
5+
- "3.7"
46
install:
5-
- pip install tox coveralls
7+
- pip install pipenv
8+
- pipenv install --dev
69
script:
7-
- tox
10+
- pipenv run coverage run --source=kube_downscaler -m py.test
811
after_success:
912
- coveralls

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ MAINTAINER Henning Jacobs <[email protected]>
33

44
WORKDIR /
55

6-
RUN pip3 install pykube
6+
COPY Pipfile.lock /
7+
COPY pipenv-install.py /
8+
9+
RUN /pipenv-install.py && \
10+
rm -fr /usr/local/lib/python3.7/site-packages/pip && \
11+
rm -fr /usr/local/lib/python3.7/site-packages/setuptools
12+
13+
FROM python:3.7-alpine3.8
714

815
WORKDIR /
916

17+
COPY --from=0 /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
1018
COPY kube_downscaler /kube_downscaler
1119

1220
ARG VERSION=dev

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ TAG ?= $(VERSION)
77
default: docker
88

99
test:
10-
tox
10+
pipenv run flake8
11+
pipenv run python3 -m pytest
1112

1213
docker:
1314
docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .

Pipfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
pykube = "*"
8+
pytz = "*"
9+
10+
[dev-packages]
11+
flake8 = "*"
12+
pytest-cov = "*"
13+
pytest = "*"
14+
coveralls = "*"
15+
16+
[requires]
17+
python_version = "3.7"

Pipfile.lock

Lines changed: 325 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)