mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Fix CI configuration: separate images for different stages
This commit is contained in:
@@ -9,17 +9,14 @@ variables:
|
|||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
SECRET_KEY: "your-super-secret-key-123"
|
SECRET_KEY: "your-super-secret-key-123"
|
||||||
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- python -V
|
|
||||||
- python -m pip install --upgrade pip
|
|
||||||
- pip install pytest
|
|
||||||
- pip install -r backend/requirements.txt
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
image: python:3.11
|
||||||
stage: test
|
stage: test
|
||||||
|
before_script:
|
||||||
|
- python -V
|
||||||
|
- python -m pip install --upgrade pip
|
||||||
|
- pip install pytest
|
||||||
|
- pip install -r backend/requirements.txt
|
||||||
script:
|
script:
|
||||||
- cd backend
|
- cd backend
|
||||||
- python -m pytest -v
|
- python -m pytest -v
|
||||||
@@ -30,6 +27,10 @@ test:
|
|||||||
build_backend:
|
build_backend:
|
||||||
stage: build
|
stage: build
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
before_script:
|
||||||
|
- docker info
|
||||||
script:
|
script:
|
||||||
- cd backend
|
- cd backend
|
||||||
- docker build -t backend:latest .
|
- docker build -t backend:latest .
|
||||||
@@ -43,6 +44,10 @@ build_backend:
|
|||||||
build_frontend:
|
build_frontend:
|
||||||
stage: build
|
stage: build
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
before_script:
|
||||||
|
- docker info
|
||||||
script:
|
script:
|
||||||
- cd frontend
|
- cd frontend
|
||||||
- docker build -t frontend:latest .
|
- docker build -t frontend:latest .
|
||||||
@@ -55,6 +60,7 @@ build_frontend:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
image: python:3.11
|
||||||
script:
|
script:
|
||||||
- apt-get update -qy
|
- apt-get update -qy
|
||||||
- apt-get install -y sshpass
|
- apt-get install -y sshpass
|
||||||
|
|||||||
Reference in New Issue
Block a user