up login page
This commit is contained in:
parent
92cbbb1595
commit
3b95c7871c
49 changed files with 12320 additions and 43 deletions
140
devops/gitlab-ci.yml
Normal file
140
devops/gitlab-ci.yml
Normal file
|
@ -0,0 +1,140 @@
|
|||
stages:
|
||||
- setup
|
||||
- build
|
||||
- test
|
||||
- package
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
# Répertoires (à adapter à votre mono-repo)
|
||||
FRONTEND_DIR: "frontend"
|
||||
DESIGN_SYSTEM_DIR: "design-system"
|
||||
STREAMLIT_DIR: "streamlit"
|
||||
|
||||
default:
|
||||
before_script:
|
||||
- echo "Node $(node -v) / NPM $(npm -v)"
|
||||
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- ${FRONTEND_DIR}/.npm/
|
||||
- ${DESIGN_SYSTEM_DIR}/.npm/
|
||||
|
||||
setup:node:
|
||||
image: node:24
|
||||
stage: setup
|
||||
script:
|
||||
- node -v && npm -v
|
||||
rules:
|
||||
- when: always
|
||||
|
||||
build:angular:
|
||||
image: node:24
|
||||
stage: build
|
||||
needs: ["setup:node"]
|
||||
variables:
|
||||
# Variables .env pour le build Angular (optionnelles)
|
||||
NG_APP_REQUIRE_AUTH: "true"
|
||||
NG_APP_LOGIN_ROUTE: "/login"
|
||||
before_script:
|
||||
- cd ${FRONTEND_DIR}
|
||||
- npm ci
|
||||
script:
|
||||
- echo "NG_APP_REQUIRE_AUTH=${NG_APP_REQUIRE_AUTH}" >> .env.production
|
||||
- echo "NG_APP_LOGIN_ROUTE=${NG_APP_LOGIN_ROUTE}" >> .env.production
|
||||
- npm run build -- --configuration=production
|
||||
artifacts:
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- ${FRONTEND_DIR}/dist/
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
build:storybook:
|
||||
image: node:24
|
||||
stage: build
|
||||
needs: ["setup:node"]
|
||||
before_script:
|
||||
- cd ${DESIGN_SYSTEM_DIR}
|
||||
- npm ci
|
||||
script:
|
||||
- npm run build --if-present
|
||||
- npm run storybook:build
|
||||
artifacts:
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- ${DESIGN_SYSTEM_DIR}/storybook-static/
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
setup:streamlit:
|
||||
image: python:3.11
|
||||
stage: setup
|
||||
before_script:
|
||||
- cd ${STREAMLIT_DIR}
|
||||
script:
|
||||
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
artifacts:
|
||||
when: on_failure
|
||||
rules:
|
||||
- when: always
|
||||
|
||||
test:streamlit-imports:
|
||||
image: python:3.11
|
||||
stage: test
|
||||
needs: ["setup:streamlit"]
|
||||
before_script:
|
||||
- cd ${STREAMLIT_DIR}
|
||||
script:
|
||||
- python -c "import importlib,sys; importlib.import_module('streamlit'); print('streamlit ok')"
|
||||
- if [ -f app.py ]; then python -m py_compile app.py; fi
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
build:openapi-from-streamlit:
|
||||
image: python:3.11
|
||||
stage: build
|
||||
needs: ["setup:streamlit"]
|
||||
before_script:
|
||||
- pip install --no-cache-dir astunparse || true
|
||||
script:
|
||||
- python devops/streamlit-to-swagger.py --src ${STREAMLIT_DIR} --out openapi.json --title "Streamlit API" --version ${CI_COMMIT_SHORT_SHA}
|
||||
artifacts:
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- openapi.json
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
package:docker-images:
|
||||
stage: package
|
||||
image: docker:27
|
||||
services:
|
||||
- docker:27-dind
|
||||
variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
before_script:
|
||||
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
||||
script:
|
||||
- docker build -f devops/frontend-dockerfile.yml -t $CI_REGISTRY_IMAGE/frontend:${CI_COMMIT_SHORT_SHA} ${FRONTEND_DIR}
|
||||
- docker build -f devops/design-system-dockerfile.yml -t $CI_REGISTRY_IMAGE/design-system:${CI_COMMIT_SHORT_SHA} ${DESIGN_SYSTEM_DIR}
|
||||
- docker build -f devops/streamlit-dockerfile.yml -t $CI_REGISTRY_IMAGE/streamlit:${CI_COMMIT_SHORT_SHA} ${STREAMLIT_DIR}
|
||||
- docker push $CI_REGISTRY_IMAGE/frontend:${CI_COMMIT_SHORT_SHA}
|
||||
- docker push $CI_REGISTRY_IMAGE/design-system:${CI_COMMIT_SHORT_SHA}
|
||||
- docker push $CI_REGISTRY_IMAGE/streamlit:${CI_COMMIT_SHORT_SHA}
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
deploy:preview:
|
||||
stage: deploy
|
||||
image: alpine:3.19
|
||||
script:
|
||||
- echo "Déploiement de preview (placeholder)"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue