77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
---
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: pump-bot-api-tests
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: pump-bot-api-tests
|
|
spec:
|
|
restartPolicy: Never
|
|
initContainers:
|
|
- name: remove-old-files
|
|
image: alpine/git
|
|
command:
|
|
- "sh"
|
|
- "-c"
|
|
- >
|
|
find /pump.bot/ -mindepth 1 -delete;
|
|
volumeMounts:
|
|
- name: pump-bot-storage
|
|
mountPath: /pump.bot
|
|
- name: clone-repo
|
|
image: alpine/git
|
|
command:
|
|
- "sh"
|
|
- "-c"
|
|
- >
|
|
git clone <<pump.bot.repo.url>> /pump.bot/;
|
|
volumeMounts:
|
|
- name: pump-bot-storage
|
|
mountPath: /pump.bot
|
|
- name: setup-environment
|
|
image: python:3.11.0
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |
|
|
apt update -y;
|
|
apt upgrade -y;
|
|
apt install python3-pip -y;
|
|
pip3 install --upgrade pip setuptools;
|
|
pip3 install --target=/app/python-packages tox;
|
|
volumeMounts:
|
|
- name: pump-bot-storage
|
|
mountPath: /app
|
|
containers:
|
|
- name: pump-bot
|
|
image: python:3.11.0
|
|
env:
|
|
- name: PYTHONPATH
|
|
value: "/app/python-packages"
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |
|
|
cd /app;
|
|
. ./.env;
|
|
python -m tox -e api-tests;
|
|
volumeMounts:
|
|
- name: pump-bot-storage
|
|
mountPath: /app
|
|
- name: config-volume
|
|
mountPath: /app/.env
|
|
subPath: .env
|
|
volumes:
|
|
- name: pump-bot-storage
|
|
persistentVolumeClaim:
|
|
claimName: pvc-pump-bot
|
|
- name: config-volume
|
|
configMap:
|
|
name: pump-bot-config
|
|
items:
|
|
- key: .env
|
|
path: .env
|