Files
iopsyswrt/.gitlab-ci.yml
Andreas Gnau 2983cd3025 CI: Run build for merge requests
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2025-10-20 21:27:26 +02:00

101 lines
2.8 KiB
YAML

variables:
SKIP_TEST: "true"
FF_SCRIPT_SECTIONS: "true"
stages:
- Update docker image
- Update code-analysis Docker image
- IOWRT
.continuous:
stage: IOWRT
trigger:
project: devops/iopsyswrt
strategy: depend
variables:
IOWRT_REF: $CI_COMMIT_SHA
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Update Docker Image:
stage: Update docker image
tags:
- priority
image:
name: gcr.io/kaniko-project/executor:v1.9.1-debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${REGISTRY_URL}\":{\"auth\":\"${REGISTRY_AUTH}\"}}}" > /kaniko/.docker/config.json
- |
if [ "${CI_COMMIT_REF_NAME:-}" = "${CI_DEFAULT_BRANCH}" ]; then
echo "On default branch '$CI_DEFAULT_BRANCH', going to push 'latest' tag for container image as well"
DO_PUSH_LATEST=1
fi
- |
if [ "$CI_COMMIT_REF_PROTECTED" = true ]; then
echo "On protected branch, going to push container image to registries"
DO_PUSH=1
else
echo "Not on a protected branch. Only going to build the image, not going to push it"
NO_PUSH=1
fi
- |
set -x && /kaniko/executor \
--context "${CI_PROJECT_DIR}" \
--cache \
--cache-repo "${CI_REGISTRY_IMAGE}/sdk-builder/cache" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
${NO_PUSH:+--no-push} \
${NO_PUSH:+--no-push-cache} \
${DO_PUSH:+--destination "${REGISTRY_REPOSITORY}:${CI_COMMIT_SHA}"} \
${DO_PUSH:+--destination "${CI_REGISTRY_IMAGE}/sdk-builder:${CI_COMMIT_SHA}"} \
${DO_PUSH:+--destination "${REGISTRY_REPOSITORY}:${CI_COMMIT_REF_NAME}"} \
${DO_PUSH:+--destination "${CI_REGISTRY_IMAGE}/sdk-builder:${CI_COMMIT_REF_NAME}"} \
${DO_PUSH_LATEST:+--destination "${REGISTRY_REPOSITORY}:latest"} \
${DO_PUSH_LATEST:+--destination "${CI_REGISTRY_IMAGE}/sdk-builder:latest"}
rules:
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
interruptible: true
code-analysis:
stage: Update code-analysis Docker image
trigger:
project: iopsys/gitlab-ci-pipeline
strategy: depend
branch: $CI_COMMIT_REF_NAME
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
allow_failure: true
# Continuous Builds:
# Qualcomm
SH40J_continuous:
extends:
- .continuous
variables:
BOARD_NAME: "SH40J"
# Broadcom
eagle_continuous:
extends:
- .continuous
variables:
BOARD_NAME: "eagle"
# MediaTek
cx750_continuous:
extends:
- .continuous
variables:
BOARD_NAME: "cx750"
# Airoha
XGXB_continuous:
extends:
- .continuous
variables:
BOARD_NAME: "XGXB"