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'
- build-pipeline.yml
- common.yml
stages:
- Infrastructure
- Build
- Test
- Package
- Deploy SoftwareStore
- Deploy SoftwareStore Internal
- Deploy FTP
variables:
MASTER_BRANCH: {{ MASTER_BRANCH }}
# --------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------
changelog:
build-version:
extends: .build_version
variables:
# We have to set a machine, even if it is not actually needed for what the job does,
# so we just choose the first.
MACHINE: {{ MACHINES.split(' ')[0] }}
# --------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------
{% if MACHINES %}
{% for machine in MACHINES.split(' ') %}
# --------------------------------------------------------------------------------------
# Stage: Build
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is not defined or SIMULATE_BUILD != "true" %}
build-{{ machine }}:
variables:
Jonas Höppner
committed
{% else %}
build-{{ machine }}:
extends:
- .buildbase
- .simulate_build
variables:
# We have to specify a tag here instead of getting the artifacts from a master
# branch, because we don't always execute the full pipeline on the master branches.
# In those cases the actual build job does not exist, which results in a 404 error.
BUILD_ARTIFACTS: ${BUILD_ARTIFACTS_PREFIX}-{{ machine }}
{% endif %}
# --------------------------------------------------------------------------------------
# Stage: Test
# --------------------------------------------------------------------------------------
# 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" %}
{% elif machine == 'seco-mx6ull' or machine == 'imx6ullguf' %}
{% elif machine == 'seco-mx8mm' or machine == 'imx8mguf' %}
{% else %}
{% endif %}
{% if platforms %}
# Run smoketests for this machine which the yocto image
smoketest:{{ machine }}:
extends:
- .test
needs:
- job: build-{{ machine }}
variables:
BUILD_JOB: build-{{ machine }}
LAVA_MACHINE: {{ lava_machine }}
PLATFORMS: {{ lava_machine }}
TEST_SUITE: boot.jinja2
TEST_EXTRA_ARGUMENTS: --all-devices
platformtest:{{ machine }}:
extends:
- .test
needs:
- job: build-{{ machine }}
variables:
BUILD_JOB: build-{{ machine }}
PLATFORMS: {{ platforms }}
{% endif %}
# --------------------------------------------------------------------------------------
# Stage: Package
# --------------------------------------------------------------------------------------
package-{{ machine }}:
ASSOCIATED_BUILD_JOB: build-{{ machine }}
needs:
- job: build-{{ machine }}
artifacts: false
- job: changelog
- job: build-version
# --------------------------------------------------------------------------------------
# Stage: Deploy SoftwareStore
# --------------------------------------------------------------------------------------
stage: Deploy SoftwareStore
variables:
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_RELEASE_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_RELEASE_TARGET_LINK}/${RELEASE_NAME}
stage: Deploy SoftwareStore Internal
variables:
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_INTERNAL_RELEASE_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_INTERNAL_RELEASE_TARGET_LINK}/${RELEASE_NAME}
ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs:
- job: package-{{ machine }}
artifacts: false
- job: changelog
- job: build-version
# --------------------------------------------------------------------------------------
# Stage: Alphaplan
# --------------------------------------------------------------------------------------
generate-alphaplan-data-{{ machine }}:
extends: .generate_alphaplan_data
- build-version
import-alphaplan-data-{{ machine }}:
extends: .import_alphaplan_data
needs:
- generate-alphaplan-data-{{ machine }}
# --------------------------------------------------------------------------------------
# Stage: Deploy FTP
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true"
or CI_COMMIT_TAG is defined %}
stage: Deploy FTP
tags:
- ftp
rules:
- if: $DEPLOY_FTP_TARGET
when: manual
allow_failure: true
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_FTP_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_FTP_TARGET_LINK}/${RELEASE_NAME}
ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs:
- job: package-{{ machine }}
artifacts: false
- job: changelog
- job: build-version
# --------------------------------------------------------------------------------------
# Stage: Deploy Azure
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true"
or CI_COMMIT_TAG is defined %}
azure-{{ machine }}:
extends: .deploy-azure
stage: Deploy Azure
rules:
- if: $AZURE_CONTAINER_NAME && $AZURE_TARGET_FOLDER
when: manual
allow_failure: true
variables:
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${AZURE_TARGET_FOLDER}/${RELEASE_NAME}
CONTAINER_NAME: ${AZURE_CONTAINER_NAME}
ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs:
- job: package-{{ machine }}
artifacts: false
- job: changelog
# --------------------------------------------------------------------------------------
# End of generated jobs
# --------------------------------------------------------------------------------------
{% endfor %}
# --------------------------------------------------------------------------------------
# Stage: Confluence
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true"
or CI_COMMIT_TAG is defined %}
generate-confluence-page:
extends:
- .generate-confluence-page
variables:
PAGE_TEMPLATE: .gitlab-ci/confluence-page.xml.jinja2
publish-confluence-page:
extends:
- .publish-confluence-page
{% endif %}
{% endif %} # if MACHINES