Skip to content
Snippets Groups Projects
build-jobs-yocto.yml.jinja2 5.21 KiB
Newer Older
# --------------------------------------------------------------------------------------
# Global
# --------------------------------------------------------------------------------------
# As the trigger job is not executed in a environment with checked out repository, we
# need to get the includes directly from gitlab
  - project: '{{ CI_PROJECT_ROOT_NAMESPACE }}/yocto/infrastructure/gitlab-ci'
    ref: {{ GITLAB_CI_REVISION }}
    file:
      - build-common.yml
      - build-yocto.yml
      - common.yml
      - manifest-package.yml

stages:
  - infrastructure
  - build
  - test
  - deploy
  - uploadftp

  MASTER_BRANCH: {{ MASTER_BRANCH }}
# --------------------------------------------------------------------------------------
# Stage: infrastructure
# --------------------------------------------------------------------------------------
changelog:
  extends: .infrastructure
  script: .gitlab-ci/scripts/changelog_generator.py
              --token=${GITBOT_TOKEN}
              --branch=${MASTER_BRANCH}
              > changelog.md
  artifacts:
    expire_in: 4 weeks
    paths:
      - "changelog.md"

# --------------------------------------------------------------------------------------
# Generated build jobs
# --------------------------------------------------------------------------------------
{% if CI_PARAM_DISTRO is not defined %}
{% set CI_PARAM_DISTRO = "guf-wayland" %}
{% if CI_PARAM_DISTRO_FNG is not defined %}
{% set CI_PARAM_DISTRO_FNG = "guf-fngsystem" %}
{% if CI_PARAM_MACHINES is defined %}
{% for machine in CI_PARAM_MACHINES.split(' ') %}
{% if CI_PARAM_IMAGE %}

# Build jobs for the normal yocto image
build-{{ machine }}:
  extends: .buildimage
  stage: build
  variables:
    CI_PARAM_MACHINE: {{ machine }}
    CI_PARAM_DISTRO: {{ CI_PARAM_DISTRO }}
    CI_PARAM_IMAGE: {{ CI_PARAM_IMAGE }}
    INSTALLSCRIPT: "fng-install.sh"
  artifacts:
    paths:
      - build-{{ CI_PARAM_DISTRO }}-{{ machine }}/tmp/deploy/images/{{ machine }}/*
      - build-{{ CI_PARAM_DISTRO }}-{{ machine }}/tmp/deploy/licenses/**/license.manifest

# Build jobs for the sdk
buildsdk-{{ machine }}:
  extends: .buildsdk
  stage: build
  variables:
    CI_PARAM_MACHINE: {{ machine }}
    CI_PARAM_DISTRO: {{ CI_PARAM_DISTRO }}
    CI_PARAM_IMAGE: {{ CI_PARAM_IMAGE }}
  artifacts:
    paths:
      - build-{{ CI_PARAM_DISTRO }}-{{ machine }}/tmp/deploy/sdk/*

# Deploy jobs for the yocto image
deployimage-{{ machine }}:
  extends: .deployimage
  stage: deploy
  needs: [build-{{ machine }}, changelog]

# Deploy jobs for the yocto sdk
deploysdk-{{ machine }}:
  extends: .deployimage
  stage: deploy
  needs: [buildsdk-{{ machine }}]

# Upload ftp jobs for the yocto image
uploadftp-{{ machine }}:
  extends:
    - .uploadftp
  stage: uploadftp
  needs: [build-{{ machine }}, changelog]

# Upload ftp jobs for the yocto sdk
uploadftp-sdk-{{ machine }}:
  extends:
    - .uploadftp
  stage: uploadftp
  needs: [ buildsdk-{{ machine }}]


# Run platform tests for this machine which the yocto image
# This is a little hacky as we need to match the machine name to
# the available platforms
{% if machine == 'seco-mx6' or machine == 'imx6guf' %}
{% set platforms = "santaro santoka santino santino-lt" %}
{% set lavamachine = "imx6guf" %}
{% elif machine == 'seco-mx6ull' or machine == 'imx6ullguf' %}
{% set platforms = "nallino" %}
{% set lavamachine = "imx6ullguf" %}
{% elif machine == 'seco-mx8mm' or machine == 'imx8mguf'  %}
{% set platforms = "tanaro" %}
{% set lavamachine = "imx8mguf" %}
{% else %}
{% set platforms = '' %}
{% endif %}

{% if platforms %}
# Run smoketests for this machine which the yocto image
smoketest:{{ machine }}:
  stage: test
  needs:
    - job: build-{{ machine }}
  variables:
    CI_PARAM_BUILDJOB: build-{{ machine }}
    CI_PARAM_MACHINE: {{ lavamachine }}
    CI_PARAM_PLATFORMS: {{ lavamachine }}
    CI_PARAM_TEST_SUITE: boot.jinja2
    CI_PARAM_EXTRA: --all-devices

platformtest:{{ machine }}:
  stage: test
  needs:
    - job: build-{{ machine }}
  variables:
    CI_PARAM_BUILDJOB: build-{{ machine }}
    CI_PARAM_MACHINE: {{ lavamachine }}
    CI_PARAM_PLATFORMS: {{ platforms }}
{% endif %}

{% endif %} # if CI_PARAM_IMAGE is defined
{% if CI_PARAM_IMAGE_FNG %}

# Build jobs for the fng system image
build-{{ machine }}-fngsystem:
  stage: build
  variables:
    CI_PARAM_MACHINE: {{ machine }}
    CI_PARAM_DISTRO: {{ CI_PARAM_DISTRO_FNG }}
    CI_PARAM_IMAGE: {{ CI_PARAM_IMAGE_FNG }}
    INSTALLSCRIPT: "fngsystem-self-update.sh"
  artifacts:
    paths:
      - build-{{ CI_PARAM_DISTRO_FNG }}-{{ machine }}/tmp/deploy/images/{{ machine }}/*
      - build-{{ CI_PARAM_DISTRO_FNG }}-{{ machine }}/tmp/deploy/licenses/**/license.manifest

# Deploy jobs for the fngsystem image
deployimage-{{ machine }}-fngsystem:
  extends: .deployimage
  stage: deploy
  needs: [build-{{ machine }}-fngsystem, changelog]

# Upload ftp jobs for the fngsystem image
uploadftp-{{ machine }}-fngsystem:
  extends: .uploadftp
  stage: uploadftp
  needs: [build-{{ machine }}-fngsystem, changelog]

{% endif %} # if CI_PARAM_IMAGE_FNG is defined