This commit is contained in:
@@ -131,6 +131,23 @@ steps:
|
||||
echo "Znaleziono projektow do budowy:"
|
||||
wc -l < projects-to-build.txt
|
||||
depends_on: [publish-datamodels-to-baget]
|
||||
create-nuget-config:
|
||||
image: alpine
|
||||
commands:
|
||||
- |
|
||||
BAGET_IP=$(getent hosts baget | awk '{print $1}')
|
||||
cat > NuGet.Config.docker <<EOF
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="BaGet" value="http://${BAGET_IP}:80/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
EOF
|
||||
cat NuGet.Config.docker
|
||||
depends_on: [select-projects-for-container]
|
||||
containerize-apps:
|
||||
image: docker:27-cli
|
||||
environment:
|
||||
@@ -169,6 +186,7 @@ steps:
|
||||
EXPOSE 8080
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
COPY NuGet.Config.docker ./NuGet.Config
|
||||
COPY . .
|
||||
RUN dotnet restore "%%PROJECTDIR%%/%%PROJECTNAME%%.csproj"
|
||||
RUN dotnet publish "%%PROJECTDIR%%/%%PROJECTNAME%%.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore
|
||||
@@ -183,8 +201,7 @@ steps:
|
||||
REAL_PDIR=$(cat /tmp/pdir.txt)
|
||||
sed "s|%%PROJECTNAME%%|$REAL_PNAME|g; s|%%PROJECTDIR%%|$REAL_PDIR|g" "Dockerfile.temp" > "Dockerfile.final"
|
||||
|
||||
docker build \
|
||||
--network app-network \
|
||||
DOCKER_BUILDKIT=0 docker build \
|
||||
-t "$(cat /tmp/tag.txt):${CI_COMMIT_SHA}" \
|
||||
-t "$(cat /tmp/tag.txt):latest" \
|
||||
-f "Dockerfile.final" \
|
||||
@@ -195,4 +212,4 @@ steps:
|
||||
|
||||
rm -f "Dockerfile.temp" "Dockerfile.final"
|
||||
done
|
||||
depends_on: [select-projects-for-container]
|
||||
depends_on: [create-nuget-config]
|
||||
|
||||
Reference in New Issue
Block a user