This commit is contained in:
@@ -131,6 +131,23 @@ steps:
|
|||||||
echo "Znaleziono projektow do budowy:"
|
echo "Znaleziono projektow do budowy:"
|
||||||
wc -l < projects-to-build.txt
|
wc -l < projects-to-build.txt
|
||||||
depends_on: [publish-datamodels-to-baget]
|
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:
|
containerize-apps:
|
||||||
image: docker:27-cli
|
image: docker:27-cli
|
||||||
environment:
|
environment:
|
||||||
@@ -169,6 +186,7 @@ steps:
|
|||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
COPY NuGet.Config.docker ./NuGet.Config
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN dotnet restore "%%PROJECTDIR%%/%%PROJECTNAME%%.csproj"
|
RUN dotnet restore "%%PROJECTDIR%%/%%PROJECTNAME%%.csproj"
|
||||||
RUN dotnet publish "%%PROJECTDIR%%/%%PROJECTNAME%%.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore
|
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)
|
REAL_PDIR=$(cat /tmp/pdir.txt)
|
||||||
sed "s|%%PROJECTNAME%%|$REAL_PNAME|g; s|%%PROJECTDIR%%|$REAL_PDIR|g" "Dockerfile.temp" > "Dockerfile.final"
|
sed "s|%%PROJECTNAME%%|$REAL_PNAME|g; s|%%PROJECTDIR%%|$REAL_PDIR|g" "Dockerfile.temp" > "Dockerfile.final"
|
||||||
|
|
||||||
docker build \
|
DOCKER_BUILDKIT=0 docker build \
|
||||||
--network app-network \
|
|
||||||
-t "$(cat /tmp/tag.txt):${CI_COMMIT_SHA}" \
|
-t "$(cat /tmp/tag.txt):${CI_COMMIT_SHA}" \
|
||||||
-t "$(cat /tmp/tag.txt):latest" \
|
-t "$(cat /tmp/tag.txt):latest" \
|
||||||
-f "Dockerfile.final" \
|
-f "Dockerfile.final" \
|
||||||
@@ -195,4 +212,4 @@ steps:
|
|||||||
|
|
||||||
rm -f "Dockerfile.temp" "Dockerfile.final"
|
rm -f "Dockerfile.temp" "Dockerfile.final"
|
||||||
done
|
done
|
||||||
depends_on: [select-projects-for-container]
|
depends_on: [create-nuget-config]
|
||||||
|
|||||||
Reference in New Issue
Block a user