Skip to content

Commit fb4ff64

Browse files
sql migrator (#13)
* create migrator * modify ci-cd
1 parent 814717a commit fb4ff64

20 files changed

+606
-95
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
#-----------------------------------------------------------------------------------------
3+
#
4+
# Публикация bugget-api (backend)
5+
#
6+
#-----------------------------------------------------------------------------------------
7+
8+
name: publish-backend
9+
description: "Сборка и публикация backend-образа bugget-api в Docker Hub"
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
description: "Версия (например, v1.2.3)"
16+
required: true
17+
18+
jobs:
19+
backend:
20+
runs-on: ubuntu-latest
21+
if: github.event_name == 'workflow_dispatch'
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@master
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v2
28+
with:
29+
username: ${{ secrets.DOCKER_LOGIN }}
30+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
31+
32+
- name: Set version
33+
run: |
34+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v2
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v2
41+
42+
- name: Build and push Backend Multi-Arch
43+
run: |
44+
cd backend
45+
docker buildx create --name mybuilder --use --bootstrap || docker buildx use mybuilder
46+
docker buildx inspect mybuilder --bootstrap
47+
docker buildx build \
48+
--platform linux/amd64,linux/arm64 \
49+
--cache-from=type=gha \
50+
--cache-to=type=gha,mode=max \
51+
-t ${{ secrets.DOCKER_LOGIN }}/bugget-api:${{ env.VERSION }} \
52+
--push \
53+
-f ./Bugget/Dockerfile .
54+
docker buildx build \
55+
--platform linux/amd64,linux/arm64 \
56+
--cache-from=type=gha \
57+
--cache-to=type=gha,mode=max \
58+
-t ${{ secrets.DOCKER_LOGIN }}/bugget-api:latest \
59+
--push \
60+
-f ./Bugget/Dockerfile .
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
#-----------------------------------------------------------------------------------------
3+
#
4+
# Публикация bugget-ui (frontend)
5+
#
6+
#-----------------------------------------------------------------------------------------
7+
8+
name: publish-frontend
9+
description: "Сборка и публикация frontend-образа bugget-ui в Docker Hub"
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
description: "Версия (например, v1.2.3)"
16+
required: true
17+
18+
jobs:
19+
frontend:
20+
runs-on: ubuntu-latest
21+
if: github.event_name == 'workflow_dispatch'
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@master
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v2
28+
with:
29+
username: ${{ secrets.DOCKER_LOGIN }}
30+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
31+
32+
- name: Set version
33+
run: |
34+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v2
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v2
41+
42+
- name: Build and push Frontend Multi-Arch
43+
run: |
44+
cd frontend
45+
docker buildx create --name mybuilder --use --bootstrap || docker buildx use mybuilder
46+
docker buildx inspect mybuilder --bootstrap
47+
docker buildx build \
48+
--platform linux/amd64,linux/arm64 \
49+
--cache-from=type=gha \
50+
--cache-to=type=gha,mode=max \
51+
-t ${{ secrets.DOCKER_LOGIN }}/bugget-ui:${{ env.VERSION }} \
52+
--push .
53+
docker buildx build \
54+
--platform linux/amd64,linux/arm64 \
55+
--cache-from=type=gha \
56+
--cache-to=type=gha,mode=max \
57+
-t ${{ secrets.DOCKER_LOGIN }}/bugget-ui:latest \
58+
--push .
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
#-----------------------------------------------------------------------------------------
3+
#
4+
# Публикация bugget-migrator
5+
#
6+
#-----------------------------------------------------------------------------------------
7+
8+
name: publish-migrator
9+
description: "Сборка и публикация bugget-migrator в Docker Hub"
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
description: "Версия (например, v1.2.3)"
16+
required: true
17+
18+
jobs:
19+
migrator:
20+
runs-on: ubuntu-latest
21+
if: github.event_name == 'workflow_dispatch'
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@master
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v2
28+
with:
29+
username: ${{ secrets.DOCKER_LOGIN }}
30+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
31+
32+
- name: Set version
33+
run: |
34+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v2
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v2
41+
42+
- name: Build and push Migrator Multi-Arch
43+
run: |
44+
cd devops/migrator
45+
docker buildx create --name mybuilder --use --bootstrap || docker buildx use mybuilder
46+
docker buildx inspect mybuilder --bootstrap
47+
docker buildx build \
48+
--platform linux/amd64,linux/arm64 \
49+
--cache-from=type=gha \
50+
--cache-to=type=gha,mode=max \
51+
-t ${{ secrets.DOCKER_LOGIN }}/bugget-migrator:${{ env.VERSION }} \
52+
--push \
53+
-f ./Dockerfile .
54+
docker buildx build \
55+
--platform linux/amd64,linux/arm64 \
56+
--cache-from=type=gha \
57+
--cache-to=type=gha,mode=max \
58+
-t ${{ secrets.DOCKER_LOGIN }}/bugget-migrator:latest \
59+
--push \
60+
-f ./Dockerfile .

devops/components/postgres/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ services:
44
image: postgres
55
environment:
66
POSTGRES_HOST_AUTH_METHOD: trust
7-
volumes:
8-
- ./sql:/docker-entrypoint-initdb.d
97
ports:
108
- "5432:5432"
119
restart: unless-stopped
10+
volumes:
11+
- ../../migrator/sql:/docker-entrypoint-initdb.d

devops/components/postgres/sql/6_add_gin_index.sql

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)