Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
3d7e2a3740 |
@ -2,8 +2,7 @@ name: build-and-deploy-prod
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- lab6
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@ -22,14 +21,14 @@ jobs:
|
||||
git init
|
||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
||||
git fetch gitea
|
||||
git checkout gitea/master
|
||||
git checkout origin/master
|
||||
- name: Build container
|
||||
shell: sh
|
||||
run: |
|
||||
docker build . -f Dockerfile-cc -t 10.5.1.10:5000/prod/cc
|
||||
- name: Push container
|
||||
shell: sh
|
||||
run: |
|
||||
run: \
|
||||
docker push 10.5.1.10:5000/prod/cc
|
||||
|
||||
build-hm:
|
||||
@ -47,14 +46,14 @@ jobs:
|
||||
git init
|
||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
||||
git fetch gitea
|
||||
git checkout gitea/master
|
||||
git checkout origin/master
|
||||
- name: Build container
|
||||
shell: sh
|
||||
run: |
|
||||
docker build . -f Dockerfile-hm -t 10.5.1.10:5000/prod/hm
|
||||
- name: Push container
|
||||
shell: sh
|
||||
run: |
|
||||
run: \
|
||||
docker push 10.5.1.10:5000/prod/hm
|
||||
|
||||
build-map:
|
||||
@ -72,14 +71,14 @@ jobs:
|
||||
git init
|
||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
||||
git fetch gitea
|
||||
git checkout gitea/master
|
||||
git checkout origin/master
|
||||
- name: Build container
|
||||
shell: sh
|
||||
run: |
|
||||
docker build . -f Dockerfile-map -t 10.5.1.10:5000/prod/map
|
||||
- name: Push container
|
||||
shell: sh
|
||||
run: |
|
||||
run: \
|
||||
docker push 10.5.1.10:5000/prod/map
|
||||
|
||||
deploy-all:
|
||||
@ -90,11 +89,8 @@ jobs:
|
||||
- build-map
|
||||
steps:
|
||||
- run: |
|
||||
ssh -i ~/prod-key root@10.5.1.11 "sh -c 'rm -rf devops-lab4 ; git clone http://10.1.1.1:3000/hasslesstech/devops-lab4 && cd devops-lab4 &&
|
||||
docker-compose -f docker-compose-prod.yaml up -d'"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ssh -i prod-key root@10.5.1.11 "sh -c 'git init &&
|
||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4 &&
|
||||
git fetch gitea &&
|
||||
git checkout -f origin/master &&
|
||||
docker-compose up -d -f docker-compose-prod.yaml'"
|
||||
|
@ -67,6 +67,3 @@ CMD sh -c "openrc default ; \
|
||||
rc-service hive-hm start ; \
|
||||
rc-service hive-map start ; \
|
||||
exec sh"
|
||||
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ services:
|
||||
image: 10.5.1.10:5000/dev/map
|
||||
restart: always
|
||||
volumes:
|
||||
- ./map/config-dev.json:/usr/share/nginx/html/config.json:ro
|
||||
- ./map/config.json:/usr/share/nginx/html/config.json:ro
|
||||
ports:
|
||||
- 80:80
|
||||
|
||||
|
@ -31,7 +31,7 @@ services:
|
||||
image: 10.5.1.10:5000/prod/map
|
||||
restart: always
|
||||
volumes:
|
||||
- ./map/config-prod.json:/usr/share/nginx/html/config.json:ro
|
||||
- ./map/config.json:/usr/share/nginx/html/config.json:ro
|
||||
ports:
|
||||
- 80:80
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"API": "http://10.5.1.12:8080/api/v1/client"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"API": "http://10.5.1.11:8080/api/v1/client"
|
||||
}
|
3
map/config.json
Normal file
3
map/config.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"API": "http://10.1.1.2:8080/api/v1/client"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user