Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yankay committed Dec 16, 2021
1 parent 19c3a21 commit 2ad11f0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ COPY . /usr/share/nginx/html
EXPOSE 80

# Start Nginx and keep it running background and start php
CMD sed -i "s/ContainerID: /ContainerID: "$(hostname)"/g" /usr/share/nginx/html/index.html && nginx -g "daemon off;"
CMD bash scripts/start.sh
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ TARGETS?=linux/arm,linux/arm64,linux/amd64
GITHUB_TOKEN?=

build-container:
@git describe --tags --dirty
@docker build --build-arg BASEIMAGE=$(BASEIMAGE) -t "$(IMAGE)" --file ./Dockerfile .
# docker build -t $(IMAGE) --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg LOGCOUNTER=$(LOGCOUNTER) .

Expand Down
13 changes: 13 additions & 0 deletions charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,16 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</head>
<body>
<div class="container">
<p style="position:absolute;left:60px;top:100px;">ContainerID: </p>
<div class="heading">
<h1 class="title">2048</h1>
<div class="scores-container">
Expand Down Expand Up @@ -72,7 +71,9 @@ <h1 class="title">2048</h1>

</div>
</div>

<div id="podinfo" class="game-explanation">
PODINFO
<hr>
<p class="game-explanation">
<strong class="important">How to play:</strong> Use your <strong>arrow keys</strong> to move the tiles. When two tiles with the same number touch, they <strong>merge into one!</strong>
</p>
Expand Down
19 changes: 19 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

PODINFO=""

PODINFO+="<p><strong class=\"important\">HOST_NAME:</strong> $(hostname) </strong></p>"
if [ -n $NODE_NAME ]
then
PODINFO+="<p><strong class=\"important\">NODE_NAME:</strong> $NODE_NAME </strong></p>"
fi
if [ -n $POD_NAME ]
then
PODINFO+="<p><strong class=\"important\">POD_NAME:</strong> $POD_NAME </strong></p>"
fi
if [ -n $POD_NAMESPACE ]
then
PODINFO+="<p><strong class=\"important\">POD_NAMESPACE:</strong> $POD_NAMESPACE </strong></p>"
fi
echo sed -i "s+PODINFO+\'$PODINFO\'+g" /usr/share/nginx/html/index.html
nginx -g "daemon off;"

0 comments on commit 2ad11f0

Please sign in to comment.