Add CircleCI config for both CSPs to: - build the Docker image and push it to the registry - run a short-lived k8s job to apply migrations and see data - update the images for the Flask pods and rq worker pods
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: migration
|
|
namespace: atat
|
|
spec:
|
|
ttlSecondsAfterFinished: 100
|
|
backoffLimit: 2
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: migration
|
|
image: $CONTAINER_IMAGE
|
|
command: [
|
|
"/bin/sh", "-c"
|
|
]
|
|
args:
|
|
- |
|
|
/opt/atat/atst/.venv/bin/python \
|
|
/opt/atat/atst/.venv/bin/alembic \
|
|
upgrade head \
|
|
&& \
|
|
/opt/atat/atst/.venv/bin/python \
|
|
/opt/atat/atst/script/seed_roles.py
|
|
envFrom:
|
|
- configMapRef:
|
|
name: atst-envvars
|
|
- configMapRef:
|
|
name: atst-worker-envvars
|
|
volumeMounts:
|
|
- name: atst-config
|
|
mountPath: "/opt/atat/atst/atst-overrides.ini"
|
|
subPath: atst-overrides.ini
|
|
volumes:
|
|
- name: atst-config
|
|
secret:
|
|
secretName: atst-config-ini
|
|
items:
|
|
- key: override.ini
|
|
path: atst-overrides.ini
|
|
mode: 0644
|
|
restartPolicy: Never
|