Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Edge-to-cloud video processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STACK-RESEARCH-GROUP
Software
Edge-to-cloud video processing
Commits
2c59c6f9
"brick/io/git@gitlab.inria.fr:edebreuv/nutrimorph.git" did not exist on "4172214e0e180104daf8cb27ddf3957df6d73d8e"
Commit
2c59c6f9
authored
3 months ago
by
KADDOUR Sidi Mohammed
Browse files
Options
Downloads
Patches
Plain Diff
update readme.md
parent
ffe2f276
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+35
-26
35 additions, 26 deletions
.gitlab-ci.yml
with
35 additions
and
26 deletions
.gitlab-ci.yml
+
35
−
26
View file @
2c59c6f9
...
...
@@ -4,48 +4,57 @@ stages:
-
deploy
variables
:
DOCKER_
USERNAME
:
"
medkaddour
"
TAG
:
"
latest
"
DEPLOY_ENV
:
"
local"
# Change to 'cloud' if deploying to the cloud
DOCKER_
REGISTRY
:
"
registry.gitlab.com
"
PROJECT_NAME
:
"
surveillance-system
"
K8S_NAMESPACE
:
"
surveillance-system"
before_script
:
-
echo "Setting up environment..."
# Build stage: Build the Docker images
# Build stage: Builds Docker images for all services
build
:
stage
:
build
services
:
-
docker:dind
image
:
docker:stable
script
:
-
echo "Logging in to Docker registry..."
-
echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" --password-stdin
-
echo "Building Docker images..."
-
docker build -t ${DOCKER_USERNAME}/camera:${TAG} ./services/camera
-
docker build -t ${DOCKER_USERNAME}/motion_detector:${TAG} ./services/motion_detector
-
docker build -t ${DOCKER_USERNAME}/object_recognizer:${TAG} ./services/object_recognizer
-
docker build -t $CI_REGISTRY_IMAGE/camera:latest ./services/camera
-
docker build -t $CI_REGISTRY_IMAGE/motion_detector:latest ./services/motion_detector
-
docker build -t $CI_REGISTRY_IMAGE/object_recognizer:latest ./services/object_recognizer
-
echo "Pushing Docker images to registry..."
-
docker push $CI_REGISTRY_IMAGE/camera:latest
-
docker push $CI_REGISTRY_IMAGE/motion_detector:latest
-
docker push $CI_REGISTRY_IMAGE/object_recognizer:latest
only
:
-
main
# Test stage: Run
unit
tests
(optional, can be customized based on your
service
s)
# Test stage: Run
s
tests
for each
service
test
:
stage
:
test
image
:
python:3.9
before_script
:
-
pip install pytest
script
:
-
echo "Running tests..."
-
docker run ${DOCKER_USERNAME}/camera:${TAG} pytest tests/
-
docker run ${DOCKER_USERNAME}/motion_detector:${TAG} pytest tests/
-
docker run ${DOCKER_USERNAME}/object_recognizer:${TAG} pytest tests/
-
echo "Running tests for Camera service..."
-
pytest ./services/camera/tests
-
echo "Running tests for Motion Detection service..."
-
pytest ./services/motion_detector/tests
-
echo "Running tests for Object Recognizer service..."
-
pytest ./services/object_recognizer/tests
only
:
-
main
# Deploy stage: Deploy
using Docker Compose
# Deploy stage: Deploy
s services to Kubernetes
deploy
:
stage
:
deploy
image
:
bitnami/kubectl:latest
before_script
:
-
echo "$KUBE_CONFIG" | base64 -d > kubeconfig
-
export KUBECONFIG=$(pwd)/kubeconfig
script
:
-
echo "Deploying the system..."
-
if [ "$DEPLOY_ENV" == "local" ]; then
docker-compose -f ./deploy/docker-compose/docker-compose.yml down --volumes --remove-orphans;
docker-compose -f ./deploy/docker-compose/docker-compose.yml up -d --build --force-recreate;
fi
-
if [ "$DEPLOY_ENV" == "cloud" ]; then
docker-compose -f ./deploy/docker-compose/docker-compose.yml down --volumes --remove-orphans;
docker-compose -f ./deploy/docker-compose/docker-compose.yml pull --ignore-pull-failures;
docker-compose -f ./deploy/docker-compose/docker-compose.yml up -d --build --force-recreate;
fi
-
echo "Deploying to Kubernetes namespace $K8S_NAMESPACE..."
-
kubectl apply -f k8s/deployment.yaml
-
kubectl apply -f k8s/service.yaml
-
echo "Deployment completed."
only
:
-
main
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment