fix static
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Torma Kristóf 2020-12-30 02:06:27 +01:00
parent 563f23f760
commit cef1135cab
2 changed files with 52 additions and 11 deletions

View File

@ -1,12 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Collect static files
echo "Collect static files"
python manage.py collectstatic --noinput
# Apply database migrations # Apply database migrations
echo "Apply database migrations" echo "Apply database migrations"
python manage.py migrate python manage.py migrate --noinput
# Start server # Start server
echo "Starting server" echo "Starting server"

View File

@ -42,6 +42,37 @@ spec:
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata:
name: apache-static
namespace: geogame
spec:
replicas: 1
selector:
matchLabels:
app: apache-geogame
template:
metadata:
labels:
app: apache-geogame
spec:
containers:
- name: apache-geogame
image: apache:2
imagePullPolicy: "Always"
volumeMounts:
- mountPath: /usr/local/apache2/htdocs
name: geogame-static-volume
ports:
- containerPort: 80
imagePullSecrets:
- name: regcred
volumes:
- name: geogame-static-volume
persistentVolumeClaim:
claimName: geogame-static-pv-claim
---
apiVersion: apps/v1
kind: Deployment
metadata: metadata:
name: geogame name: geogame
namespace: geogame namespace: geogame
@ -60,21 +91,16 @@ spec:
image: registry.kmlabz.com/tormakris/geogame image: registry.kmlabz.com/tormakris/geogame
imagePullPolicy: "Always" imagePullPolicy: "Always"
volumeMounts: volumeMounts:
- mountPath: /app/static
name: geogame-static-volume
- mountPath: /app/media - mountPath: /app/media
name: geogame-media-volume name: geogame-media-volume
ports: ports:
- containerPort: 8080 - containerPort: 8080
envFrom: envFrom:
- configMapRef: - configMapRef:
name: xwiki-config name: geogame-config
imagePullSecrets: imagePullSecrets:
- name: regcred - name: regcred
volumes: volumes:
- name: geogame-static-volume
persistentVolumeClaim:
claimName: geogame-static-pv-claim
- name: geogame-media-volume - name: geogame-media-volume
persistentVolumeClaim: persistentVolumeClaim:
claimName: geogame-media-pv-claim claimName: geogame-media-pv-claim
@ -94,6 +120,21 @@ spec:
selector: selector:
app: geogame app: geogame
--- ---
apiVersion: v1
kind: Service
metadata:
name: geogame-static
namespace: geogame
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
name: http
protocol: TCP
selector:
app: apache-geogame
---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
@ -114,4 +155,8 @@ spec:
- path: / - path: /
backend: backend:
serviceName: geogame serviceName: geogame
servicePort: http
- path: /static
backend:
serviceName: geogame-static
servicePort: http servicePort: http