build scripts
This commit is contained in:
parent
a97362a3e7
commit
9cec78afc3
5 changed files with 72 additions and 3 deletions
BIN
.Dockerfile2.swp
Normal file
BIN
.Dockerfile2.swp
Normal file
Binary file not shown.
33
.drone.yml
33
.drone.yml
|
@ -1,8 +1,37 @@
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
|
workspace:
|
||||||
|
path: /drone/src
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: docker
|
- name: backend
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: privateregistry.michelescandura.com/michele/basecompileimage
|
repo: privateregistry.michelescandura.com/michele/sledgemapper
|
||||||
registry: privateregistry.michelescandura.com
|
registry: privateregistry.michelescandura.com
|
||||||
|
auto_tag: true
|
||||||
|
|
||||||
|
- name: frontend
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: privateregistry.michelescandura.com
|
||||||
|
dockerfile: Dockerfile.app
|
||||||
|
|
||||||
|
- name: zip
|
||||||
|
image: alpine:latest
|
||||||
|
commands:
|
||||||
|
- apk update
|
||||||
|
- apk add zip
|
||||||
|
- cd /drone/src/Sledgemapper/bin/release/net5.0/win-x64
|
||||||
|
- zip -r sledgmeapper-win.zip ./publish
|
||||||
|
- md /drone/src/release
|
||||||
|
- cp sledgemapper-win.zip /drone/src/release
|
||||||
|
|
||||||
|
- name: gitea_release
|
||||||
|
image: plugins/gitea-release
|
||||||
|
settings:
|
||||||
|
api_key: 96d2ba3da7491bd7760e2681f8882cf41f82e609
|
||||||
|
base_url: https://git.michelescandura.com
|
||||||
|
files: /drone/src/release/*
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
FROM privateregistry.michelescandura.com/michele/basecompileimage as build
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||||
|
#FROM privateregistry.michelescandura.com/michele/basecompileimage as build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# copy csproj and restore as distinct layers
|
# copy csproj and restore as distinct layers
|
||||||
|
|
37
Dockerfile.app
Normal file
37
Dockerfile.app
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||||
|
FROM privateregistry.michelescandura.com/michele/basecompileimage as build
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# copy csproj and restore as distinct layers
|
||||||
|
#COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
|
||||||
|
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
|
||||||
|
COPY Sledgemapper/*.csproj ./Sledgemapper/
|
||||||
|
|
||||||
|
|
||||||
|
#WORKDIR /src/Sledgemapper.Api
|
||||||
|
#RUN dotnet restore
|
||||||
|
|
||||||
|
WORKDIR /src/Sledgemapper.Shared
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
|
WORKDIR /src/Sledgemapper
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
|
# copy everything else and build app
|
||||||
|
WORKDIR /src
|
||||||
|
#COPY Sledgemapper.Api/. ./Sledgemapper.Api/
|
||||||
|
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
|
||||||
|
COPY Sledgemapper/. ./Sledgemapper/
|
||||||
|
WORKDIR /src/Sledgemapper
|
||||||
|
|
||||||
|
COPY build.sh .
|
||||||
|
RUN chmod +x build.sh
|
||||||
|
RUN sh build.sh
|
||||||
|
#WORKDIR /src/Sledgemapper.Api
|
||||||
|
#RUN dotnet publish -c release -o /app --no-restore
|
||||||
|
|
||||||
|
# final stage/image
|
||||||
|
#FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||||
|
#WORKDIR /app
|
||||||
|
#COPY --from=build /app ./
|
||||||
|
#ENTRYPOINT ["dotnet", "Sledgemapper.Api.dll"]
|
2
build.sh
2
build.sh
|
@ -4,3 +4,5 @@
|
||||||
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
|
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
|
||||||
dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true
|
dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true
|
||||||
dotnet publish -r osx-x64 -c Release /p:PublishSingleFile=true
|
dotnet publish -r osx-x64 -c Release /p:PublishSingleFile=true
|
||||||
|
|
||||||
|
cp -r /src/Sledgemapper/bin/release /drone/src
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue