-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.dev.yml
More file actions
69 lines (69 loc) · 2.62 KB
/
ci.dev.yml
File metadata and controls
69 lines (69 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
schemaVersion: v0.2
prepare:
steps:
- name: install Codesphere cli tool
command: mkdir -p $HOME/.local/bin && wget -qO-
'https://api.github.com/repos/codesphere-cloud/cs-go/releases/latest' |
grep linux_amd64 | grep browser_download_url | sed s/.*https/https/ |
sed s/\".*$// | xargs wget -O $HOME/.local/bin/cs && chmod +x
$HOME/.local/bin/cs
- name: install uv standalone version
command: curl -LsSf https://astral.sh/uv/install.sh | env
UV_INSTALL_DIR="$HOME/app" sh && chmod +x $HOME/app/uv
- name: copy template .env file
command: cp -n .env.sample .env
- name: "set ev vars "
command: . .env && cs set-env -w $WORKSPACE_ID -t $TEAM_ID --env-var
UV_PYTHON_INSTALL_DIR=$PWD/.codesphere-internal/.uv-python-install
--env-var UV_PYTHON_BIN_DIR=$PWD/.codesphere-internal/.uv-python-bin
--env-var UV_CACHE_DIR=$PWD/.codesphere-internal/.uv --env-var
UV_PYTHON_CACHE_DIR=$PWD/.codesphere-internal/.uv-python
- name: install frontend environment
command: . ./env && cd frontend && { [ ! -d ".venv" ] && uv venv; uv sync; }
- name: install backend environment
command: . ./env && cd backend && { [ ! -d ".venv" ] && uv venv; uv sync; }
test:
steps:
- name: test frontend
command: . ./env && cd frontend && uv run pytest
- name: test backend
command: ". ./env && cd backend && uv run pytest "
- name: security check frontend
command: '. ./env && cd frontend && uv run bandit -r . -c pyproject.toml
--format=custom --msg-template "{abspath}:{line}: {test_id}[{severity}]:
{msg}" -o bandit-results.txt'
- name: security check backend
command: '. ./env && cd backend && uv run bandit -r . -c pyproject.toml
--format=custom --msg-template "{abspath}:{line}: {test_id}[{severity}]:
{msg}" -o bandit-results.txt'
run:
frontend:
steps:
- name: start frontend application
command: . ./env && cd frontend && uv run streamlit run --server.address 0.0.0.0
--server.port 3000 main.py
plan: 20
replicas: 1
isPublic: true
network:
path: /
stripPath: false
backend:
steps:
- name: start backend application
command: . ./env && cd backend && uv run uvicorn app:app --reload --port 3000
--host 0.0.0.0
plan: 20
replicas: 1
isPublic: false
api-docs:
steps:
- name: deploy docs
command: . ./env && cd backend && uv run uvicorn doc:app_docs --host 0.0.0.0
--port 3000
plan: 20
replicas: 1
isPublic: true
network:
path: /api
stripPath: false