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] }}
# --------------------------------------------------------------------------------------
# Stage: Build
# --------------------------------------------------------------------------------------
build-documentation:
extends: .build_documentation
rules:
- if: $DOCUMENTATION_FILES
variables:
FILES: ${DOCUMENTATION_FILES}
{% for machine in MACHINES.split(' ') %}
{% 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_{{ machine | replace("-", "_") }}}
after_script:
# FIXME: This is necessary because we're using an old build for the build simulation
# which does not export these variables, yet. Can be removed as soon as we switch to
# a newer release already containing these variables.
- source build.env
# yamllint disable-line rule:line-length
{%- if machine == "seco-mx6" %}
- export SUPPORTED_HARDWARE=" SANTARO, SANTOKA, SANTINO, SANTINO LT, SANTVEND, "
{%- elif machine == "seco-mx8mm" %}
- export SUPPORTED_HARDWARE=" TANARO, "
{%- elif machine == "seco-genio700" %}
- export SUPPORTED_HARDWARE=" WILK, "
{%- endif %}
- !reference [.save_build_env]
{% endfor %}
# --------------------------------------------------------------------------------------
# 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
{% for machine in MACHINES.split(' ') %}
{% 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' %}
{% elif machine == 'seco-genio700' %}
{% set platforms = "wilk" %}
{% set lava_machine = "genio700" %}
{% 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 %}
{% endfor %}
# --------------------------------------------------------------------------------------
# Stage: Package
# --------------------------------------------------------------------------------------
package-documentation:
extends: .package_documentation
rules:
- if: $DOCUMENTATION_FILES
variables:
ASSOCIATED_BUILD_JOB: build-documentation
needs:
- job: build-documentation
- job: build-version
{% for machine in MACHINES.split(' ') %}
ASSOCIATED_BUILD_JOB: build-{{ machine }}
needs:
- job: build-{{ machine }}
artifacts: false
- job: build-version
{% endfor %}
# --------------------------------------------------------------------------------------
# Stage: Deploy SoftwareStore
# --------------------------------------------------------------------------------------
stage: Deploy SoftwareStore
rules: &deploy_software_store_rules
- if: $DEPLOY_RELEASE_TARGET !~ /^./
when: never
- when: manual
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_RELEASE_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_RELEASE_TARGET_LINK}/${RELEASE_NAME}
stage: Deploy SoftwareStore Internal
rules: &deploy_software_store_rules
- if: $DEPLOY_INTERNAL_RELEASE_TARGET !~ /^./
when: never
- when: manual
variables:
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_INTERNAL_RELEASE_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_INTERNAL_RELEASE_TARGET_LINK}/${RELEASE_NAME}
deploy-documentation:
extends: .deploy-software-store
rules:
- if: $DOCUMENTATION_FILES !~ /^./
when: never
- *deploy_software_store_rules
variables:
ASSOCIATED_PACKAGE_JOB: package-documentation
needs:
- job: package-documentation
artifacts: false
- job: build-version
{% for machine in MACHINES.split(' ') %}
deploy-{{ machine }}:
extends: .deploy-software-store
variables:
ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs:
- job: package-{{ machine }}
artifacts: false
- job: build-version
{% endfor %}
# --------------------------------------------------------------------------------------
# Stage: Deploy FTP
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true"
or CI_COMMIT_TAG is defined %}
stage: Deploy FTP
tags:
- ftp
rules: &deploy_ftp_rules
- if: $DEPLOY_FTP_TARGET !~ /^./
when: never
- when: manual
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_FTP_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_FTP_TARGET_LINK}/${RELEASE_NAME}
ftp-documentation:
extends: .deploy-ftp
rules:
- if: $DOCUMENTATION_FILES !~ /^./
when: never
- *deploy_ftp_rules
variables:
ASSOCIATED_PACKAGE_JOB: package-documentation
needs:
- job: package-documentation
artifacts: false
- job: build-version
{% for machine in MACHINES.split(' ') %}
ftp-{{ machine }}:
extends: .deploy-ftp
variables:
ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs:
- job: package-{{ machine }}
artifacts: false
- job: build-version
{% endfor %}
# --------------------------------------------------------------------------------------
# Stage: Deploy Azure
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true"
or CI_COMMIT_TAG is defined %}
# "=~ /^./" is the GitLab way of checking whether a variable is set and not empty.
# See for reference: https://gitlab.com/gitlab-org/gitlab/-/issues/321371
- if: $AZURE_CONTAINER_NAME !~ /^./ || $AZURE_TARGET_FOLDER !~ /^./
when: never
- when: manual
DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${AZURE_TARGET_FOLDER}/${RELEASE_NAME}
azure-documentation:
extends: .azure
rules:
- if: $DOCUMENTATION_FILES !~ /^./
when: never
- *azure_rules
variables:
ASSOCIATED_PACKAGE_JOB: package-documentation
needs:
- job: package-documentation
artifacts: false
- job: build-version
{% for machine in MACHINES.split(' ') %}
azure-{{ machine }}:
extends: .azure
variables:
needs:
- job: package-{{ machine }}
artifacts: false
{% endif %}
# --------------------------------------------------------------------------------------
# Stage: Confluence
# --------------------------------------------------------------------------------------
{% if SIMULATE_BUILD is defined and SIMULATE_BUILD == "true"
or CI_COMMIT_TAG is defined %}
.confluence-rules:
rules:
- if: $CONFLUENCE_PARENT_ID =~ /^./ && $CONFLUENCE_SPACE =~ /^./
when: manual
allow_failure: true
generate-confluence-page:
extends:
- .generate-confluence-page
variables:
PAGE_TEMPLATE: .gitlab-ci/confluence-page.xml.jinja2
publish-confluence-page:
extends:
- .publish-confluence-page