Skip to content

Commit

Permalink
Update README, add ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
themoosman committed Dec 2, 2020
1 parent bc55bcb commit 066b30f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
20 changes: 13 additions & 7 deletions .ocp/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ objects:
deploymentconfig: ${APP_NAME}
spec:
containers:
- image: ${NAMESPACE}/${IMAGE_NAME}:${IMAGE_VERSION}
- image: ${IMAGE_NAME}
imagePullPolicy: Always
env:
- name: DEPLOY_ENV
value: ${ENVIRONMENT}
livenessProbe:
exec:
command:
Expand Down Expand Up @@ -85,16 +88,16 @@ objects:
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
- type: ImageChange
imageChangeParams:
automatic: false
containerNames:
- ${IMAGE_NAME}
from:
kind: ImageStreamTag
name: ${IMAGE_NAME}:latest
name: ${IMAGE_NAME}:${IMAGE_VERSION}
namespace: ${NAMESPACE}
type: ImageChange

- apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -173,4 +176,7 @@ parameters:
- description: Name of a service account that can deploy to this project
name: SA_NAME
required: true
value: py-crash-sa
value: py-crash-sa
- description: Test ENV Var
name: ENVIRONMENT
required: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ oc new-project py-crash-me-dev
oc process -f build.yaml -p NAMESPACE=py-crash-me-dev | oc create -f -
#Create the DEV deployment resources
oc process -f deployment.yaml -p NAMESPACE=py-crash-me-dev -p IMAGE_NAMESPACE=py-crash-me-dev | oc create -f -
oc process -f deployment.yaml -p NAMESPACE=py-crash-me-dev -p IMAGE_NAMESPACE=py-crash-me-dev -p ENVIRONMENT=dev | oc create -f -
#Start the build
oc start-build py-crash-me
Expand All @@ -35,7 +35,7 @@ oc rollout latest dc/py-crash-me
oc new-project py-crash-me-qa
#Create the QA deployment resources
oc process -f deployment.yaml -p NAMESPACE=py-crash-me-qa -p IMAGE_NAMESPACE=py-crash-me-dev | oc create -f -
oc process -f deployment.yaml -p NAMESPACE=py-crash-me-qa -p IMAGE_NAMESPACE=py-crash-me-dev -p ENVIRONMENT=qa | oc create -f -
#Tag the images from DEV to QA
oc tag py-crash-me-dev/py-crash-me:latest py-crash-me-qa/py-crash-me:latest
Expand Down
4 changes: 4 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def healthz():
#i.e. database connection, queue connection, service connection, etc
return "OK\r\n"

@application.route("/env")
def env():
return os.environ['DEPLOY_ENV']

@application.route('/badhealthz')
def badhealtz():
#Endpoint for a bad health check, just return a HTTP error code > 400
Expand Down

0 comments on commit 066b30f

Please sign in to comment.