Skip to content

Commit 4740af3

Browse files
author
albertovara
committed
Merge remote-tracking branch 'origin/feature/add_configmap_to_minikube'
2 parents db90d7c + c96252e commit 4740af3

File tree

6 files changed

+44
-5
lines changed

6 files changed

+44
-5
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ sudo: false
33
cache: false
44
python:
55
- '3.6'
6-
6+
addons:
7+
apt:
8+
sources:
9+
- deadsnakes
10+
packages:
11+
- python3.5
12+
- python3.5-dev
713
install:
814
- pip install -rrequirements-tests.txt
915

config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ ms:
44
APP_NAME: Template
55
APPLICATION_ROOT : /template
66
SQLALCHEMY_TRACK_MODIFICATIONS: true
7-
SECRET_KEY: "gjr39dkjn344_!67#"
7+
SECRET_KEY: "gjr39dkjn344_!67#"
8+
DATABASE: db.sqlite3
9+
SQLALCHEMY_DATABASE_URI: sqlite:///db.sqlite3

service.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# interno
21
kind: Service
32
apiVersion: v1
43
kind: Service
@@ -31,6 +30,33 @@ spec:
3130
ports:
3231
- name: http
3332
containerPort: 5000
33+
env:
34+
- name: CONFIGMAP_FILE
35+
value: "/usr/share/microservice/config.yaml"
36+
volumeMounts:
37+
- mountPath: /usr/share/microservice
38+
name: ms-config-volume
39+
volumes:
40+
- name: ms-config-volume
41+
configMap:
42+
name: template-configmap
43+
---
44+
apiVersion: v1
45+
kind: ConfigMap
46+
metadata:
47+
name: template-configmap
48+
data:
49+
# When the config map is mounted as a volume, these will be created as files.
50+
config.yaml: |-
51+
ms:
52+
DEBUG: false
53+
TESTING: false
54+
APP_NAME: Template
55+
APPLICATION_ROOT : /template
56+
SQLALCHEMY_TRACK_MODIFICATIONS: true
57+
SECRET_KEY: "gjr39dkjn344_!67#"
58+
DATABASE: db.sqlite3
59+
SQLALCHEMY_DATABASE_URI: sqlite:///db.sqlite3
3460
---
3561
apiVersion: extensions/v1beta1
3662
kind: Ingress

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
"License :: OSI Approved :: GPL License",
3131
"Operating System :: OS Independent",
3232
"Programming Language :: Python",
33+
"Programming Language :: Python :: 3.5",
3334
"Programming Language :: Python :: 3.6"
3435
],
35-
license="GPL",
36+
python_requires='>=3.5',
37+
license="GPLv3",
3638
platforms=["any"],
3739
keywords="python, microservices",
3840
url='https://github.com/python-microservices/microservices-scaffold',

tests/test_views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
def _format_response(response: Text = "") -> Union[List, Dict]:
11+
# python3.5 compatibility
12+
if isinstance(response, bytes):
13+
response = str(response, encoding="utf-8")
1114
return json.loads(response)
1215

1316

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36
2+
envlist = py36,py35
33

44
[testenv]
55
deps =

0 commit comments

Comments
 (0)