File tree Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 6
6
from flask import Flask # , jsonify
7
7
from urllib import parse
8
8
application = app = Flask (__name__ )
9
- namespace = "from-scratch"
9
+ namespace = "flask-example"
10
+ token = open ("/var/run/secrets/kubernetes.io/serviceaccount/token" ).read ()
10
11
11
12
12
13
@app .route ("/" )
@@ -51,10 +52,10 @@ def jobs():
51
52
}
52
53
}
53
54
}
54
- url = "192.168.99.100.nip.io "
55
+ url = "https:// 192.168.99.100:8443/ "
55
56
headers = {
56
57
# Anything but my local minishift token
57
- "Authorization" : "Bearer cLPT2IR0lYKps2UFmSrNyVMU84GrPM22TQ7S1mjtWQU"
58
+ "Authorization" : "Bearer " + token
58
59
}
59
60
friv = {"headers" : headers , "verify" : False }
60
61
req = requests .post (
@@ -96,3 +97,6 @@ def check_job(job):
96
97
if __name__ == "__main__" :
97
98
urllib3 .disable_warnings (urllib3 .exceptions .InsecureRequestWarning )
98
99
application .run (host = '0.0.0.0' )
100
+
101
+
102
+ # oc policy add-role-to-user edit -z default
Original file line number Diff line number Diff line change 1
- commands :
1
+ -hosts : local
2
+ vars :
3
+ name : PROJECT_NAME
4
+ description : Project Name
5
+ value : flask-example
6
+
7
+
8
+ commands :
2
9
# - oc new-project ${PROJECT_NAME}
3
- - oc delete all --selector app=${PROJECT_NAME}
4
- - oc delete secret --selector app=${PROJECT_NAME}
5
- - oc new-app openshift/templates/flask.yaml -p SOURCE_REPOSITORY_URL=https://github.com/Jimmyscene/django-ex.git
6
- paramaters :
10
+ - name : Clean up old project
11
+ command : oc delete all --selector app=${PROJECT_NAME}
12
+ - name : Delete secrets
13
+ command : oc delete secret --selector app=${PROJECT_NAME}
14
+ - name : Create new App
15
+ command : oc new-app openshift/templates/flask.yaml -p SOURCE_REPOSITORY_URL=https://github.com/Jimmyscene/django-ex.git
16
+ - name : Give edit permissions to default sa
17
+ command : oc policy add-role-to-user edit -z default
18
+
19
+
20
+ vars :
7
21
name : PROJECT_NAME
8
22
description : Project Name
9
-
23
+
You can’t perform that action at this time.
0 commit comments