add gitlab-ci

This commit is contained in:
root
2024-04-03 13:43:44 +00:00
parent abfa988574
commit bebbe4ce3b
+12
View File
@@ -5,6 +5,8 @@ stages:
build_backend:
stage: build
tags:
- ubuntulab01
script:
- echo "Deploying code to server..."
- docker build -t my_back .notes-backend/
@@ -14,6 +16,8 @@ build_backend:
build_frontend:
stage: build
tags:
- ubuntulab01
script:
- echo "Deploying code to server..."
- docker build -t my_front .notes-app/
@@ -22,6 +26,8 @@ build_frontend:
build_nginx:
stage: build
tags:
- ubuntulab01
script:
- echo "Deploying code to server..."
- docker build -t my_nginx .nginx/
@@ -30,6 +36,8 @@ build_nginx:
create_network:
stage: predeploy
tags:
- ubuntulab01
script:
- echo "create network..."
- docker network create app || true
@@ -38,6 +46,8 @@ create_network:
run_backend_container:
stage: deploy
tags:
- ubuntulab01
script:
- echo "Running container in the 'app' network..."
- docker run -d --name notes-backend --network app my_back
@@ -46,6 +56,8 @@ run_backend_container:
run_frontend_container:
stage: deploy
tags:
- ubuntulab01
script:
- echo "Running container in the 'app' network..."
- docker run -d --name notes-app --network app my_front