add gitlab-ci

This commit is contained in:
root
2024-04-03 13:40:40 +00:00
parent 5b72a6bfac
commit abfa988574
+54
View File
@@ -0,0 +1,54 @@
stages:
- build
- predeploy
- deploy
build_backend:
stage: build
script:
- echo "Deploying code to server..."
- docker build -t my_back .notes-backend/
only:
- temasky-sample03
build_frontend:
stage: build
script:
- echo "Deploying code to server..."
- docker build -t my_front .notes-app/
only:
- temasky-sample03
build_nginx:
stage: build
script:
- echo "Deploying code to server..."
- docker build -t my_nginx .nginx/
only:
- temasky-sample03
create_network:
stage: predeploy
script:
- echo "create network..."
- docker network create app || true
only:
- temasky-sample03
run_backend_container:
stage: deploy
script:
- echo "Running container in the 'app' network..."
- docker run -d --name notes-backend --network app my_back
only:
- temasky-sample03
run_frontend_container:
stage: deploy
script:
- echo "Running container in the 'app' network..."
- docker run -d --name notes-app --network app my_front
only:
- temasky-sample03