Skip to content

Commit 43cccc7

Browse files
authored
Sprint release 08 (#305)
2 parents 18ccdc4 + 76ed840 commit 43cccc7

File tree

189 files changed

+4946
-43137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+4946
-43137
lines changed

.env

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,31 @@
33
# The environment stage set for individual services
44
ENVIRONMENT_STAGE=development
55
# The tag used for pulling the docker images
6-
DOCKER_COMPOSE_IMAGES_TAG=test
6+
DOCKER_COMPOSE_IMAGES_TAG=latest
77

88
### HOSTS & PORTS ###
99

1010
# Frontend
1111
FRONTEND_HOST=frontend
1212
FRONTEND_PORT=80
1313

14-
# Backend
15-
VITE_BACKEND_HOST=localhost
16-
VITE_BACKEND_PORT=8081
14+
# Backend - API Gateway
15+
API_GATEWAY_HOST=localhost
16+
API_GATEWAY_PORT=8081
17+
18+
# Backend - API Composer
19+
API_COMPOSER_HOST=localhost
20+
API_COMPOSER_PORT=8082
21+
22+
### METADATA DATABASE ###
23+
24+
METADATA_DATABASE_PORT=27017
25+
26+
### SQL DATABASE ###
27+
28+
SQL_DB_NAME=BIEDB
29+
SQL_DB_PASSWORD=MyPass@1234
30+
SQL_DB_SERVER=sql-database
31+
SQL_DB_USERNAME=sa
32+
SQL_DB_TYPE=SQL
33+
SQL_TRUSTED=False

.env.production

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,31 @@
33
# The environment stage set for individual services
44
ENVIRONMENT_STAGE=production
55
# The tag used for pulling the docker images
6-
DOCKER_COMPOSE_IMAGES_TAG=production
6+
DOCKER_COMPOSE_IMAGES_TAG=latest
77

88
### HOSTS & PORTS ###
99

1010
# Frontend
1111
FRONTEND_HOST=frontend
1212
FRONTEND_PORT=80
1313

14-
# Backend
15-
VITE_BACKEND_HOST=prod.amos.b-ci.de
16-
VITE_BACKEND_PORT=8081
14+
# Backend - API Gateway
15+
API_GATEWAY_HOST=prod.amos.b-ci.de
16+
API_GATEWAY_PORT=8081
17+
18+
# Backend - API Composer
19+
API_COMPOSER_HOST=prod.amos.b-ci.de
20+
API_COMPOSER_PORT=8082
21+
22+
### METADATA DATABASE ###
23+
24+
METADATA_DATABASE_PORT=27017
25+
26+
### SQL DATABASE ###
27+
28+
SQL_DB_NAME=BIEDB
29+
SQL_DB_PASSWORD=MyPass@1234
30+
SQL_DB_SERVER=sql-database
31+
SQL_DB_USERNAME=sa
32+
SQL_DB_TYPE=SQL
33+
SQL_TRUSTED=False

.env.test

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ DOCKER_COMPOSE_IMAGES_TAG=test
1111
FRONTEND_HOST=frontend
1212
FRONTEND_PORT=80
1313

14-
# Backend
15-
VITE_BACKEND_HOST=test.amos.b-ci.de
16-
VITE_BACKEND_PORT=8081
14+
# Backend - API Gateway
15+
API_GATEWAY_HOST=test.amos.b-ci.de
16+
API_GATEWAY_PORT=8081
17+
18+
# Backend - API Composer
19+
API_COMPOSER_HOST=test.amos.b-ci.de
20+
API_COMPOSER_PORT=8082
21+
22+
### METADATA DATABASE ###
23+
24+
METADATA_DATABASE_PORT=27017
25+
26+
### SQL DATABASE ###
27+
28+
SQL_DB_NAME=BIEDB
29+
SQL_DB_PASSWORD=MyPass@1234
30+
SQL_DB_SERVER=sql-database
31+
SQL_DB_USERNAME=sa
32+
SQL_DB_TYPE=SQL
33+
SQL_TRUSTED=False

.github/workflows/backend-CI.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,31 @@ on:
1111
jobs:
1212
linting:
1313
name: Check linting
14-
runs-on: ubuntu-latest
15-
14+
runs-on: windows-latest
1615
steps:
17-
- name: Echo Linting
18-
run: echo "linting"
16+
- name: Checkout repository
17+
uses: actions/checkout@v2.1.0
18+
19+
- name: Restore dependencies
20+
run: dotnet restore
21+
working-directory: backend\src\BIE.DataPipeline
22+
23+
- name: Linting
24+
run: dotnet format BIE.DataPipeline.sln
25+
working-directory: backend\src\BIE.DataPipeline
1926

2027
tests:
2128
needs: linting
2229
name: Run Tests
23-
runs-on: ubuntu-latest
24-
30+
runs-on: windows-latest
2531
steps:
26-
- name: Echo Test
27-
run: echo "test"
32+
- name: Checkout repository
33+
uses: actions/checkout@v2.1.0
34+
35+
- name: Restore dependencies
36+
run: dotnet restore
37+
working-directory: backend\src\BIE.DataPipeline
38+
39+
- name: Run unit tests
40+
run: dotnet test
41+
working-directory: backend\src\BIE.DataPipeline

.github/workflows/deploy_production.yml

Lines changed: 25 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -11,138 +11,29 @@ env:
1111
STAGE: production
1212

1313
jobs:
14-
build-and-publish-frontend:
15-
name: Build and publish - Frontend
14+
build-and-publish:
15+
name: Build and publish -
1616
runs-on: ubuntu-latest
1717

18-
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v4
21-
with:
22-
ref: ${{ github.ref_name }}
23-
24-
- name: Log in to the container registry
25-
uses: docker/login-action@v3
26-
with:
27-
registry: ${{ env.REGISTRY }}
28-
username: ${{ github.actor }}
29-
password: ${{ secrets.GITHUB_TOKEN }}
30-
31-
- name: Extract metadata for Docker
32-
id: meta
33-
uses: docker/metadata-action@v5
34-
with:
35-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend
36-
tags: |
37-
type=ref,event=tag
38-
type=sha
39-
type=raw,value=${{ env.STAGE }}
40-
latest
41-
labels: |
42-
stage=${{ env.STAGE }}
43-
44-
- name: Build and Publish Docker Images
45-
uses: docker/build-push-action@v5
46-
with:
47-
context: ./frontend
48-
file: ./frontend/Dockerfile
49-
push: true
50-
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
52-
build-args: |
53-
STAGE=${{ env.STAGE }}
54-
55-
build-and-publish-backend-api-gateway:
56-
name: Build and publish - API Gateway
57-
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
service:
21+
- name: frontend
22+
context: ./frontend
23+
- name: api-gateway
24+
context: ./backend/api-gateway
25+
- name: api-composer
26+
context: ./backend/src/BIE.Core
27+
- name: datapipeline
28+
context: ./backend/src/BIE.DataPipeline
29+
- name: sql-database
30+
context: ./backend/sql-database
31+
- name: metadata-database
32+
context: ./backend/metadata-database
5833

5934
steps:
6035
- name: Checkout repository
6136
uses: actions/checkout@v4
62-
with:
63-
ref: ${{ github.ref_name }}
64-
65-
- name: Log in to the container registry
66-
uses: docker/login-action@v3
67-
with:
68-
registry: ${{ env.REGISTRY }}
69-
username: ${{ github.actor }}
70-
password: ${{ secrets.GITHUB_TOKEN }}
71-
72-
- name: Extract metadata for Docker
73-
id: meta
74-
uses: docker/metadata-action@v5
75-
with:
76-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api-gateway
77-
tags: |
78-
type=ref,event=tag
79-
type=sha
80-
type=raw,value=${{ env.STAGE }}
81-
latest
82-
labels: |
83-
stage=${{ env.STAGE }}
84-
85-
- name: Build and Publish Docker Images
86-
uses: docker/build-push-action@v5
87-
with:
88-
context: ./backend/src/BIE.Core
89-
file: ./backend/src/BIE.Core/Dockerfile
90-
push: true
91-
tags: ${{ steps.meta.outputs.tags }}
92-
labels: ${{ steps.meta.outputs.labels }}
93-
build-args: |
94-
STAGE=${{ env.STAGE }}
95-
96-
build-and-publish-backend-datapipeline:
97-
name: Build and publish - Data Pipeline
98-
runs-on: ubuntu-latest
99-
100-
steps:
101-
- name: Checkout repository
102-
uses: actions/checkout@v4
103-
with:
104-
ref: ${{ github.ref_name }}
105-
106-
- name: Log in to the container registry
107-
uses: docker/login-action@v3
108-
with:
109-
registry: ${{ env.REGISTRY }}
110-
username: ${{ github.actor }}
111-
password: ${{ secrets.GITHUB_TOKEN }}
112-
113-
- name: Extract metadata for Docker
114-
id: meta
115-
uses: docker/metadata-action@v5
116-
with:
117-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-datapipeline
118-
tags: |
119-
type=ref,event=tag
120-
type=sha
121-
type=raw,value=${{ env.STAGE }}
122-
latest
123-
labels: |
124-
stage=${{ env.STAGE }}
125-
126-
- name: Build and Publish Docker Images
127-
uses: docker/build-push-action@v5
128-
with:
129-
context: ./backend/src/BIE.DataPipeline
130-
file: ./backend/src/BIE.DataPipeline/Dockerfile
131-
push: true
132-
tags: ${{ steps.meta.outputs.tags }}
133-
labels: ${{ steps.meta.outputs.labels }}
134-
build-args: |
135-
STAGE=${{ env.STAGE }}
136-
137-
build-and-publish-backend-sql-database:
138-
name: Build and publish - SQL Database
139-
runs-on: ubuntu-latest
140-
141-
steps:
142-
- name: Checkout repository
143-
uses: actions/checkout@v4
144-
with:
145-
ref: ${{ github.ref_name }}
14637

14738
- name: Log in to the container registry
14839
uses: docker/login-action@v3
@@ -151,11 +42,11 @@ jobs:
15142
username: ${{ github.actor }}
15243
password: ${{ secrets.GITHUB_TOKEN }}
15344

154-
- name: Extract metadata for Docker
45+
- name: Extract metadata for Docker - ${{ matrix.service.name }}
15546
id: meta
15647
uses: docker/metadata-action@v5
15748
with:
158-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-sql-database
49+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.service.name }}
15950
tags: |
16051
type=ref,event=tag
16152
type=sha
@@ -164,25 +55,19 @@ jobs:
16455
labels: |
16556
stage=${{ env.STAGE }}
16657
167-
- name: Build and Publish Docker Images
58+
- name: Build and Publish Docker Image - ${{ matrix.service.name }}
16859
uses: docker/build-push-action@v5
16960
with:
170-
context: ./backend/database
171-
file: ./backend/database/Dockerfile
61+
context: ${{ matrix.service.context }}
62+
file: ${{ matrix.service.context }}/Dockerfile
17263
push: true
17364
tags: ${{ steps.meta.outputs.tags }}
17465
labels: ${{ steps.meta.outputs.labels }}
17566
build-args: |
17667
STAGE=${{ env.STAGE }}
17768
178-
deploy-prod-env:
179-
needs:
180-
[
181-
build-and-publish-frontend,
182-
build-and-publish-backend-api-gateway,
183-
build-and-publish-backend-datapipeline,
184-
build-and-publish-backend-sql-database,
185-
]
69+
deploy-test-env:
70+
needs: build-and-publish
18671
name: Deploy - Production Environment
18772
runs-on: ubuntu-latest
18873

@@ -201,6 +86,6 @@ jobs:
20186
scp ./docker-compose.yml ${{secrets.PROD_ENV_SSH_USER}}@${{secrets.PROD_ENV_SSH_HOST}}:/var/lib/bie
20287
scp ./.env.production ${{secrets.PROD_ENV_SSH_USER}}@${{secrets.PROD_ENV_SSH_HOST}}:/var/lib/bie/.env
20388
- name: Connect and Pull
204-
run: ssh ${{secrets.PROD_ENV_SSH_USER}}@${{secrets.PROD_ENV_SSH_HOST}} "cd /var/lib/bie && docker compose pull && docker compose up -d --remove-orphans && exit"
89+
run: ssh ${{secrets.PROD_ENV_SSH_USER}}@${{secrets.PROD_ENV_SSH_HOST}} "cd /var/lib/bie && docker compose down --remove-orphans && docker compose pull && docker compose up -d --remove-orphans && exit"
20590
- name: Cleanup
20691
run: rm -rf ~/.ssh

0 commit comments

Comments
 (0)