Add drone io and docker suppport
This commit is contained in:
parent
a6f0f8c72a
commit
115bc6bc27
|
@ -0,0 +1,48 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: deploy
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# GO api
|
||||||
|
- name: build_api
|
||||||
|
image: golang
|
||||||
|
environment:
|
||||||
|
- GIN_MODE=release
|
||||||
|
commands:
|
||||||
|
- cd Api
|
||||||
|
- go build
|
||||||
|
# Platformio esp firmware
|
||||||
|
# - name: build_esp
|
||||||
|
# C# frontend
|
||||||
|
# upload docker
|
||||||
|
- name: upload_frontend
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
settings:
|
||||||
|
dockerfile: ManagementPage/ManagementPage/Dockerfile
|
||||||
|
repo: "registry.jacknet.io/51m0n/environment-api"
|
||||||
|
username: simon
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
registry: registry.jacknet.io
|
||||||
|
auto_tag: true
|
||||||
|
# upload docker
|
||||||
|
- name: upload_api
|
||||||
|
depends_on:
|
||||||
|
- build_api
|
||||||
|
image: plugins/docker
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
settings:
|
||||||
|
context: Api
|
||||||
|
dockerfile: Api/Dockerfile
|
||||||
|
repo: "registry.jacknet.io/51m0n/environment-api"
|
||||||
|
username: simon
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
registry: registry.jacknet.io
|
||||||
|
auto_tag: true
|
||||||
|
# upload firmware blob
|
||||||
|
# - name: upload_esp
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENV GIN_MODE=release
|
||||||
|
|
||||||
|
COPY EnvironmentManagerAPI /EnvironmentManagerAPI
|
||||||
|
|
||||||
|
ENTRYPOINT ["./EnvironmentManagerAPI"]
|
|
@ -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
|
|
@ -0,0 +1,22 @@
|
||||||
|
#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:6.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["ManagementPage/ManagementPage.csproj", "ManagementPage/"]
|
||||||
|
RUN dotnet restore "ManagementPage/ManagementPage.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/ManagementPage"
|
||||||
|
RUN dotnet build "ManagementPage.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "ManagementPage.csproj" -c Release -o /app/publish
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "ManagementPage.dll"]
|
|
@ -4,10 +4,13 @@
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UserSecretsId>a667e9e0-64d9-4a5e-a721-f9c32f29af02</UserSecretsId>
|
||||||
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
|
||||||
<PackageReference Include="MongoDB.Bson" Version="2.13.1" />
|
<PackageReference Include="MongoDB.Bson" Version="2.13.1" />
|
||||||
<PackageReference Include="MongoDB.Driver" Version="2.13.1" />
|
<PackageReference Include="MongoDB.Driver" Version="2.13.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -5,5 +5,7 @@
|
||||||
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
|
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||||
<RazorPage_SelectedScaffolderID>RazorPageScaffolder</RazorPage_SelectedScaffolderID>
|
<RazorPage_SelectedScaffolderID>RazorPageScaffolder</RazorPage_SelectedScaffolderID>
|
||||||
<RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
|
<RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
|
||||||
|
<NameOfLastUsedPublishProfile>P:\EnvironmentManagement\ManagementPage\ManagementPage\Properties\PublishProfiles\registry.jacknet.io.pubxml</NameOfLastUsedPublishProfile>
|
||||||
|
<ActiveDebugProfile>Docker</ActiveDebugProfile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"iisSettings": {
|
"iisSettings": {
|
||||||
"windowsAuthentication": false,
|
"windowsAuthentication": false,
|
||||||
"anonymousAuthentication": true,
|
"anonymousAuthentication": true,
|
||||||
|
@ -10,12 +10,12 @@
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"ManagementPage": {
|
"ManagementPage": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"applicationUrl": "https://environment.51m0n.com;http://+:80",
|
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
},
|
||||||
|
"applicationUrl": "https://environment.51m0n.com;http://+:80",
|
||||||
|
"dotnetRunMessages": true
|
||||||
},
|
},
|
||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
|
@ -23,6 +23,13 @@
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Docker": {
|
||||||
|
"commandName": "Docker",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||||
|
"publishAllPorts": true,
|
||||||
|
"useSSL": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue