Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'

stages:
- deploy

codesphere-deploy:
image: ghcr.io/codesphere-cloud/codesphere-monorepo/integrations/gitlab-ci:latest
stage: deploy
script:
- node /app/server.js
variables:
ACCESS_TOKEN: $CI_ACCESS_TOKEN
EMAIL: $CODESPHERE_EMAIL
PASSWORD: $CODESPHERE_PASSWORD
TEAM: 'Hackathon Playground'
PLAN: 'Micro'
ON_DEMAND: 'false'
ENV: |
CS_TOKEN=$CODESPHERE_TOKEN
environment:
name: 'Preview Deployment Python MR_$CI_MERGE_REQUEST_IID'
on_stop: codesphere-teardown

codesphere-teardown:
when: manual
image: ghcr.io/codesphere-cloud/codesphere-monorepo/integrations/gitlab-ci:latest
stage: deploy
script:
- node /app/server.js
variables:
ACCESS_TOKEN: $CI_ACCESS_TOKEN
EMAIL: $CODESPHERE_EMAIL
PASSWORD: $CODESPHERE_PASSWORD
TEAM: 'Hackathon Playground'
environment:
name: 'Preview Deployment Python MR_$CI_MERGE_REQUEST_IID'
action: stop

23 changes: 10 additions & 13 deletions ci.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,26 @@ prepare:
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
command: nix-env -iA nixpkgs.uv
- 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
--no-dev; }
command: cd frontend && { [ ! -d ".venv" ] && uv venv; uv sync --no-dev; }
- name: install backend environment
command: . ./env && cd backend && { [ ! -d ".venv" ] && uv venv; uv sync
--no-dev; }
command: cd backend && { [ ! -d ".venv" ] && uv venv; uv sync --no-dev; }
test:
steps: []
run:
frontend:
steps:
- name: start frontend application
command: ". ./env && cd frontend && uv run streamlit run main.py
--server.headless true --server.address 0.0.0.0 --server.port 3000
--browser.gatherUsageStats false --logger.level info "
command: "cd frontend && uv run streamlit run main.py --server.headless true
--server.address 0.0.0.0 --server.port 3000 --browser.gatherUsageStats
false --logger.level info "
plan: 8
replicas: 1
isPublic: true
Expand All @@ -40,16 +37,16 @@ run:
backend:
steps:
- name: start backend application
command: . ./env && cd backend && uv run uvicorn app:app --port 3000 --host
0.0.0.0 --workers 2
command: cd backend && uv run uvicorn app:app --port 3000 --host 0.0.0.0
--workers 2
plan: 8
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 --workers 2
command: cd backend && uv run uvicorn doc:app_docs --host 0.0.0.0 --port 3000
--workers 2
plan: 8
replicas: 1
isPublic: true
Expand Down