add files
This commit is contained in:
parent
d4b830096f
commit
7737abe97f
96
.gitea/workflows/prod.yaml
Normal file
96
.gitea/workflows/prod.yaml
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
name: build-and-deploy-prod
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
- lab6
|
||||||
|
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/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: |
|
||||||
|
docker push 10.5.1.10:5000/prod/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/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: |
|
||||||
|
docker push 10.5.1.10:5000/prod/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/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: |
|
||||||
|
docker push 10.5.1.10:5000/prod/map
|
||||||
|
|
||||||
|
deploy-all:
|
||||||
|
runs-on: hardware-x86_64
|
||||||
|
needs:
|
||||||
|
- build-cc
|
||||||
|
- build-hm
|
||||||
|
- build-map
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
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 gitea/master &&
|
||||||
|
docker-compose up -d -f docker-compose-prod.yaml'"
|
@ -6,10 +6,7 @@ services:
|
|||||||
- sys
|
- sys
|
||||||
|
|
||||||
cc:
|
cc:
|
||||||
build:
|
image: 10.5.1.10:5000/dev/cc
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile-cc
|
|
||||||
#image: registry.digitalocean.com/duke-listings/cc
|
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
Redis__ConnectionString: "redis:6379"
|
Redis__ConnectionString: "redis:6379"
|
||||||
@ -21,10 +18,7 @@ services:
|
|||||||
- redis
|
- redis
|
||||||
|
|
||||||
hm:
|
hm:
|
||||||
build:
|
image: 10.5.1.10:5000/dev/hm
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile-hm
|
|
||||||
#image: registry.digitalocean.com/duke-listings/hm
|
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
CommunicationConfiguration__CommunicationControlIP: "cc"
|
CommunicationConfiguration__CommunicationControlIP: "cc"
|
||||||
@ -34,17 +28,12 @@ services:
|
|||||||
- cc
|
- cc
|
||||||
|
|
||||||
map:
|
map:
|
||||||
build:
|
image: 10.5.1.10:5000/dev/map
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile-map
|
|
||||||
#image: registry.digitalocean.com/duke-listings/map
|
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./map/config.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:
|
|
||||||
- sys
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
sys:
|
sys:
|
39
docker-compose-prod.yaml
Normal file
39
docker-compose-prod.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:7
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- sys
|
||||||
|
|
||||||
|
cc:
|
||||||
|
image: 10.5.1.10:5000/prod/cc
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
Redis__ConnectionString: "redis:6379"
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
networks:
|
||||||
|
- sys
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
hm:
|
||||||
|
image: 10.5.1.10:5000/prod/hm
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
CommunicationConfiguration__CommunicationControlIP: "cc"
|
||||||
|
networks:
|
||||||
|
- sys
|
||||||
|
depends_on:
|
||||||
|
- cc
|
||||||
|
|
||||||
|
map:
|
||||||
|
image: 10.5.1.10:5000/prod/map
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./map/config.json:/usr/share/nginx/html/config.json:ro
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
|
||||||
|
networks:
|
||||||
|
sys:
|
Loading…
x
Reference in New Issue
Block a user