Skip to content

Commit

Permalink
Release - Sprint 4 (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Corgam authored May 22, 2024
2 parents 58fdcad + b100c65 commit 243bb68
Show file tree
Hide file tree
Showing 50 changed files with 1,882 additions and 818 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Config ###
STAGE=development
ENVIRONMENT_STAGE=Development

### Ports and hosts ###

Expand All @@ -8,5 +8,5 @@ FRONTEND_HOST=frontend
FRONTEND_PORT=80

# Backend
BACKEND_HOST=backend
BACKEND_PORT=40000
BACKEND_HOST=api-gateway
BACKEND_PORT=8081
88 changes: 83 additions & 5 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
IMAGE_NAME: amosproj/amos2024ss04-building-information-enhancer

jobs:
build-and-push-frontend:
build-and-publish-frontend:
name: Build and publish the Frontend image
runs-on: ubuntu-latest

Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

build-and-push-backend:
name: Build and publish the Backend image
build-and-publish-backend-api-gateway:
name: Build and publish - API Gateway
runs-on: ubuntu-latest

steps:
Expand All @@ -67,7 +67,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api-gateway
tags: |
type=ref,event=tag
type=sha
Expand All @@ -82,8 +82,86 @@ jobs:
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

build-and-publish-backend-datapipeline:
name: Build and publish - Data Pipeline
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{github.ref_name}}

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-datapipeline
tags: |
type=ref,event=tag
type=sha
latest
- name: Build and Publish Docker Images
uses: docker/build-push-action@v5
with:
context: ./backend/src/BIE.DataPipeline
file: ./backend/src/BIE.DataPipeline/Dockerfile
push: true
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

build-and-publish-backend-sql-database:
name: Build and publish - SQL Database
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{github.ref_name}}

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-sql-database
tags: |
type=ref,event=tag
type=sha
latest
- name: Build and Publish Docker Images
uses: docker/build-push-action@v5
with:
context: ./backend/database
file: ./backend/database/Dockerfile
push: true
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

deploy-prod-env:
needs: [build-and-push-frontend, build-and-push-backend]
needs:
[
build-and-publish-frontend,
build-and-publish-backend-api-gateway,
build-and-publish-backend-datapipeline,
build-and-publish-backend-sql-database,
]
name: Deploy Image in the Production Environment
runs-on: ubuntu-latest

Expand Down
88 changes: 83 additions & 5 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
IMAGE_NAME: amosproj/amos2024ss04-building-information-enhancer

jobs:
build-and-push-frontend:
build-and-publish-frontend:
name: Build and publish the Frontend image
runs-on: ubuntu-latest

Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

build-and-push-backend:
name: Build and publish the Backend image
build-and-publish-backend-api-gateway:
name: Build and publish - API Gateway
runs-on: ubuntu-latest

steps:
Expand All @@ -67,7 +67,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api-gateway
tags: |
type=ref,event=tag
type=sha
Expand All @@ -82,8 +82,86 @@ jobs:
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

build-and-publish-backend-datapipeline:
name: Build and publish - Data Pipeline
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{github.ref_name}}

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-datapipeline
tags: |
type=ref,event=tag
type=sha
latest
- name: Build and Publish Docker Images
uses: docker/build-push-action@v5
with:
context: ./backend/src/BIE.DataPipeline
file: ./backend/src/BIE.DataPipeline/Dockerfile
push: true
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

build-and-publish-backend-sql-database:
name: Build and publish - SQL Database
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{github.ref_name}}

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-sql-database
tags: |
type=ref,event=tag
type=sha
latest
- name: Build and Publish Docker Images
uses: docker/build-push-action@v5
with:
context: ./backend/database
file: ./backend/database/Dockerfile
push: true
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}

deploy-test-env:
needs: [build-and-push-frontend, build-and-push-backend]
needs:
[
build-and-publish-frontend,
build-and-publish-backend-api-gateway,
build-and-publish-backend-datapipeline,
build-and-publish-backend-sql-database,
]
name: Deploy Docker Images in the Test Environment
runs-on: ubuntu-latest

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ bin/
*.userosscache
*.sln.docstates

# also adding launchsettings here
launchsettings.json

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

Expand Down
2 changes: 2 additions & 0 deletions backend/database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ copy ./scripts/CreateDB.sql /setup.sql
RUN dos2unix /entrypoint.sh
RUN dos2unix /run-script.sh

RUN chmod +x /run-script.sh

ENTRYPOINT ["/bin/bash","entrypoint.sh"]
CMD ["/opt/mssql/bin/sqlservr"]

Expand Down
40 changes: 0 additions & 40 deletions backend/docker-compose.yml

This file was deleted.

12 changes: 12 additions & 0 deletions backend/src/BIE.Core/BIE.Core.API/BIE.Core.API.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 243bb68

Please sign in to comment.