mirror of
https://github.com/azaion/detections.git
synced 2026-06-21 05:31:07 +00:00
57 lines
2.2 KiB
YAML
57 lines
2.2 KiB
YAML
# No `depends_on: [01-test]` clause yet — the test workflow is manual-only
|
|
# while validation fixtures are being authored (see 01-test.yml header comment).
|
|
# When 01-test flips to push/pull_request triggers, add `depends_on: [01-test]`
|
|
# here so builds are gated on a green test run.
|
|
|
|
when:
|
|
- event: [push, manual]
|
|
branch: [dev, stage, main]
|
|
evaluate: 'E2E_CONVERT_JETSON != "1" && E2E_SMOKE_TEST != "1"'
|
|
|
|
# Multi-arch matrix. detections is the only repo today with split per-arch
|
|
# Dockerfiles (Jetson uses Dockerfile.jetson with TensorRT/CUDA on L4T;
|
|
# amd64 uses the plain Dockerfile). Adding amd64 = uncommenting the second
|
|
# entry once an amd64 agent and base image are in place.
|
|
matrix:
|
|
include:
|
|
- PLATFORM: arm64
|
|
TAG_SUFFIX: arm
|
|
DOCKERFILE: Dockerfile.jetson
|
|
# - PLATFORM: amd64
|
|
# TAG_SUFFIX: amd
|
|
# DOCKERFILE: Dockerfile
|
|
|
|
labels:
|
|
platform: ${PLATFORM}
|
|
|
|
steps:
|
|
- name: build-push
|
|
image: docker
|
|
environment:
|
|
REGISTRY_HOST:
|
|
from_secret: registry_host
|
|
REGISTRY_USER:
|
|
from_secret: registry_user
|
|
REGISTRY_TOKEN:
|
|
from_secret: registry_token
|
|
commands:
|
|
- echo "$REGISTRY_TOKEN" | docker login "$REGISTRY_HOST" -u "$REGISTRY_USER" --password-stdin
|
|
- |
|
|
RAW_BRANCH="${CI_COMMIT_BRANCH:-${WOODPECKER_COMMIT_BRANCH:-${CI_COMMIT_REF:-${WOODPECKER_COMMIT_REF:-manual}}}}"
|
|
SAFE_BRANCH=$(printf '%s' "$RAW_BRANCH" | sed 's#^refs/heads/##; s#^refs/tags/##; s#[^A-Za-z0-9_.-]#-#g; s#^-*##; s#-*$##')
|
|
SAFE_BRANCH="${SAFE_BRANCH:-manual}"
|
|
TAG="${SAFE_BRANCH}-${TAG_SUFFIX}"
|
|
BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
echo "RAW_BRANCH=$RAW_BRANCH"
|
|
echo "SAFE_BRANCH=$SAFE_BRANCH"
|
|
echo "TAG=$TAG"
|
|
docker build -f ${DOCKERFILE} \
|
|
--build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA \
|
|
--label org.opencontainers.image.revision=$CI_COMMIT_SHA \
|
|
--label org.opencontainers.image.created=$BUILD_DATE \
|
|
--label org.opencontainers.image.source=$CI_REPO_URL \
|
|
-t $REGISTRY_HOST/azaion/detections:$TAG .
|
|
docker push $REGISTRY_HOST/azaion/detections:$TAG
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|