rewrite to total kaniko build.
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
d43885fb63
commit
5f711f4229
242
.drone.yml
242
.drone.yml
@ -1,88 +1,40 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
name: Nocr
|
name: Nocr (Kaniko)
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
namespace: musk-drone
|
namespace: musk-drone
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
ref:
|
ref:
|
||||||
- refs/tags/*
|
- refs/tags/*
|
||||||
# - refs/heads/main
|
#- refs/heads/main
|
||||||
|
|
||||||
clone:
|
clone:
|
||||||
disable: true
|
disable: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: debug
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- printenv
|
|
||||||
|
|
||||||
- name: clone
|
- name: clone
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
settings:
|
|
||||||
tags: true
|
|
||||||
commands:
|
commands:
|
||||||
- pwd
|
|
||||||
- git clone https://gitea.musk.fun/nocr/flea
|
- git clone https://gitea.musk.fun/nocr/flea
|
||||||
- cd flea
|
- cd flea
|
||||||
- git submodule update --init --recursive
|
- git submodule update --init --recursive
|
||||||
|
|
||||||
- name: debug-network
|
- name: prepare-dotnet
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache bind-tools curl ca-certificates
|
|
||||||
- echo "=== System Info ==="
|
|
||||||
- cat /etc/os-release
|
|
||||||
- echo ""
|
|
||||||
- echo "=== DNS Configuration ==="
|
|
||||||
- cat /etc/resolv.conf
|
|
||||||
- echo ""
|
|
||||||
- echo "=== DNS Resolution Test ==="
|
|
||||||
- nslookup api.nuget.org || echo "DNS lookup failed"
|
|
||||||
- nslookup gitea.musk.fun || echo "DNS lookup failed for gitea"
|
|
||||||
- echo ""
|
|
||||||
- echo "=== Ping Test (NuGet) ==="
|
|
||||||
- ping -c 3 api.nuget.org || echo "Ping failed"
|
|
||||||
- echo ""
|
|
||||||
- echo "=== HTTPS Connection Test (NuGet) ==="
|
|
||||||
- curl -v --connect-timeout 10 --max-time 30 https://api.nuget.org/v3/index.json 2>&1 | head -50
|
|
||||||
- echo ""
|
|
||||||
- echo "=== HTTPS Connection Test (Gitea) ==="
|
|
||||||
- curl -v --connect-timeout 10 --max-time 30 https://gitea.musk.fun 2>&1 | head -30
|
|
||||||
- echo ""
|
|
||||||
- echo "=== CA Certificates Check ==="
|
|
||||||
- ls -lah /etc/ssl/certs/ | head -20
|
|
||||||
depends_on:
|
|
||||||
- clone
|
|
||||||
|
|
||||||
- name: debug-dotnet-restore
|
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
commands:
|
commands:
|
||||||
- echo "=== .NET SDK Info ==="
|
- echo "=== .NET SDK Info ==="
|
||||||
- dotnet --info
|
- dotnet --info
|
||||||
- echo ""
|
- echo "=== Restore all projects to warm up cache ==="
|
||||||
- echo "=== CA Certificates Update ==="
|
- cd flea
|
||||||
- apt-get update && apt-get install -y --no-install-recommends ca-certificates
|
- find . -name '*.sln' -exec dotnet restore {} \;
|
||||||
- update-ca-certificates
|
|
||||||
- echo ""
|
|
||||||
- echo "=== Test NuGet Connection ==="
|
|
||||||
- dotnet nuget list source
|
|
||||||
- echo ""
|
|
||||||
- echo "=== Test Restore with Simple Project ==="
|
|
||||||
- mkdir -p /tmp/test && cd /tmp/test
|
|
||||||
- dotnet new console
|
|
||||||
- echo "Adding package reference..."
|
|
||||||
- dotnet add package Newtonsoft.Json --version 13.0.3
|
|
||||||
- echo "Testing restore..."
|
|
||||||
- dotnet restore --verbosity detailed 2>&1 | tail -100
|
|
||||||
depends_on:
|
|
||||||
- debug-network
|
|
||||||
|
|
||||||
- name: docker nocr telegram listener build & push
|
# 🐋 Kaniko steps with caching enabled
|
||||||
|
|
||||||
|
- name: build & push telegram-listener
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
environment:
|
environment:
|
||||||
HUB_USERNAME:
|
HUB_USERNAME:
|
||||||
@ -90,102 +42,132 @@ steps:
|
|||||||
HUB_PASSWORD:
|
HUB_PASSWORD:
|
||||||
from_secret: hub_password
|
from_secret: hub_password
|
||||||
commands:
|
commands:
|
||||||
- echo "=== Kaniko version ==="
|
|
||||||
- /kaniko/executor version
|
|
||||||
- echo ""
|
|
||||||
- echo "=== Setting up authentication ==="
|
|
||||||
- mkdir -p /kaniko/.docker
|
- mkdir -p /kaniko/.docker
|
||||||
- echo "{\"auths\":{\"hub.musk.fun\":{\"username\":\"$HUB_USERNAME\",\"password\":\"$HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
- echo "{\"auths\":{\"hub.musk.fun\":{\"username\":\"$HUB_USERNAME\",\"password\":\"$HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||||
- echo ""
|
|
||||||
- echo "=== Building and pushing image ==="
|
|
||||||
- cd flea/telegram-listener
|
- cd flea/telegram-listener
|
||||||
- /kaniko/executor
|
- /kaniko/executor
|
||||||
--dockerfile=src/Nocr.TelegramListener.Host/Dockerfile
|
|
||||||
--context=.
|
--context=.
|
||||||
|
--dockerfile=src/Nocr.TelegramListener.Host/Dockerfile
|
||||||
--destination=hub.musk.fun/k8s/nocr/telegram_listener:${DRONE_COMMIT_SHA:0:7}
|
--destination=hub.musk.fun/k8s/nocr/telegram_listener:${DRONE_COMMIT_SHA:0:7}
|
||||||
--destination=hub.musk.fun/k8s/nocr/telegram_listener:latest
|
--destination=hub.musk.fun/k8s/nocr/telegram_listener:latest
|
||||||
--no-cache
|
--cache=true
|
||||||
|
--cache-repo=hub.musk.fun/k8s/cache/nocr-telegram-listener
|
||||||
--verbosity=info
|
--verbosity=info
|
||||||
- echo "=== Done ==="
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- debug-dotnet-restore
|
- prepare-dotnet
|
||||||
|
|
||||||
- name: docker nocr text matcher build & push
|
- name: build & push text-matcher
|
||||||
image: plugins/docker
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: hub.musk.fun
|
HUB_USERNAME:
|
||||||
repo: hub.musk.fun/k8s/nocr/text_matcher
|
|
||||||
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
|
|
||||||
context: ./flea/text-matcher
|
|
||||||
dockerfile: ./flea/text-matcher/src/Nocr.TextMatcher.Host/Dockerfile
|
|
||||||
username:
|
|
||||||
from_secret: hub_username
|
from_secret: hub_username
|
||||||
password:
|
HUB_PASSWORD:
|
||||||
from_secret: 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:
|
depends_on:
|
||||||
- docker nocr telegram listener build & push
|
- build & push telegram-listener
|
||||||
|
|
||||||
- name: docker nocr users build & push
|
- name: build & push users
|
||||||
image: plugins/docker
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: hub.musk.fun
|
HUB_USERNAME:
|
||||||
repo: hub.musk.fun/k8s/nocr/users
|
|
||||||
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
|
|
||||||
context: ./flea/users
|
|
||||||
dockerfile: ./flea/users/src/Nocr.Users.Host/Dockerfile
|
|
||||||
username:
|
|
||||||
from_secret: hub_username
|
from_secret: hub_username
|
||||||
password:
|
HUB_PASSWORD:
|
||||||
from_secret: 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:
|
depends_on:
|
||||||
- docker nocr text matcher build & push
|
- build & push text-matcher
|
||||||
|
|
||||||
- name: docker nocr telegram client build & push
|
- name: build & push telegram-client
|
||||||
image: plugins/docker
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: hub.musk.fun
|
HUB_USERNAME:
|
||||||
repo: hub.musk.fun/k8s/nocr/telegram_client
|
|
||||||
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
|
|
||||||
context: ./flea/telegram-client
|
|
||||||
dockerfile: ./flea/telegram-client/src/Nocr.TelegramClient.Host/Dockerfile
|
|
||||||
username:
|
|
||||||
from_secret: hub_username
|
from_secret: hub_username
|
||||||
password:
|
HUB_PASSWORD:
|
||||||
from_secret: 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/telegram-client
|
||||||
|
- /kaniko/executor
|
||||||
|
--context=.
|
||||||
|
--dockerfile=src/Nocr.TelegramClient.Host/Dockerfile
|
||||||
|
--destination=hub.musk.fun/k8s/nocr/telegram_client:${DRONE_COMMIT_SHA:0:7}
|
||||||
|
--destination=hub.musk.fun/k8s/nocr/telegram_client:latest
|
||||||
|
--cache=true
|
||||||
|
--cache-repo=hub.musk.fun/k8s/cache/nocr-telegram-client
|
||||||
|
--verbosity=info
|
||||||
depends_on:
|
depends_on:
|
||||||
- docker nocr users build & push
|
- build & push users
|
||||||
|
|
||||||
- name: docker nocr text matcher migrator build & push
|
- name: build & push text-matcher migrator
|
||||||
image: plugins/docker
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: hub.musk.fun
|
HUB_USERNAME:
|
||||||
repo: hub.musk.fun/k8s/nocr/text_matcher_migrator
|
|
||||||
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
|
|
||||||
context: ./flea/text-matcher/
|
|
||||||
dockerfile: ./flea/text-matcher/src/Nocr.TextMatcher.Migrator/Dockerfile
|
|
||||||
username:
|
|
||||||
from_secret: hub_username
|
from_secret: hub_username
|
||||||
password:
|
HUB_PASSWORD:
|
||||||
from_secret: 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.Migrator/Dockerfile
|
||||||
|
--destination=hub.musk.fun/k8s/nocr/text_matcher_migrator:${DRONE_COMMIT_SHA:0:7}
|
||||||
|
--destination=hub.musk.fun/k8s/nocr/text_matcher_migrator:latest
|
||||||
|
--cache=true
|
||||||
|
--cache-repo=hub.musk.fun/k8s/cache/nocr-text-matcher-migrator
|
||||||
|
--verbosity=info
|
||||||
depends_on:
|
depends_on:
|
||||||
- docker nocr telegram client build & push
|
- build & push telegram-client
|
||||||
|
|
||||||
- name: docker nocr users migrator build & push
|
- name: build & push users migrator
|
||||||
image: plugins/docker
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: hub.musk.fun
|
HUB_USERNAME:
|
||||||
repo: hub.musk.fun/k8s/nocr/users_migrator
|
|
||||||
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
|
|
||||||
context: ./flea/users/
|
|
||||||
dockerfile: ./flea/users/src/Nocr.Users.Migrator/Dockerfile
|
|
||||||
username:
|
|
||||||
from_secret: hub_username
|
from_secret: hub_username
|
||||||
password:
|
HUB_PASSWORD:
|
||||||
from_secret: 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.Migrator/Dockerfile
|
||||||
|
--destination=hub.musk.fun/k8s/nocr/users_migrator:${DRONE_COMMIT_SHA:0:7}
|
||||||
|
--destination=hub.musk.fun/k8s/nocr/users_migrator:latest
|
||||||
|
--cache=true
|
||||||
|
--cache-repo=hub.musk.fun/k8s/cache/nocr-users-migrator
|
||||||
|
--verbosity=info
|
||||||
depends_on:
|
depends_on:
|
||||||
- docker nocr text matcher migrator build & push
|
- build & push text-matcher migrator
|
||||||
|
|
||||||
- name: nocr telegram listener nuget package make & push
|
# 📦 NuGet publishing (оставляем .NET SDK)
|
||||||
|
- name: publish telegram-listener nuget
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
environment:
|
environment:
|
||||||
VERSION: ${DRONE_TAG}
|
VERSION: ${DRONE_TAG}
|
||||||
@ -196,9 +178,9 @@ steps:
|
|||||||
- dotnet pack ./flea/telegram-listener/Nocr.TelegramListener.sln -o ./flea/telegram-listener/bin
|
- 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
|
- dotnet nuget push ./flea/telegram-listener/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate
|
||||||
depends_on:
|
depends_on:
|
||||||
- docker nocr users migrator build & push
|
- build & push users migrator
|
||||||
|
|
||||||
- name: nocr text matcher nuget package make & push
|
- name: publish text-matcher nuget
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
environment:
|
environment:
|
||||||
VERSION: ${DRONE_TAG}
|
VERSION: ${DRONE_TAG}
|
||||||
@ -209,9 +191,9 @@ steps:
|
|||||||
- dotnet pack ./flea/text-matcher/Nocr.TextMatcher.sln -o ./flea/text-matcher/bin
|
- 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
|
- dotnet nuget push ./flea/text-matcher/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate
|
||||||
depends_on:
|
depends_on:
|
||||||
- nocr telegram listener nuget package make & push
|
- publish telegram-listener nuget
|
||||||
|
|
||||||
- name: nocr users nuget package make & push
|
- name: publish users nuget
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
environment:
|
environment:
|
||||||
VERSION: ${DRONE_TAG}
|
VERSION: ${DRONE_TAG}
|
||||||
@ -222,4 +204,4 @@ steps:
|
|||||||
- dotnet pack ./flea/users/Nocr.Users.sln -o ./flea/users/bin
|
- 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
|
- dotnet nuget push ./flea/users/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate
|
||||||
depends_on:
|
depends_on:
|
||||||
- nocr text matcher nuget package make & push
|
- publish text-matcher nuget
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user