Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d7e2a3740 |
@@ -1,94 +0,0 @@
|
|||||||
name: build-and-deploy-dev
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-cc:
|
|
||||||
runs-on: docker
|
|
||||||
services:
|
|
||||||
docker:
|
|
||||||
image: docker:dind
|
|
||||||
options: --privileged --shm-size=2g
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
steps:
|
|
||||||
- name: Clone repo
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
git init
|
|
||||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
|
||||||
git fetch gitea
|
|
||||||
git checkout gitea/dev
|
|
||||||
- name: Build container
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
docker build . -f Dockerfile-cc -t 10.5.1.10:5000/dev/cc
|
|
||||||
- name: Push container
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
docker push 10.5.1.10:5000/dev/cc
|
|
||||||
|
|
||||||
build-hm:
|
|
||||||
runs-on: docker
|
|
||||||
services:
|
|
||||||
docker:
|
|
||||||
image: docker:dind
|
|
||||||
options: --privileged --shm-size=2g
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
steps:
|
|
||||||
- name: Clone repo
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
git init
|
|
||||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
|
||||||
git fetch gitea
|
|
||||||
git checkout gitea/dev
|
|
||||||
- name: Build container
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
docker build . -f Dockerfile-hm -t 10.5.1.10:5000/dev/hm
|
|
||||||
- name: Push container
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
docker push 10.5.1.10:5000/dev/hm
|
|
||||||
|
|
||||||
build-map:
|
|
||||||
runs-on: docker
|
|
||||||
services:
|
|
||||||
docker:
|
|
||||||
image: docker:dind
|
|
||||||
options: --privileged --shm-size=2g
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
steps:
|
|
||||||
- name: Clone repo
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
git init
|
|
||||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
|
||||||
git fetch gitea
|
|
||||||
git checkout gitea/dev
|
|
||||||
- name: Build container
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
docker build . -f Dockerfile-map -t 10.5.1.10:5000/dev/map
|
|
||||||
- name: Push container
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
docker push 10.5.1.10:5000/dev/map
|
|
||||||
|
|
||||||
deploy-all:
|
|
||||||
runs-on: hardware-x86_64
|
|
||||||
needs:
|
|
||||||
- build-cc
|
|
||||||
- build-hm
|
|
||||||
- build-map
|
|
||||||
steps:
|
|
||||||
- run: |
|
|
||||||
ssh -i ~/dev-key root@10.5.1.12 "sh -c 'rm -rf devops-lab4 ; git clone http://10.1.1.1:3000/hasslesstech/devops-lab4 && cd devops-lab4 && git checkout origin/dev &&
|
|
||||||
docker-compose -f docker-compose-dev.yaml up -d'"
|
|
||||||
@@ -2,8 +2,7 @@ name: build-and-deploy-prod
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
- lab6
|
||||||
- master
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -22,14 +21,14 @@ jobs:
|
|||||||
git init
|
git init
|
||||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
||||||
git fetch gitea
|
git fetch gitea
|
||||||
git checkout gitea/master
|
git checkout origin/master
|
||||||
- name: Build container
|
- name: Build container
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
docker build . -f Dockerfile-cc -t 10.5.1.10:5000/prod/cc
|
docker build . -f Dockerfile-cc -t 10.5.1.10:5000/prod/cc
|
||||||
- name: Push container
|
- name: Push container
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: \
|
||||||
docker push 10.5.1.10:5000/prod/cc
|
docker push 10.5.1.10:5000/prod/cc
|
||||||
|
|
||||||
build-hm:
|
build-hm:
|
||||||
@@ -47,14 +46,14 @@ jobs:
|
|||||||
git init
|
git init
|
||||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
||||||
git fetch gitea
|
git fetch gitea
|
||||||
git checkout gitea/master
|
git checkout origin/master
|
||||||
- name: Build container
|
- name: Build container
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
docker build . -f Dockerfile-hm -t 10.5.1.10:5000/prod/hm
|
docker build . -f Dockerfile-hm -t 10.5.1.10:5000/prod/hm
|
||||||
- name: Push container
|
- name: Push container
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: \
|
||||||
docker push 10.5.1.10:5000/prod/hm
|
docker push 10.5.1.10:5000/prod/hm
|
||||||
|
|
||||||
build-map:
|
build-map:
|
||||||
@@ -72,14 +71,14 @@ jobs:
|
|||||||
git init
|
git init
|
||||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
git remote add gitea http://10.1.1.1:3000/hasslesstech/devops-lab4
|
||||||
git fetch gitea
|
git fetch gitea
|
||||||
git checkout gitea/master
|
git checkout origin/master
|
||||||
- name: Build container
|
- name: Build container
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
docker build . -f Dockerfile-map -t 10.5.1.10:5000/prod/map
|
docker build . -f Dockerfile-map -t 10.5.1.10:5000/prod/map
|
||||||
- name: Push container
|
- name: Push container
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: \
|
||||||
docker push 10.5.1.10:5000/prod/map
|
docker push 10.5.1.10:5000/prod/map
|
||||||
|
|
||||||
deploy-all:
|
deploy-all:
|
||||||
@@ -90,5 +89,8 @@ jobs:
|
|||||||
- build-map
|
- build-map
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- 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 &&
|
ssh -i prod-key root@10.5.1.11 "sh -c 'git init &&
|
||||||
docker-compose -f docker-compose-prod.yaml up -d'"
|
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'"
|
||||||
|
|||||||
@@ -31,10 +31,9 @@ services:
|
|||||||
image: 10.5.1.10:5000/dev/map
|
image: 10.5.1.10:5000/dev/map
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./map/config-dev.json:/usr/share/nginx/html/config.json:ro
|
- ./map/config.json:/usr/share/nginx/html/config.json:ro
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
sys:
|
sys:
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ services:
|
|||||||
image: 10.5.1.10:5000/prod/map
|
image: 10.5.1.10:5000/prod/map
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./map/config-prod.json:/usr/share/nginx/html/config.json:ro
|
- ./map/config.json:/usr/share/nginx/html/config.json:ro
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 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"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user