Jaime Ramírez
2020-06-11 d4efcf556bee5599b87a18da9420df2143e1c757
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
 
# All objects will be created in current namespace. I recommend uncommenting the below line
# Important - run as a user with the ability to run `oc adm policy add-scc-to-user anyuid` command
# oc new-project adopt-a-pup
 
# Process templates
oc create -f templates/adoption-service-template.yaml
oc create -f animal-service-template.yaml
oc create -f email-service-template.yaml
oc create -f envoy-gateway-template.yaml
oc create -f notification-service-template.yaml
oc create -f shelter-service-template.yaml
 
# Create service account for maildev/email-service pod so it can listen on ports 25 and 80 (25 is default smtp server port)
oc create serviceaccount maildev
oc patch dc/email-service --patch '{"spec":{"template":{"spec":{"serviceAccountName": "maildev"}}}}'
oc adm policy add-scc-to-user anyuid -z maildev
 
# Create apps
oc new-app --template=openshift/mongodb-persistent --name=mongodb -e MONGODB_USER=developer -e MONGODB_PASSWORD=developer -e MONGODB_DATABASE=adopt-a-pup -n adopt-a-pup
oc new-app --name=adoption-service --template=adoption-service
oc new-app --name=animal-service --template=animal-service
oc new-app --name=email-service --template=email-service
oc new-app --name=envoy-gateway --template=envoy-gateway
oc new-app --name=notification-service --template=notification-service
oc new-app --name=shelter-service --template=shelter-service