Skip to content
Snippets Groups Projects
  • Tim Jaacks's avatar
    Remove LOG_PREFIX variable · 1860ca8e
    Tim Jaacks authored
    This was used in times when the same code was executed from different
    places. We don't do that anymore, so the variable is obsolete.
    1860ca8e
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
build-pipeline-ci-test.yml 2.58 KiB
---
# --------------------------------------------------------------------------------------
# Global
# --------------------------------------------------------------------------------------
include:
  - project: '${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/gitlab-ci'
    ref: ${GITLAB_CI_REVISION}
    file:
      - build-pipeline.yml
      - common.yml

stages:
  - Build
  - Test

# --------------------------------------------------------------------------------------
# Stage: Build
# --------------------------------------------------------------------------------------
.build: &build
  - cd ${CI_PROJECT_DIR}
  - VERSION=$(cd .repo/manifests && git describe --tags)
  - cat .repo/manifests/default.xml
  - find foo -name "[0-9]*.txt" -printf '%P\n' | sort -V > files-foo-$VERSION.txt
  - cat files-foo-$VERSION.txt
  - find bar -name "[0-9]*.txt" -printf '%P\n' | sort -V > files-bar-$VERSION.txt
  - cat files-bar-$VERSION.txt
  - FOO_FILES=$(cat files-foo-$VERSION.txt | wc -l)
  - BAR_FILES=$(cat files-bar-$VERSION.txt | wc -l)
  - DIFF=$((BAR_FILES-FOO_FILES))
  - (($DIFF >= -1 && $DIFF <= 1))

build:files:
  stage: Build
  extends:
    - .buildbase
  tags:
    - infrastructure
  needs: []
  timeout: 2m
  variables:
    GIT_STRATEGY: none
  before_script:
    - !reference [.docker_check]
    - !reference [.setup_ssh]
    - !reference [.repo_checkout]
  script:
    - *build
  artifacts:
    paths:
      - files-*

build:echo:
  stage: Build
  tags:
    - infrastructure
  needs: []
  timeout: 2m
  image: ${CI_IMAGE_PYTHON}
  script:
    - printenv
    - echo "Build successful"

build:check-foo-branch:
  stage: Build
  extends:
    - .buildbase
  tags:
    - infrastructure
  needs: []
  timeout: 2m