This commit is contained in:
ducoterra
2020-04-22 18:24:11 -04:00
parent ad42290f8c
commit 793a27fc76
2 changed files with 3 additions and 32 deletions

View File

@@ -2,6 +2,7 @@ variables:
CI_PROJECT_DIR: "."
CI_REGISTRY_IMAGE: hub.ducoterra.net/ducoterra/django
CI_COMMIT_TAG: 3.8.2_5
DEPLOY: test
stages:
- build
@@ -27,6 +28,5 @@ launch:
- chmod +x ./kubectl
- envsubst < k8s/deploy.yaml > out.yaml
- mv out.yaml k8s/deploy.yaml
- envsubst < k8s/job.yaml > out.yaml
- mv out.yaml k8s/job.yaml
- ./kubectl apply -f k8s/
- ./kubectl rollout status deploy $DEPLOY
- ./kubectl exec -it $(kubectl get pods --selector=app=$DEPLOY --output=jsonpath='{.items[*].metadata.name}') -- python manage.py migrate

View File

@@ -1,29 +0,0 @@
apiVersion: batch/v1
kind: Job
metadata:
name: test
spec:
template:
spec:
containers:
- name: test
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
command: ["python", "manage.py", "migrate"]
volumeMounts:
- mountPath: /app/db
name: test
resources:
limits:
memory: "256Mi"
cpu: "250m"
requests:
memory: "1Mi"
cpu: "1m"
ports:
- containerPort: 8000
volumes:
- name: test
persistentVolumeClaim:
claimName: test
restartPolicy: Never
backoffLimit: 4