🔀 merge docker_test in master
continuous-integration/drone/push Build is passing Details

pull/2/head
Maxence LANONE 2 years ago
commit 6947f97aae

@ -1,11 +1,11 @@
kind: pipeline
type: docker
name: EfCore_Lol_S4
name: EfCore_Lol_S4
trigger:
event:
- push
steps:
- name: build
@ -42,20 +42,30 @@ steps:
# accessible en ligne de commande par $${PLUGIN_SONAR_TOKEN}
sonar_token:
from_secret: SECRET_SONAR_LOGIN
depends on: [tests]
depends_on: [tests]
# docker image build
# - name: docker-build-and-push
# image: plugins/docker
# settings:
# dockerfile: Dockerfile
# context: WebApiLol
# registry: hub.codefirst.iut.uca.fr
# repo: hub.codefirst.iut.uca.fr/maxence.lanone/EfCore_LoL_S4
# username:
# from_secret: SECRET_REGISTRY_USERNAME
# password:
# from_secret: SECRET_REGISTRY_PASSWORD
- name: docker-build
image: plugins/docker
settings:
dockerfile: Sources/WebApiLol/Dockerfile
context: Sources/
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/maxence.lanone/efcore_lol_s4
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
# container deployment
- name: deploy-container
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/maxence.lanone/efcore_lol_s4:latest
CONTAINERNAME: maxencelanone-leagueoflegendsapi
COMMAND: create
OVERWRITE: true
depends_on: [ docker-build ]
volumes:
- name: docs

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*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

@ -26,11 +26,10 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiLol", "WebApiLol\WebApiLol.csproj", "{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{73142960-0D40-4766-973B-37094F4BD879}"
ProjectSection(SolutionItems) = preProject
Dockerfile = Dockerfile
EndProjectSection
EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "ConsoleTestapi", "Tests\ConsoleTestapi\ConsoleTestapi.csproj", "{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTestapi", "Tests\ConsoleTestapi\ConsoleTestapi.csproj", "{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{1B81A541-7D10-4603-B5A2-94108954D831}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -78,6 +77,10 @@ Global
{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}.Release|Any CPU.Build.0 = Release|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -0,0 +1,25 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["WebApiLol/WebApiLol.csproj", "WebApiLol/"]
COPY ["Model/Model.csproj", "Model/"]
COPY ["Shared/Shared.csproj", "Shared/"]
COPY ["StubLib/StubLib.csproj", "StubLib/"]
RUN dotnet restore "WebApiLol/WebApiLol.csproj"
COPY . .
WORKDIR "/src/WebApiLol"
RUN dotnet build "WebApiLol.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "WebApiLol.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApiLol.dll"]

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk" DefaultTargets="Build">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>{1B81A541-7D10-4603-B5A2-94108954D831}</ProjectGuid>
<DockerLaunchBrowser>True</DockerLaunchBrowser>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
<DockerServiceName>webapilol</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>
</Project>

@ -0,0 +1,13 @@
version: '3.4'
services:
webapilol:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=https://+:443;http://+:80
ports:
- "80"
- "443"
volumes:
- ~/.aspnet/https:/root/.aspnet/https:ro
- ~/.microsoft/usersecrets:/root/.microsoft/usersecrets:ro

@ -0,0 +1,8 @@
version: '3.4'
services:
webapilol:
image: ${DOCKER_REGISTRY-}webapilol
build:
context: .
dockerfile: WebApiLol/Dockerfile
Loading…
Cancel
Save