78 lines
2.2 KiB
YAML
78 lines
2.2 KiB
YAML
kind: pipeline
|
|
type: kubernetes
|
|
|
|
name: build-and-deploy-dev
|
|
|
|
# clone:
|
|
# disable: true
|
|
|
|
volumes:
|
|
- name: maven-cache
|
|
claim:
|
|
name: maven-cache-pvc
|
|
- name: maven-settings
|
|
config_map:
|
|
name: violin-maven-settings
|
|
|
|
service_account_name: drone-builder-sa
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
branch:
|
|
- dev
|
|
- master
|
|
|
|
steps:
|
|
- name: debug-inotify
|
|
image: gitea.violin-work.online/registry/maven:3.9-eclipse-temurin-22
|
|
commands:
|
|
- grep Seccomp /proc/self/status || true
|
|
- cat /proc/self/attr/current || true
|
|
- python3 -c "import ctypes; libc=ctypes.CDLL('libc.so.6'); fd=libc.inotify_init(); print('inotify_init:', fd); ret=libc.inotify_add_watch(fd, b'/tmp', 1); print('add_watch:', ret)" 2>&1 || true
|
|
- ulimit -n
|
|
- cat /proc/self/limits | grep "Max open files"
|
|
- apt-get update && apt-get install -y strace
|
|
- strace -e trace=inotify_add_watch -f -o /tmp/inotify.log
|
|
mvn clean install -DskipTests -B --no-transfer-progress
|
|
-Dmaven.watcher.disabled=true || true
|
|
- grep "inotify_add_watch" /tmp/inotify.log | wc -l
|
|
- head -50 /tmp/inotify.log
|
|
|
|
- name: compile
|
|
image: gitea.violin-work.online/registry/maven:3.9-eclipse-temurin-22
|
|
environment:
|
|
MAVEN_OPTS: >-
|
|
-Dmaven.watcher.disabled=true
|
|
-Dmaven.compiler.useIncrementalCompilation=false
|
|
-Xmx2g
|
|
commands:
|
|
- mkdir -p /root/.m2
|
|
- cp /config/settings.xml /root/.m2/settings.xml
|
|
- mvn clean install -DskipTests -B --no-transfer-progress
|
|
volumes:
|
|
- name: maven-cache
|
|
path: /root/.m2
|
|
- name: maven-settings
|
|
path: /config
|
|
|
|
- name: build
|
|
# use plugin/kaniko
|
|
image: gitea.violin-work.online/registry/drone-kaniko:latest
|
|
settings:
|
|
repo: gitea.violin-work.online/violin/violin-iam
|
|
tags:
|
|
- latest
|
|
- ${DRONE_COMMIT_SHA:0:8}
|
|
dockerfile: Dockerfile
|
|
context: .
|
|
registry: gitea.violin-work.online
|
|
username: simple321vip
|
|
password:
|
|
from_secret: docker_password
|
|
|
|
- name: deploy
|
|
image: gitea.violin-work.online/registry/kubectl:latest
|
|
commands:
|
|
- kubectl set image deployment/violin-iam violin-iam=gitea.violin-work.online/violin/violin-iam:${DRONE_COMMIT_SHA:0:8} -n violin
|