mirror of
https://github.com/azaion/detections.git
synced 2026-06-21 05:31:07 +00:00
42 lines
1.6 KiB
YAML
42 lines
1.6 KiB
YAML
when:
|
|
- event: [manual]
|
|
evaluate: 'BUILD_JETSON_TRT104 == "1"'
|
|
|
|
labels:
|
|
platform: arm64
|
|
|
|
steps:
|
|
- name: build-push-jetson-trt104
|
|
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"
|
|
if [ -z "$RAW_BRANCH" ]; then RAW_BRANCH="$WOODPECKER_COMMIT_BRANCH"; fi
|
|
if [ -z "$RAW_BRANCH" ]; then RAW_BRANCH="$CI_COMMIT_REF"; fi
|
|
if [ -z "$RAW_BRANCH" ]; then RAW_BRANCH="$WOODPECKER_COMMIT_REF"; fi
|
|
if [ -z "$RAW_BRANCH" ]; then RAW_BRANCH="manual"; fi
|
|
SAFE_BRANCH=$(printf '%s' "$RAW_BRANCH" | sed 's#^refs/heads/##; s#^refs/tags/##; s#[^A-Za-z0-9_.-]#-#g; s#^-*##; s#-*$##')
|
|
if [ -z "$SAFE_BRANCH" ]; then SAFE_BRANCH="manual"; fi
|
|
TAG="$SAFE_BRANCH-arm-trt104"
|
|
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.jetson.trt104 \
|
|
--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
|