Author SHA1 Message Date
root c3b83f3d6d add gitlab-ci 2024-04-03 13:54:18 +00:00
root 48acff78c6 add gitlab-ci 2024-04-03 13:51:55 +00:00
root ba04b59dec add gitlab-ci 2024-04-03 13:47:14 +00:00
root bebbe4ce3b add gitlab-ci 2024-04-03 13:43:44 +00:00
root abfa988574 add gitlab-ci 2024-04-03 13:40:40 +00:00
+75
View File
@@ -0,0 +1,75 @@
stages:
- build
- predeploy
- deploy
build_backend:
stage: build
tags:
- ubuntulab01
script:
- echo "Deploying code to server..."
- docker build -t my_back notes-backend/
only:
- temasky-sample03
build_frontend:
stage: build
tags:
- ubuntulab01
script:
- echo "Deploying code to server..."
- docker build -t my_front notes-app/
only:
- temasky-sample03
build_nginx:
stage: build
tags:
- ubuntulab01
script:
- echo "Deploying code to server..."
- docker build -t my_nginx nginx/
only:
- temasky-sample03
delete_old_containers:
stage: predeploy
tags:
- ubuntulab01
script:
- echo "Delete old container"
- docker rm --force `docker ps -qa` || true
create_network:
stage: predeploy
tags:
- ubuntulab01
script:
- echo "create network..."
- docker network create app || true
only:
- temasky-sample03
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
only:
- temasky-sample03
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
only:
- temasky-sample03