diff --git a/.drone.yml b/.drone.yml index e894c9c..e308f60 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,18 +23,14 @@ steps: - cd flea - git submodule update --init --recursive - - name: prepare-dotnet - image: mcr.microsoft.com/dotnet/sdk:8.0 - commands: - - echo "=== .NET SDK Info ===" - - dotnet --info - - echo "=== Restore all projects to warm up cache ===" - - cd flea - - find . -name '*.sln' -exec dotnet restore {} \; - # πŸ‹ Kaniko steps with caching enabled + # πŸš€ Optimized: 3 parallel build streams - - name: build & push telegram-listener + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + # πŸ”΅ Stream 1: telegram-listener β†’ telegram-client + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + - name: telegram-listener-build-push image: gcr.io/kaniko-project/executor:debug environment: HUB_USERNAME: @@ -52,55 +48,12 @@ steps: --destination=hub.musk.fun/k8s/nocr/telegram_listener:latest --cache=true --cache-repo=hub.musk.fun/k8s/cache/nocr-telegram-listener + --compressed-caching=true --verbosity=info depends_on: - - prepare-dotnet + - clone - - name: build & push text-matcher - image: gcr.io/kaniko-project/executor:debug - environment: - HUB_USERNAME: - from_secret: hub_username - HUB_PASSWORD: - from_secret: hub_password - commands: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"hub.musk.fun\":{\"username\":\"$HUB_USERNAME\",\"password\":\"$HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json - - cd flea/text-matcher - - /kaniko/executor - --context=. - --dockerfile=src/Nocr.TextMatcher.Host/Dockerfile - --destination=hub.musk.fun/k8s/nocr/text_matcher:${DRONE_COMMIT_SHA:0:7} - --destination=hub.musk.fun/k8s/nocr/text_matcher:latest - --cache=true - --cache-repo=hub.musk.fun/k8s/cache/nocr-text-matcher - --verbosity=info - depends_on: - - build & push telegram-listener - - - name: build & push users - image: gcr.io/kaniko-project/executor:debug - environment: - HUB_USERNAME: - from_secret: hub_username - HUB_PASSWORD: - from_secret: hub_password - commands: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"hub.musk.fun\":{\"username\":\"$HUB_USERNAME\",\"password\":\"$HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json - - cd flea/users - - /kaniko/executor - --context=. - --dockerfile=src/Nocr.Users.Host/Dockerfile - --destination=hub.musk.fun/k8s/nocr/users:${DRONE_COMMIT_SHA:0:7} - --destination=hub.musk.fun/k8s/nocr/users:latest - --cache=true - --cache-repo=hub.musk.fun/k8s/cache/nocr-users - --verbosity=info - depends_on: - - build & push text-matcher - - - name: build & push telegram-client + - name: telegram-client-build-push image: gcr.io/kaniko-project/executor:debug environment: HUB_USERNAME: @@ -118,11 +71,39 @@ steps: --destination=hub.musk.fun/k8s/nocr/telegram_client:latest --cache=true --cache-repo=hub.musk.fun/k8s/cache/nocr-telegram-client + --compressed-caching=true --verbosity=info depends_on: - - build & push users + - telegram-listener-build-push - - name: build & push text-matcher migrator + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + # 🟒 Stream 2: text-matcher β†’ text-matcher-migrator + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + - name: text-matcher-build-push + image: gcr.io/kaniko-project/executor:debug + environment: + HUB_USERNAME: + from_secret: hub_username + HUB_PASSWORD: + from_secret: hub_password + commands: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"hub.musk.fun\":{\"username\":\"$HUB_USERNAME\",\"password\":\"$HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json + - cd flea/text-matcher + - /kaniko/executor + --context=. + --dockerfile=src/Nocr.TextMatcher.Host/Dockerfile + --destination=hub.musk.fun/k8s/nocr/text_matcher:${DRONE_COMMIT_SHA:0:7} + --destination=hub.musk.fun/k8s/nocr/text_matcher:latest + --cache=true + --cache-repo=hub.musk.fun/k8s/cache/nocr-text-matcher + --compressed-caching=true + --verbosity=info + depends_on: + - clone + + - name: text-matcher-migrator-build-push image: gcr.io/kaniko-project/executor:debug environment: HUB_USERNAME: @@ -140,11 +121,39 @@ steps: --destination=hub.musk.fun/k8s/nocr/text_matcher_migrator:latest --cache=true --cache-repo=hub.musk.fun/k8s/cache/nocr-text-matcher-migrator + --compressed-caching=true --verbosity=info depends_on: - - build & push telegram-client + - text-matcher-build-push - - name: build & push users migrator + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + # 🟑 Stream 3: users β†’ users-migrator + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + - name: users-build-push + image: gcr.io/kaniko-project/executor:debug + environment: + HUB_USERNAME: + from_secret: hub_username + HUB_PASSWORD: + from_secret: hub_password + commands: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"hub.musk.fun\":{\"username\":\"$HUB_USERNAME\",\"password\":\"$HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json + - cd flea/users + - /kaniko/executor + --context=. + --dockerfile=src/Nocr.Users.Host/Dockerfile + --destination=hub.musk.fun/k8s/nocr/users:${DRONE_COMMIT_SHA:0:7} + --destination=hub.musk.fun/k8s/nocr/users:latest + --cache=true + --cache-repo=hub.musk.fun/k8s/cache/nocr-users + --compressed-caching=true + --verbosity=info + depends_on: + - clone + + - name: users-migrator-build-push image: gcr.io/kaniko-project/executor:debug environment: HUB_USERNAME: @@ -162,12 +171,16 @@ steps: --destination=hub.musk.fun/k8s/nocr/users_migrator:latest --cache=true --cache-repo=hub.musk.fun/k8s/cache/nocr-users-migrator + --compressed-caching=true --verbosity=info depends_on: - - build & push text-matcher migrator + - users-build-push - # πŸ“¦ NuGet publishing (оставляСм .NET SDK) - - name: publish telegram-listener nuget + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + # πŸ“¦ NuGet publishing - 3 parallel streams after all builds complete + # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + - name: telegram-listener-nuget-publish image: mcr.microsoft.com/dotnet/sdk:8.0 environment: VERSION: ${DRONE_TAG} @@ -178,9 +191,11 @@ steps: - dotnet pack ./flea/telegram-listener/Nocr.TelegramListener.sln -o ./flea/telegram-listener/bin - dotnet nuget push ./flea/telegram-listener/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate depends_on: - - build & push users migrator + - telegram-client-build-push + - text-matcher-migrator-build-push + - users-migrator-build-push - - name: publish text-matcher nuget + - name: text-matcher-nuget-publish image: mcr.microsoft.com/dotnet/sdk:8.0 environment: VERSION: ${DRONE_TAG} @@ -191,9 +206,11 @@ steps: - dotnet pack ./flea/text-matcher/Nocr.TextMatcher.sln -o ./flea/text-matcher/bin - dotnet nuget push ./flea/text-matcher/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate depends_on: - - publish telegram-listener nuget + - telegram-client-build-push + - text-matcher-migrator-build-push + - users-migrator-build-push - - name: publish users nuget + - name: users-nuget-publish image: mcr.microsoft.com/dotnet/sdk:8.0 environment: VERSION: ${DRONE_TAG} @@ -204,4 +221,6 @@ steps: - dotnet pack ./flea/users/Nocr.Users.sln -o ./flea/users/bin - dotnet nuget push ./flea/users/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate depends_on: - - publish text-matcher nuget + - telegram-client-build-push + - text-matcher-migrator-build-push + - users-migrator-build-push