Merge pull request 'force pipeline detection - dodanie cache buster w .woodpecker.yml' (#2) from Warehouses into master
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
Reviewed-on: http://git.modwad.pl/FA/FA_WEB/pulls/2
This commit was merged in pull request #2.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
skip_clone: true
|
||||
|
||||
when:
|
||||
event: [push, tag, manual]
|
||||
branch: [master]
|
||||
wwhen:
|
||||
event: push
|
||||
branch: master
|
||||
|
||||
steps:
|
||||
debug-location:
|
||||
image: alpine
|
||||
commands:
|
||||
- pwd # gdzie aktualnie jesteśmy
|
||||
- ls -la # co jest w bieżącym katalogu
|
||||
- find /woodpecker -maxdepth 4 -type d 2>/dev/null
|
||||
clone-manual:
|
||||
image: woodpeckerci/plugin-git
|
||||
settings:
|
||||
@@ -17,8 +23,8 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
CODE_DIR="/woodpecker/src/localhost/git/FA/FA_WEB"
|
||||
cd "$CODE_DIR"
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "Aktualna ścieżka: $(pwd)"
|
||||
echo "=== Restore wszystkich projektów ==="
|
||||
find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
|
||||
|
||||
@@ -27,8 +33,7 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
CODE_DIR="/woodpecker/src/localhost/git/FA/FA_WEB"
|
||||
cd "$CODE_DIR"
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Uruchamianie testów ==="
|
||||
dotnet test --no-restore --configuration Release --logger "trx"
|
||||
depends_on: [restore]
|
||||
@@ -38,11 +43,9 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Instalacja MinVer CLI ==="
|
||||
dotnet tool install --tool-path /tmp/minver minver-cli
|
||||
CODE_DIR="/woodpecker/src/localhost/git/FA/FA_WEB"
|
||||
cd "$CODE_DIR"
|
||||
|
||||
echo "=== Obliczona wersja przez MinVer ==="
|
||||
MINVER_VERSION=$(/tmp/minver/minver \
|
||||
--auto-increment patch \
|
||||
@@ -53,7 +56,6 @@ steps:
|
||||
echo "Wersja: $MINVER_VERSION"
|
||||
|
||||
mkdir -p nupkg
|
||||
|
||||
echo "=== Pełniejsze fetch git (unshallow + tags) ==="
|
||||
git fetch --prune --unshallow || echo "Już full clone – OK"
|
||||
git fetch --tags
|
||||
@@ -63,7 +65,6 @@ steps:
|
||||
git tag -l
|
||||
echo "=== Aktualny commit i opis ==="
|
||||
git describe --tags --always --dirty
|
||||
|
||||
echo "=== Diagnostyka projektów ==="
|
||||
find . -name "*.csproj" -type f | sort
|
||||
mkdir -p nupkg
|
||||
@@ -72,7 +73,6 @@ steps:
|
||||
if grep -q '<PackageId>' "$csproj"; then
|
||||
PROJECT_NAME=$(basename "$csproj" .csproj)
|
||||
echo "→ Pakuję $PROJECT_NAME ($csproj)"
|
||||
#dotnet pack "$csproj" --configuration Release -o "$CODE_DIR/nupkg" /p:PackageVersion=$MINVER_VERSION
|
||||
dotnet pack "$csproj" \
|
||||
--configuration Release \
|
||||
-o "./nupkg" \
|
||||
@@ -94,12 +94,9 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
CODE_DIR="/woodpecker/src/localhost/git/FA/FA_WEB"
|
||||
cd "$CODE_DIR"
|
||||
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Test połączenia z BaGetter ==="
|
||||
curl -f http://baget:80/v3/index.json || echo "Nie można połączyć się z BaGetter!"
|
||||
|
||||
# Tworzymy minimalny NuGet.Config tylko po to, żeby odblokować HTTP dla nazwanego źródła
|
||||
cat <<EOF > NuGet.Config
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
@@ -111,10 +108,8 @@ steps:
|
||||
</packageSources>
|
||||
</configuration>
|
||||
EOF
|
||||
|
||||
echo "=== Użyty NuGet.Config (tylko do odblokowania HTTP) ==="
|
||||
cat NuGet.Config
|
||||
|
||||
echo "=== Publikacja pakietów do BaGetter ==="
|
||||
find ./nupkg -name "*.nupkg" -type f | while read pkg; do
|
||||
echo "→ Push $(basename "$pkg")"
|
||||
@@ -123,20 +118,15 @@ steps:
|
||||
--api-key "$BAGETTER_API_KEY" \
|
||||
--skip-duplicate
|
||||
done
|
||||
|
||||
echo "Wszystkie pakiety DataModel opublikowane w BaGetter!"
|
||||
depends_on: [pack-datamodels]
|
||||
|
||||
build-and-publish-apps:
|
||||
image: mcr.microsoft.com/dotnet/sdk:latest
|
||||
# environment:
|
||||
# DEPLOY_SSH_KEY:
|
||||
# from_secret: deploy_ssh_key
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
CODE_DIR="/woodpecker/src/localhost/git/FA/FA_WEB"
|
||||
cd "$CODE_DIR"
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Ponowny restore aplikacji (z najnowszymi pakietami z BaGetter) ==="
|
||||
find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
|
||||
echo "=== Publish aplikacji ==="
|
||||
@@ -150,7 +140,7 @@ steps:
|
||||
continue
|
||||
fi
|
||||
echo "→ Publish $PROJECT_NAME ($csproj)"
|
||||
dotnet publish "$csproj" --no-restore -c Release -o "$CODE_DIR/publish-$PROJECT_NAME"
|
||||
dotnet publish "$csproj" --no-restore -c Release -o "./publish-$PROJECT_NAME"
|
||||
# ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
|
||||
# Tu wstaw swój kod deployu (rsync/ssh itp.)
|
||||
# ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
|
||||
|
||||
Reference in New Issue
Block a user