Merge pull request 'gitea-migration' (#5) from gitea-migration into prod
Reviewed-on: #5
This commit is contained in:
commit
f83729cc82
@ -99,24 +99,6 @@ services:
|
|||||||
parallelism: 1
|
parallelism: 1
|
||||||
order: start-first
|
order: start-first
|
||||||
|
|
||||||
gitlab-runner:
|
|
||||||
image: mathwave/sprint-repo:gitlab-runner
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
- /sprint-data/gitlab:/etc/gitlab-runner
|
|
||||||
- /sprint-data:/sprint-data
|
|
||||||
environment:
|
|
||||||
GITLAB_REGISTRATION_TOKEN: $GITLAB_REGISTRATION_TOKEN
|
|
||||||
deploy:
|
|
||||||
mode: replicated
|
|
||||||
placement:
|
|
||||||
constraints: [node.role == manager]
|
|
||||||
restart_policy:
|
|
||||||
condition: any
|
|
||||||
update_config:
|
|
||||||
parallelism: 1
|
|
||||||
order: start-first
|
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
image: bitnami/minio:2022.10.8
|
image: bitnami/minio:2022.10.8
|
||||||
volumes:
|
volumes:
|
||||||
@ -144,7 +126,7 @@ services:
|
|||||||
- /sprint-data:/sprint-data
|
- /sprint-data:/sprint-data
|
||||||
environment:
|
environment:
|
||||||
GITEA_INSTANCE_URL: https://gitea.sprinthub.ru/
|
GITEA_INSTANCE_URL: https://gitea.sprinthub.ru/
|
||||||
GITEA_RUNNER_REGISTRATION_TOKEN: $REGISTRATION_TOKEN_DEV
|
GITEA_RUNNER_REGISTRATION_TOKEN: $REGISTRATION_TOKEN
|
||||||
GITEA_RUNNER_NAME: dev
|
GITEA_RUNNER_NAME: dev
|
||||||
GITEA_RUNNER_LABELS: dev
|
GITEA_RUNNER_LABELS: dev
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -104,24 +104,6 @@ services:
|
|||||||
parallelism: 1
|
parallelism: 1
|
||||||
order: start-first
|
order: start-first
|
||||||
|
|
||||||
gitlab-runner:
|
|
||||||
image: mathwave/sprint-repo:gitlab-runner
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
- /sprint-data/gitlab:/etc/gitlab-runner
|
|
||||||
- /sprint-data:/sprint-data
|
|
||||||
environment:
|
|
||||||
GITLAB_REGISTRATION_TOKEN: $GITLAB_REGISTRATION_TOKEN
|
|
||||||
deploy:
|
|
||||||
mode: replicated
|
|
||||||
placement:
|
|
||||||
constraints: [node.role == manager]
|
|
||||||
restart_policy:
|
|
||||||
condition: any
|
|
||||||
update_config:
|
|
||||||
parallelism: 1
|
|
||||||
order: start-first
|
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
image: bitnami/minio:2022.10.8
|
image: bitnami/minio:2022.10.8
|
||||||
volumes:
|
volumes:
|
||||||
@ -176,7 +158,7 @@ services:
|
|||||||
- /sprint-data:/sprint-data
|
- /sprint-data:/sprint-data
|
||||||
environment:
|
environment:
|
||||||
GITEA_INSTANCE_URL: https://gitea.sprinthub.ru/
|
GITEA_INSTANCE_URL: https://gitea.sprinthub.ru/
|
||||||
GITEA_RUNNER_REGISTRATION_TOKEN: $REGISTRATION_TOKEN_PROD
|
GITEA_RUNNER_REGISTRATION_TOKEN: $REGISTRATION_TOKEN
|
||||||
GITEA_RUNNER_NAME: prod
|
GITEA_RUNNER_NAME: prod
|
||||||
GITEA_RUNNER_LABELS: prod
|
GITEA_RUNNER_LABELS: prod
|
||||||
deploy:
|
deploy:
|
||||||
|
56
.gitea/workflows/deploy-dev.yaml
Normal file
56
.gitea/workflows/deploy-dev.yaml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
name: Deploy Dev
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: [ dev ]
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev
|
||||||
|
- name: build nginx dev
|
||||||
|
run: docker build -t mathwave/sprint-repo:sprint-infra-nginx-dev nginx/nginx-dev
|
||||||
|
- name: build gitea runner
|
||||||
|
run: docker build -t mathwave/sprint-repo:gitea-runner gitea-runner
|
||||||
|
push:
|
||||||
|
name: Push
|
||||||
|
runs-on: [ dev ]
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: push nginx dev
|
||||||
|
run: docker push mathwave/sprint-repo:sprint-infra-nginx-dev
|
||||||
|
- name: push gitea runner
|
||||||
|
run: docker push mathwave/sprint-repo:gitea-runner
|
||||||
|
deploy-dev:
|
||||||
|
name: Deploy dev
|
||||||
|
runs-on: [dev]
|
||||||
|
needs: push
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev
|
||||||
|
- name: deploy swarmpit
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy-swarmpit/deploy-dev.yaml swarmpit
|
||||||
|
- name: deploy portainer
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy-portainer/deploy-dev.yaml portainer
|
||||||
|
- name: deploy infra
|
||||||
|
env:
|
||||||
|
MONGO_PASSWORD_DEV: ${{ secrets.MONGO_PASSWORD_DEV }}
|
||||||
|
DB_PASSWORD_DEV: ${{ secrets.POSTGRES_PASSWORD_DEV }}
|
||||||
|
MINIO_PASSWORD_DEV: ${{ secrets.MINIO_PASSWORD_DEV }}
|
||||||
|
REDIS_PASSWORD_DEV: ${{ secrets.REDIS_PASSWORD_DEV }}
|
||||||
|
RABBITMQ_PASSWORD_DEV: ${{ secrets.RABBITMQ_PASSWORD_DEV }}
|
||||||
|
REGISTRATION_TOKEN: ${{ secrets.REGISTRATION_TOKEN }}
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy-infra/deploy-dev.yaml infra
|
56
.gitea/workflows/deploy-prod.yaml
Normal file
56
.gitea/workflows/deploy-prod.yaml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
name: Deploy Prod
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- prod
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: [ dev ]
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev
|
||||||
|
- name: build nginx prod
|
||||||
|
run: docker build -t mathwave/sprint-repo:sprint-infra-nginx-prod nginx/nginx-prod
|
||||||
|
- name: build gitea runner
|
||||||
|
run: docker build -t mathwave/sprint-repo:gitea-runner gitea-runner
|
||||||
|
push:
|
||||||
|
name: Push
|
||||||
|
runs-on: [ dev ]
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: push nginx prod
|
||||||
|
run: docker push mathwave/sprint-repo:sprint-infra-nginx-prod
|
||||||
|
- name: push gitea runner
|
||||||
|
run: docker push mathwave/sprint-repo:gitea-runner
|
||||||
|
deploy-prod:
|
||||||
|
name: Deploy prod
|
||||||
|
runs-on: [prod]
|
||||||
|
needs: push
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: prod
|
||||||
|
- name: deploy swarmpit
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy-swarmpit/deploy-prod.yaml swarmpit
|
||||||
|
- name: deploy portainer
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy-portainer/deploy-prod.yaml portainer
|
||||||
|
- name: deploy infra
|
||||||
|
env:
|
||||||
|
MONGO_PASSWORD_PROD: ${{ secrets.MONGO_PASSWORD_PROD }}
|
||||||
|
DB_PASSWORD_PROD: ${{ secrets.POSTGRES_PASSWORD_PROD }}
|
||||||
|
MINIO_PASSWORD_PROD: ${{ secrets.MINIO_PASSWORD_PROD }}
|
||||||
|
REDIS_PASSWORD_PROD: ${{ secrets.REDIS_PASSWORD_PROD }}
|
||||||
|
RABBITMQ_PASSWORD_PROD: ${{ secrets.RABBITMQ_PASSWORD_PROD }}
|
||||||
|
REGISTRATION_TOKEN: ${{ secrets.REGISTRATION_TOKEN }}
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy-infra/deploy-prod.yaml infra
|
Loading…
Reference in New Issue
Block a user