Update .woodpecker.yml #23
@@ -150,6 +150,9 @@ steps:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BAGET_IP=$(getent hosts baget | awk '{print $1}')
|
||||||
|
echo "BaGet IP: $BAGET_IP"
|
||||||
|
|
||||||
cat projects-to-build.txt | while IFS='|' read -r PDIR PNAME; do
|
cat projects-to-build.txt | while IFS='|' read -r PDIR PNAME; do
|
||||||
PDIR=$(echo "$PDIR" | xargs)
|
PDIR=$(echo "$PDIR" | xargs)
|
||||||
PNAME=$(echo "$PNAME" | xargs)
|
PNAME=$(echo "$PNAME" | xargs)
|
||||||
@@ -170,7 +173,7 @@ steps:
|
|||||||
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 . .
|
COPY . .
|
||||||
RUN dotnet restore "%%PROJECTDIR%%/%%PROJECTNAME%%.csproj" --source https://api.nuget.org/v3/index.json --source http://baget:80/v3/index.json
|
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
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -184,7 +187,7 @@ steps:
|
|||||||
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 buildx build \
|
docker buildx build \
|
||||||
--network=app-network \
|
--add-host=baget:${BAGET_IP} \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
-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" \
|
||||||
|
|||||||
Reference in New Issue
Block a user