dev commit
This commit is contained in:
parent
01ef30678d
commit
da6a2bd53e
94
.gitea/workflows/dev.yaml
Normal file
94
.gitea/workflows/dev.yaml
Normal file
@ -0,0 +1,94 @@
|
||||
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 gitea/dev &&
|
||||
docker-compose -f docker-compose-dev.yaml up -d'"
|
Loading…
x
Reference in New Issue
Block a user