fix
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/.idea
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
11
.github/config/gitversion.yml
vendored
11
.github/config/gitversion.yml
vendored
@@ -1,11 +0,0 @@
|
||||
next-version: 0.5.0
|
||||
assembly-versioning-scheme: MajorMinorPatch
|
||||
assembly-file-versioning-scheme: MajorMinorPatch
|
||||
|
||||
branches:
|
||||
master:
|
||||
regex: ^master$
|
||||
mode: ContinuousDelivery
|
||||
increment: Patch
|
||||
tag: ''
|
||||
is-release-branch: true
|
||||
26
.github/workflows/dev_pr.yml
vendored
26
.github/workflows/dev_pr.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: "Pull request to 'dev' branch"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "dev/**"
|
||||
paths:
|
||||
- 'WatchIt**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Dotnet solution build test and unit tests execution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-build --verbosity normal
|
||||
26
.github/workflows/dev_push.yml
vendored
26
.github/workflows/dev_push.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: "Push to 'dev' branch"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "dev/**"
|
||||
paths:
|
||||
- 'WatchIt**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Dotnet solution build test and unit tests execution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-build --verbosity normal
|
||||
45
.github/workflows/master_pr.yml
vendored
45
.github/workflows/master_pr.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: "Pull request to 'master' branch"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
build-dotnet:
|
||||
name: Dotnet solution build test and unit tests execution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build solution
|
||||
run: dotnet build --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-build --verbosity normal
|
||||
build-docker:
|
||||
name: Docker image build test
|
||||
needs: build-dotnet
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
app:
|
||||
- WatchIt.WebAPI
|
||||
- WatchIt.Website
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Convert name to lowercase
|
||||
id: name
|
||||
uses: ASzc/change-string-case-action@v1
|
||||
with:
|
||||
string: ${{ matrix.app }}
|
||||
- name: Build image
|
||||
run: docker build ${{ github.workspace }} -t ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }}:build-test -f ${{ github.workspace }}/${{ matrix.app }}/Dockerfile
|
||||
123
.github/workflows/master_push.yml
vendored
123
.github/workflows/master_push.yml
vendored
@@ -1,123 +0,0 @@
|
||||
name: "Push to 'master' branch"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
app:
|
||||
- WatchIt.WebAPI
|
||||
- WatchIt.Website
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
||||
with:
|
||||
versionSpec: 5.x
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
id: gitversion
|
||||
with:
|
||||
useConfigFile: true
|
||||
configFilePath: .github/config/gitversion.yml
|
||||
- name: App Settings Variable Substitution for WatchIt.WebAPI
|
||||
uses: microsoft/variable-substitution@v1
|
||||
if: ${{ matrix.app == 'WatchIt.WebAPI' }}
|
||||
with:
|
||||
files: ${{ github.workspace }}/${{ matrix.app }}/appsettings.json
|
||||
env:
|
||||
ConnectionStrings.Database: ${{ secrets.CONNECTION_STRING }}
|
||||
Authentication.JWT.Key: ${{ secrets.KEY }}
|
||||
- name: App Settings Variable Substitution for WatchIt.Website
|
||||
uses: microsoft/variable-substitution@v1
|
||||
if: ${{ matrix.app == 'WatchIt.Website' }}
|
||||
with:
|
||||
files: ${{ github.workspace }}/${{ matrix.app }}/appsettings.json
|
||||
env:
|
||||
Clients.BaseAddress: ${{ secrets.API_URL }}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{github.actor}}
|
||||
password: ${{secrets.GITHUB_TOKEN}}
|
||||
- name: Convert name to lowercase
|
||||
id: name
|
||||
uses: ASzc/change-string-case-action@v1
|
||||
with:
|
||||
string: ${{ matrix.app }}
|
||||
- name: Build image
|
||||
run: docker build ${{ github.workspace }} -t ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }}:latest -t ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }}:${{steps.gitversion.outputs.SemVer}} -f ${{ github.workspace }}/${{ matrix.app }}/Dockerfile
|
||||
- name: Publish image
|
||||
run: docker push ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }} --all-tags
|
||||
outputs:
|
||||
version: ${{ steps.gitversion.outputs.SemVer }}
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish
|
||||
steps:
|
||||
- name: Create Release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{needs.publish.outputs.version}}
|
||||
release_name: ${{needs.publish.outputs.version}}
|
||||
draft: false
|
||||
prerelease: false
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: watchit
|
||||
needs: publish
|
||||
if: false
|
||||
steps:
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{github.actor}}
|
||||
password: ${{secrets.GITHUB_TOKEN}}
|
||||
- name: Stop old WatchIt.WebAPI container
|
||||
continue-on-error: true
|
||||
run: docker container stop watchit.webapi
|
||||
- name: Remove old WatchIt.WebAPI container
|
||||
continue-on-error: true
|
||||
run: docker container rm watchit.webapi
|
||||
- name: Remove old WatchIt.WebAPI image
|
||||
continue-on-error: true
|
||||
run: docker image rm ghcr.io/mateuszskoczek/watchit.webapi
|
||||
- name: Stop old WatchIt.Website container
|
||||
continue-on-error: true
|
||||
run: docker container stop watchit.website
|
||||
- name: Remove old WatchIt.Website container
|
||||
continue-on-error: true
|
||||
run: docker container rm watchit.website
|
||||
- name: Remove old WatchIt.Website image
|
||||
continue-on-error: true
|
||||
run: docker image rm ghcr.io/mateuszskoczek/watchit.website
|
||||
- name: Pull new WatchIt.WebAPI image
|
||||
run: docker pull ghcr.io/mateuszskoczek/watchit.webapi:latest
|
||||
- name: Pull new WatchIt.Website image
|
||||
run: docker pull ghcr.io/mateuszskoczek/watchit.website:latest
|
||||
- name: Run new WatchIt.WebAPI container
|
||||
run: docker run -p 1080:8080 -v watchit.webapi:/home/app -d --name watchit.webapi ghcr.io/mateuszskoczek/watchit.webapi:latest
|
||||
- name: Run new WatchIt.Website container
|
||||
run: docker run -p 80:8080 -v watchit.website:/home/app -d --name watchit.website ghcr.io/mateuszskoczek/watchit.website:latest
|
||||
- name: Wait for initialization
|
||||
run: sleep 10
|
||||
- name: Check WatchIt.WebAPI container health
|
||||
run: docker ps | grep "watchit.webapi"
|
||||
- name: Check WatchIt.Website container health
|
||||
run: docker ps | grep "watchit.website"
|
||||
@@ -1,25 +0,0 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["WatchIt.WebAPI/WatchIt.WebAPI.csproj", "WatchIt.WebAPI/"]
|
||||
COPY ["WatchIt.Database/WatchIt.Database.csproj", "WatchIt.Database/"]
|
||||
COPY ["WatchIt.DTO/WatchIt.DTO.csproj", "WatchIt.DTO/"]
|
||||
RUN dotnet restore "WatchIt.WebAPI/WatchIt.WebAPI.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/WatchIt.WebAPI"
|
||||
RUN dotnet build "WatchIt.WebAPI.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "WatchIt.WebAPI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "WatchIt.WebAPI.dll"]
|
||||
@@ -30,12 +30,6 @@
|
||||
<ProjectReference Include="..\WatchIt.DTO\WatchIt.DTO.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\.dockerignore">
|
||||
<Link>.dockerignore</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_ContentIncludedByDefault Remove="WatchIt.WebAPI.Controllers\obj\project.assets.json" />
|
||||
<_ContentIncludedByDefault Remove="WatchIt.WebAPI.Controllers\obj\project.packagespec.json" />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"Database": "Host=192.168.55.70;Database=watchit_dev;Username=watchit;Password=Xdv2Etchavbuuho;Include Error Detail=True"
|
||||
"Database": "Host=localhost;Database=watchit;Username=admin;Password=6&f!jdoqYBsW8lB;Include Error Detail=True"
|
||||
},
|
||||
"Authentication": {
|
||||
"JWT": {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["WatchIt.Website/WatchIt.Website.csproj", "WatchIt.Website/"]
|
||||
COPY ["WatchIt.DTO/WatchIt.DTO.csproj", "WatchIt.DTO/"]
|
||||
COPY ["WatchIt.Database/WatchIt.Database.csproj", "WatchIt.Database/"]
|
||||
RUN dotnet restore "WatchIt.Website/WatchIt.Website.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/WatchIt.Website"
|
||||
RUN dotnet build "WatchIt.Website.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "WatchIt.Website.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "WatchIt.Website.dll"]
|
||||
@@ -86,11 +86,4 @@
|
||||
<_ContentIncludedByDefault Remove="WatchIt.Website.Services\WatchIt.Website.Services.Tokens\obj\project.packagespec.json" />
|
||||
<_ContentIncludedByDefault Remove="WatchIt.Website.Services\WatchIt.Website.Services.Tokens\obj\WatchIt.Website.Services.Tokens.csproj.nuget.dgspec.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\.dockerignore">
|
||||
<Link>.dockerignore</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Clients": {
|
||||
"BaseAddress": "https://localhost:7027"
|
||||
"BaseAddress": "http://localhost:5128"
|
||||
},
|
||||
"Tokens": {
|
||||
"StorageKeys": {
|
||||
|
||||
Reference in New Issue
Block a user