Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3b83f3d6d | ||
|
|
48acff78c6 | ||
|
|
ba04b59dec | ||
|
|
bebbe4ce3b | ||
|
|
abfa988574 |
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user