27 Commits

Author SHA1 Message Date
d64672d8af Merge pull request 'Update .woodpecker.yml' (#23) from Warehouses into master
Reviewed-on: #23
2026-04-10 04:31:37 +00:00
3d86d07717 Update .woodpecker.yml 2026-04-10 04:31:04 +00:00
f1d56e3e9e Update .woodpecker.yml
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline failed
2026-01-15 20:53:33 +00:00
a65e110e03 Update .woodpecker.yml 2026-01-15 07:51:56 +00:00
736c07bbb7 Update .woodpecker.yml 2026-01-15 07:42:59 +00:00
6c26cc891b Update .woodpecker.yml 2026-01-15 07:41:05 +00:00
c786ffe6ce Merge pull request 'Warehouses' (#22) from Warehouses into master
Reviewed-on: #22
2026-01-15 07:40:23 +00:00
2a239b67ca Merge pull request 'Update .woodpecker.yml' (#21) from Warehouses into master
Reviewed-on: #21
2026-01-15 07:32:23 +00:00
f8fecf81dc Merge pull request 'Update .woodpecker.yml' (#20) from Warehouses into master
Reviewed-on: #20
2026-01-14 21:35:26 +00:00
30c60a802c Merge pull request 'Update .woodpecker.yml' (#19) from Warehouses into master
Reviewed-on: #19
2026-01-14 21:31:32 +00:00
1ba5d128ba Merge pull request 'Update .woodpecker.yml' (#18) from Warehouses into master
Reviewed-on: #18
2026-01-14 21:30:22 +00:00
65e54cf9ef Update .woodpecker.yml 2026-01-14 21:26:41 +00:00
cd46b87936 Merge pull request 'Update .woodpecker.yml' (#17) from Warehouses into master
Reviewed-on: #17
2026-01-14 21:16:28 +00:00
523039a237 Merge pull request 'Update .woodpecker.yml' (#16) from Warehouses into master
Reviewed-on: #16
2026-01-14 21:11:29 +00:00
0626f980c9 Update .woodpecker.yml 2026-01-14 21:10:23 +00:00
6a18dcf42a Merge pull request 'Update .woodpecker.yml' (#15) from Warehouses into master
Reviewed-on: #15
2026-01-14 21:04:40 +00:00
996095ba99 Merge pull request 'Update .woodpecker.yml' (#14) from Warehouses into master
Reviewed-on: #14
2026-01-14 21:00:34 +00:00
17cf4252c2 Merge pull request 'Warehouses' (#13) from Warehouses into master
Reviewed-on: #13
2026-01-14 20:56:44 +00:00
6175e87a50 Merge pull request 'Update .woodpecker.yml' (#12) from Warehouses into master
Reviewed-on: #12
2026-01-14 20:43:47 +00:00
3b1a72cc28 Merge pull request '* Changed interval to 30' (#11) from Warehouses into master
Reviewed-on: #11
2026-01-11 12:45:27 +00:00
6dac17cbd1 Merge pull request '* Changed interval to 25' (#10) from Warehouses into master
Reviewed-on: #10
2026-01-11 12:43:02 +00:00
325d56e7f9 Merge pull request 'Warehouses' (#9) from Warehouses into master
Reviewed-on: #9
2026-01-11 12:36:01 +00:00
8e8ea7a929 Merge pull request '* Changed query interval to 30' (#8) from Warehouses into master
Reviewed-on: #8
2026-01-11 12:29:57 +00:00
a41e05045b Merge pull request 'Warehouses' (#7) from Warehouses into master
Reviewed-on: #7
2026-01-11 12:22:45 +00:00
f97e3d82b2 Merge pull request '* Changed QueryInterval back' (#6) from Warehouses into master
Reviewed-on: #6
2026-01-11 12:17:31 +00:00
05d9fdbbe3 Merge pull request '* Changed query interval' (#5) from Warehouses into master
Reviewed-on: #5
2026-01-11 11:50:35 +00:00
bf1d50db34 Merge pull request 'OrdersManagement: Fixed references' (#4) from Warehouses into master
Reviewed-on: #4
2026-01-11 11:43:56 +00:00
2 changed files with 321 additions and 44 deletions

View File

@@ -5,42 +5,158 @@ when:
- merge
branch: master
steps:
clone-manual:
image: woodpeckerci/plugin-git
settings:
remote: http://gitea:3000/${CI_REPO}.git
branch: ${CI_COMMIT_BRANCH}
depth: 1
detect-changed-projects:
image: alpine
commands:
- |
set -euf
cd "${CI_WORKSPACE}"
echo "CI_PIPELINE_FILES=${CI_PIPELINE_FILES:-<empty>}"
apk add --no-cache findutils
> changed-projects.txt
echo "${CI_PIPELINE_FILES:-}" \
| sed 's/^\[//; s/\]$//' \
| tr ',' '\n' \
| sed 's/^ *//; s/ *$//' \
| sed '/^$/d' \
| while read path; do
echo "→ changed file: $path"
dir=$(dirname "$path")
while [ "$dir" != "." ] && [ "$dir" != "/" ]; do
csproj=$(find "$dir" -maxdepth 1 -name "*.csproj" -type f | head -n 1 || true)
if [ -n "$csproj" ]; then
echo "$csproj" >> changed-projects.txt
break
fi
dir=$(dirname "$dir")
done
done
# unikalne projekty
sort -u -o changed-projects.txt changed-projects.txt
echo "Zmienione projekty:"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pipeline zakonczony."
# exit 0 = sukces, wiec kolejne kroki, ktore od niego zaleza, nie poleca
exit 0
fi
cat changed-projects.txt
depends_on: [clone-manual]
debug-location:
image: alpine
commands:
- pwd
- ls -la
- find /woodpecker -maxdepth 4 -type d 2>/dev/null
clone-manual:
image: woodpeckerci/plugin-git
settings:
remote: http://gitea:3000/FA/FA_WEB.git
branch: master
depth: 1
depends_on: [detect-changed-projects]
restore:
image: mcr.microsoft.com/dotnet/sdk:latest
commands:
- |
set -euf
cd "${CI_WORKSPACE}"
echo "Aktualna ścieżka: $(pwd)"
echo "Aktualna ścieżka do pliku: $(pwd)"
echo "=== Restore wszystkich projektów ==="
find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektów nic do restore."
exit 0
fi
cat <<EOF > NuGet.Config
<?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:80/v3/index.json" allowInsecureConnections="true" />
</packageSources>
</configuration>
EOF
echo "=== Restore zmienionych projektów ==="
while read csproj; do
echo "→ dotnet restore $csproj"
dotnet restore "$csproj"
done < changed-projects.txt
# find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
depends_on: [detect-changed-projects]
test:
image: mcr.microsoft.com/dotnet/sdk:latest
commands:
- |
set -euf
cd "${CI_WORKSPACE}"
echo "=== Uruchamianie testów ==="
dotnet test --no-restore --configuration Release --logger "trx"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam test."
exit 0
fi
echo "=== Konfiguracja NuGet sources ==="
cat <<EOF > NuGet.Config
<?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:80/v3/index.json" allowInsecureConnections="true" />
</packageSources>
</configuration>
EOF
echo "=== Uruchamianie testów dla zmienionych projektow ==="
while read csproj; do
echo "→ dotnet test $csproj"
dotnet test --configuration Release --logger "trx;LogFileName=tests.trx" --results-directory TestResults
done < changed-projects.txt
depends_on: [restore]
pipeline-agent:
image: mcr.microsoft.com/dotnet/sdk:latest
environment:
OPENAI_API_KEY:
from_secret: openai_api_key
VAULT_URL:
from_secret: vault_url
VAULT_TOKEN:
from_secret: vault_token
commands:
- |
set -euf
cd "${CI_WORKSPACE}"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam AI-gate."
exit 0
fi
dotnet run --project PipelineAgent/PipelineAgent.csproj "check-changes" "$(pwd)"
depends_on: [detect-changed-projects]
pack-datamodels:
image: mcr.microsoft.com/dotnet/sdk:latest
commands:
- |
set -euf
cd "${CI_WORKSPACE}"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam pack-datamodels."
exit 0
fi
echo "=== Instalacja MinVer CLI ==="
dotnet tool install --tool-path /tmp/minver minver-cli
echo "=== Obliczona wersja przez MinVer ==="
@@ -62,7 +178,7 @@ steps:
find . -name "*.csproj" -type f | sort
mkdir -p nupkg
echo "=== Pakowanie projektów DataModel (wykrywane po obecności <PackageId>) ==="
find . -name "*.csproj" -type f | while read csproj; do
while read csproj; do
if grep -q '<PackageId>' "$csproj"; then
PROJECT_NAME=$(basename "$csproj" .csproj)
echo "→ Pakuję $PROJECT_NAME ($csproj)"
@@ -74,10 +190,66 @@ steps:
PROJECT_NAME=$(basename "$csproj" .csproj)
echo "→ Pomijam $PROJECT_NAME brak <PackageId>"
fi
done
done < changed-projects.txt
echo "=== Spakowane pakiety ==="
ls -la nupkg/ || echo "Brak spakowanych pakietów!"
#depends_on: [ai-agent-gate]
depends_on: [test]
publish-linux-local:
image: mcr.microsoft.com/dotnet/sdk:latest
commands:
- |
set -euf
cd "${CI_WORKSPACE}"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam AI-gate."
exit 0
fi
mkdir -p linux-apps
echo "=== Konfiguracja NuGet sources ==="
cat <<EOF > NuGet.Config
<?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:80/v3/index.json" allowInsecureConnections="true" />
</packageSources>
</configuration>
EOF
echo "=== Publikacja aplikacji LinuxLocal ==="
#find . -name "*.csproj" -type f | while read csproj; do
while read csproj; do
PROJECT_TYPE=$(dotnet msbuild "$csproj" -getProperty:ProjectType -noLogo 2>/dev/null || echo "Unknown")
if [ "$PROJECT_TYPE" = "LinuxLocal" ]; then
PROJECT_NAME=$(basename "$csproj" .csproj)
echo "→ Publishing $PROJECT_NAME"
dotnet publish "$csproj" \
--configuration Release \
--output "./linux-apps/$PROJECT_NAME" \
--runtime linux-x64 \
--self-contained false
fi
#done
done < changed-projects.txt
echo ""
if [ -d "./linux-apps" ] && [ "$(ls -A ./linux-apps)" ]; then
echo "Opublikowane aplikacje:"
ls -la linux-apps/
else
echo "Brak aplikacji LinuxLocal do publikacji"
fi
#depends_on: [ai-agent-gate]
depends_on: [test]
publish-datamodels-to-baget:
image: mcr.microsoft.com/dotnet/sdk:latest
environment:
@@ -87,6 +259,12 @@ steps:
- |
set -euf
cd "${CI_WORKSPACE}"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam publish-datamodels-to-baget."
exit 0
fi
echo "=== Test połączenia z BaGetter ==="
curl -f http://baget:80/v3/index.json || echo "Nie można połączyć się z BaGetter!"
cat <<EOF > NuGet.Config
@@ -108,6 +286,7 @@ steps:
--skip-duplicate
done
depends_on: [pack-datamodels]
select-projects-for-container:
image: mcr.microsoft.com/dotnet/sdk:latest
commands:
@@ -115,25 +294,38 @@ steps:
set -euf
cd "${CI_WORKSPACE}"
> projects-to-build.txt
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam select-projects-for-container."
exit 0
fi
find . -name "*.csproj" -type f | while read csproj; do
echo "=== Selekcja projektów do konteneryzacji ==="
#find . -name "*.csproj" -type f | while read csproj; do
while read csproj; do
PROJECT_NAME=$(basename "$csproj" .csproj)
PROJECT_TYPE=$(dotnet msbuild "$csproj" -getProperty:ProjectType -noLogo 2>/dev/null || echo "Unknown")
if [[ "$PROJECT_TYPE" == "Linux" || "$PROJECT_TYPE" == "Api" || "$PROJECT_TYPE" == "ServerProcess" || "$PROJECT_TYPE" == "Blazor" ]]; then
PROJECT_NAME=$(basename "$csproj" .csproj)
if [ "$PROJECT_TYPE" = "Linux" ] || [ "$PROJECT_TYPE" = "Api" ] || [ "$PROJECT_TYPE" = "ServerProcess" ] || [ "$PROJECT_TYPE" = "Blazor" ] || [ "$PROJECT_TYPE" = "LinuxLocal" ]; then
PROJECT_DIR=$(dirname "$csproj")
echo "→ Dodaję $PROJECT_NAME (typ: $PROJECT_TYPE)"
echo "$PROJECT_DIR|$PROJECT_NAME" >> projects-to-build.txt
else
PROJECT_NAME=$(basename "$csproj" .csproj)
echo "→ Pomijam $PROJECT_NAME (typ: $PROJECT_TYPE)"
fi
done
#done
done < changed-projects.txt
echo "=== Znaleziono projektow do budowy ==="
cat projects-to-build.txt || echo "Brak projektów!"
wc -l < projects-to-build.txt
echo ""
if [ -s projects-to-build.txt ]; then
echo "Znalezione projekty:"
cat projects-to-build.txt
echo "Łącznie: $(wc -l < projects-to-build.txt)"
else
echo "BRAK PROJEKTÓW DO BUDOWY!"
fi
depends_on: [publish-datamodels-to-baget]
containerize-apps:
image: docker:27-cli
environment:
@@ -145,6 +337,17 @@ steps:
- |
set -euf
cd "${CI_WORKSPACE}"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam contenerize-apps."
exit 0
fi
REGISTRY_ORG="fa"
echo "=== DEBUG: Zawartość projects-to-build.txt ==="
cat projects-to-build.txt || echo "Plik nie istnieje!"
echo "=== DEBUG: REGISTRY_ORG = '$REGISTRY_ORG' ==="
echo "$GITEA_TOKEN" | docker login git.modwad.pl -u "$GITEA_USER" --password-stdin
@@ -169,16 +372,20 @@ steps:
cat projects-to-build.txt | while IFS='|' read -r PDIR PNAME; do
PDIR=$(echo "$PDIR" | xargs)
PNAME=$(echo "$PNAME" | xargs)
echo "=== DEBUG: PDIR='$PDIR' PNAME='$PNAME' ==="
test -z "$PNAME" && continue
test ! -d "$PDIR" && continue
echo -n "git.modwad.pl/fa/" > /tmp/tag.txt
echo "$PNAME" | tr 'A-Z' 'a-z' | tr -d '\n' >> /tmp/tag.txt
echo "=== DEBUG: Generated tag: $(cat /tmp/tag.txt) ==="
echo "$PNAME" > /tmp/pname.txt
echo "$PDIR" | sed 's|^\./||' > /tmp/pdir.txt
cat > "Dockerfile.temp" <<'ENDOFDOCKERFILE'
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
@@ -194,47 +401,114 @@ steps:
ENV ASPNETCORE_URLS=http://+:8080
ENTRYPOINT ["dotnet", "%%PROJECTNAME%%.dll"]
ENDOFDOCKERFILE
REAL_PNAME=$(cat /tmp/pname.txt)
REAL_PDIR=$(cat /tmp/pdir.txt)
sed "s|%%PROJECTNAME%%|$REAL_PNAME|g; s|%%PROJECTDIR%%|$REAL_PDIR|g" "Dockerfile.temp" > "Dockerfile.final"
echo "=== Budowanie obrazu ==="
DOCKER_BUILDKIT=0 docker build \
--network=host \
-t "$(cat /tmp/tag.txt):${CI_COMMIT_SHA}" \
-t "$(cat /tmp/tag.txt):latest" \
-f "Dockerfile.final" \
. || { echo "BUILD FAILED"; exit 1; }
echo "=== Obraz zbudowany, sprawdzam ==="
docker images | grep "$(cat /tmp/tag.txt | sed 's|git.modwad.pl/||')" || echo "Obraz nie znaleziony w docker images"
.
echo "=== Pushing SHA tag ==="
docker push "$(cat /tmp/tag.txt):${CI_COMMIT_SHA}" || { echo "PUSH SHA FAILED"; exit 1; }
docker push "$(cat /tmp/tag.txt):${CI_COMMIT_SHA}"
echo "=== Pushing latest tag ==="
docker push "$(cat /tmp/tag.txt):latest" || { echo "PUSH LATEST FAILED"; exit 1; }
docker push "$(cat /tmp/tag.txt):latest"
echo "=== SUCCESS: $(cat /tmp/tag.txt) ==="
rm -f "Dockerfile.temp" "Dockerfile.final"
done
echo "=== WSZYSTKIE PROJEKTY ZAKONCZONE ==="
depends_on: [select-projects-for-container]
deploy-linux-local:
image: alpine:latest
commands:
- |
cd "${CI_WORKSPACE}"
if [ ! -s changed-projects.txt ]; then
echo "Brak zmienionych projektow pomijam deploy-linux-local."
exit 0
fi
echo "=== Sprawdzanie aplikacji LinuxLocal ==="
if [ ! -d "./linux-apps" ]; then
echo "Folder ./linux-apps nie istnieje"
exit 0
fi
echo "=== DEBUG: Zawartość ./linux-apps/ ==="
ls -la ./linux-apps/
echo "=== Wdrażanie aplikacji LinuxLocal do /opt/fa-apps/ ==="
mkdir -p /opt/fa-apps
cd ./linux-apps
for app in *; do
echo "→ DEBUG: Sprawdzam $app"
if [ ! -d "$app" ]; then
echo " → $app nie jest folderem, pomijam"
continue
fi
echo " → Kopiuję $app"
echo " → Zawartość:"
ls -la "$app/"
rm -rf "/opt/fa-apps/$app"
cp -r "$app" "/opt/fa-apps/$app"
find "/opt/fa-apps/$app" -type f -executable -exec chmod +x {} \;
echo " → Skopiowano!"
done
cd "${CI_WORKSPACE}"
echo ""
echo "=== Wdrożone aplikacje ==="
ls -laR /opt/fa-apps/
depends_on: [publish-linux-local, containerize-apps]
cleanup-docker:
image: docker:27-cli
commands:
- |
echo "=== Czyszczenie starych obrazów ==="
docker image prune -af --filter "until=24h"
echo "=== Czyszczenie nieużywanych kontenerów ==="
echo "=== Status przed czyszczeniem ==="
docker system df
echo ""
echo "=== Usuwanie dangling images ==="
docker image prune -f
echo ""
echo "=== Usuwanie starych wersji aplikacji ==="
docker images --format "{{.Repository}}:{{.Tag}}" | grep "git.modwad.pl/" | grep -v ":latest" | grep -v ":${CI_COMMIT_SHA}" | while read img; do
echo "Usuwam: $img"
docker rmi "$img" || true
done
echo ""
echo "=== Usuwanie kontenerów ==="
docker container prune -f
echo "=== Czyszczenie build cache ==="
docker builder prune -af --filter "until=24h"
echo ""
echo "=== Usuwanie build cache ==="
docker builder prune -af
echo ""
echo "=== Status po czyszczeniu ==="
docker system df
depends_on: [containerize-apps]
depends_on: [deploy-linux-local]
when:
status: [success, failure]

View File

@@ -918,6 +918,7 @@ namespace SytelineSaAppEfDataModel
.HasMaxLength(500)
.IsRequired(false);
// Relationship
entity.HasOne(e => e.Client)
.WithMany()
.HasForeignKey(e => e.FK_Client)
@@ -1024,7 +1025,8 @@ namespace SytelineSaAppEfDataModel
.HasColumnName("part_number_sl")
.HasMaxLength(100)
.IsRequired(false);
// Relationship
entity.HasOne(e => e.Header)
.WithMany()
.HasForeignKey(e => e.FK_Header)
@@ -2577,6 +2579,7 @@ namespace SytelineSaAppEfDataModel
.HasColumnType("int")
.IsRequired(false);
// Foreign Key
entity.HasOne(e => e.Header)
.WithMany()
.HasForeignKey(e => e.FKHeader)