Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5efb93ea68 | ||
|
|
1ee6b890ef | ||
|
|
18aab648c6 | ||
|
|
57328a7fc8 | ||
|
|
948569a659 | ||
|
|
50cdfd8180 | ||
|
|
8393efa3a6 | ||
|
|
b3db1816bb | ||
|
|
7123f4c389 | ||
|
|
477ddfe165 | ||
|
|
6bc472f7fe |
@@ -43,7 +43,8 @@ deploy:
|
||||
- curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
|
||||
- chmod +x ./kubectl
|
||||
- mkdir /deploy
|
||||
- for f in $(find k8s -regex '.*\\.ya*ml); do envsubst < $f > "/deploy/$(basename $f)"; done'
|
||||
- for f in $(find k8s -regex '.*\.ya*ml'); do envsubst < $f > "/deploy/$(basename $f)"; done
|
||||
- ./kubectl apply -f /deploy
|
||||
- ./kubectl rollout status deploy $DEPLOY
|
||||
- ./kubectl exec $(./kubectl get pods --selector=app=$DEPLOY --output=jsonpath='{.items[*].metadata.name}') -- python manage.py migrate
|
||||
- POD=$(./kubectl get pods --selector=app=$DEPLOY --output=jsonpath='{.items[*].metadata.name}')
|
||||
- ./kubectl exec $POD -- python manage.py migrate
|
||||
13
.vscode/launch.json
vendored
13
.vscode/launch.json
vendored
@@ -5,7 +5,7 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: Django",
|
||||
"name": "Test",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/manage.py",
|
||||
@@ -13,6 +13,17 @@
|
||||
"test",
|
||||
],
|
||||
"django": true
|
||||
},
|
||||
{
|
||||
"name": "Run Server",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/manage.py",
|
||||
"args": [
|
||||
"runserver",
|
||||
"--noreload"
|
||||
],
|
||||
"django": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -25,7 +25,7 @@ SECRET_KEY = os.getenv("SECRET_KEY")
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True if os.getenv("DEBUG") == "True" else False
|
||||
|
||||
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS").split(",")
|
||||
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "localhost").split(",")
|
||||
|
||||
# Application definition
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ from django.urls import path, include
|
||||
from django.http import JsonResponse
|
||||
|
||||
urlpatterns = [
|
||||
path('', include('api.urls')),
|
||||
# path('api/', include('api.urls')),
|
||||
path('', include('ui.urls')),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
||||
@@ -16,7 +16,9 @@ spec:
|
||||
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: gitlab
|
||||
name: $DEPLOY
|
||||
- secretRef:
|
||||
name: django-secrets
|
||||
volumeMounts:
|
||||
- mountPath: /app/db
|
||||
name: $DEPLOY
|
||||
|
||||
@@ -6,7 +6,7 @@ import sys
|
||||
|
||||
def main():
|
||||
os.environ.setdefault('DEBUG', 'True')
|
||||
os.environ.setdefault('SECRET', 'SeVOOxOHISQZv82RfCPds0B2l8M6jGju4G8F-GcuSrc')
|
||||
os.environ.setdefault('SECRET_KEY', 'SeVOOxOHISQZv82RfCPds0B2l8M6jGju4G8F-GcuSrc')
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.section, .container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.disable-dbl-tap-zoom {
|
||||
touch-action: manipulation;
|
||||
}
|
||||
@@ -20,6 +20,7 @@ var count = document.getElementById("COUNT");
|
||||
|
||||
button.addEventListener("click", event => {
|
||||
button.disabled = true;
|
||||
button.classList.add("is-loading");
|
||||
fetch('/button', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -34,6 +35,7 @@ button.addEventListener("click", event => {
|
||||
count.innerText = data.pressed;
|
||||
}).finally(() => {
|
||||
button.disabled = false;
|
||||
button.classList.remove("is-loading");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<h1 class="title">
|
||||
The Button
|
||||
</h1>
|
||||
<button class="button is-primary" id="BUTTON">Press</button>
|
||||
<button class="button is-primary disable-dbl-tap-zoom" id="BUTTON">Press</button>
|
||||
</div>
|
||||
<div><br></div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user