Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • seco-ne/yocto/infrastructure/gitlab-ci
1 result
Show changes
Commits on Source (9)
......@@ -39,7 +39,7 @@ build:files:
timeout: 2m
variables:
GIT_STRATEGY: none
LOGPREFIX: "CI:build:"
LOG_PREFIX: "CI:build:"
before_script:
- !reference [.docker_check]
- !reference [.setup_ssh]
......
......@@ -37,8 +37,8 @@ changelog:
# --------------------------------------------------------------------------------------
# Generated jobs
# --------------------------------------------------------------------------------------
{% if CI_PARAM_MACHINES %}
{% for machine in CI_PARAM_MACHINES.split(' ') %}
{% if MACHINES %}
{% for machine in MACHINES.split(' ') %}
# --------------------------------------------------------------------------------------
# Stage: Build
......@@ -49,7 +49,7 @@ build-{{ machine }}:
extends: .build_yocto
variables:
BITBAKE_TASK: build
CI_PARAM_MACHINE: {{ machine }}
MACHINE: {{ machine }}
{% else %}
......@@ -62,6 +62,14 @@ build-{{ machine }}:
# 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 }}
after_script:
# FIXME: This is necessary because we changed variable naming, but we still use a
# release with the old naming for build simulation. Can be removed as soon as we
# switch to a newer release already containing the new naming scheme.
- source build.env
- echo "IMAGE_PATH=${BUILD_PATH_IMAGE}" >> build.env
- echo "SDK_PATH=${BUILD_PATH_SDK}" >> build.env
- echo "LICENSES_PATH=${BUILD_PATH_LICENSE}" >> build.env
{% endif %}
......@@ -95,11 +103,11 @@ smoketest:{{ machine }}:
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
BUILD_JOB: build-{{ machine }}
MACHINE: {{ lavamachine }}
PLATFORMS: {{ lavamachine }}
TEST_SUITE: boot.jinja2
TEST_EXTRA_ARGUMENTS: --all-devices
platformtest:{{ machine }}:
extends:
......@@ -108,9 +116,9 @@ platformtest:{{ machine }}:
needs:
- job: build-{{ machine }}
variables:
CI_PARAM_BUILDJOB: build-{{ machine }}
CI_PARAM_MACHINE: {{ lavamachine }}
CI_PARAM_PLATFORMS: {{ platforms }}
BUILD_JOB: build-{{ machine }}
MACHINE: {{ lavamachine }}
PLATFORMS: {{ platforms }}
{% endif %}
......@@ -250,4 +258,4 @@ publish-confluence-page:
{% endif %}
{% endif %}
{% endif %} # if CI_PARAM_MACHINES
{% endif %} # if MACHINES
......@@ -29,7 +29,7 @@ workflow:
# CI/CD variable GITLAB_PRIVATE_KEY of the manifest repository. The public key has
# been added as a deploy key in GitLab's repository settings for all contained
# repositories.
- echo "${LOGPREFIX} Setup SSH"
- echo "${LOG_PREFIX} Setup SSH"
- eval $(ssh-agent -s)
- echo "$GITLAB_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
......@@ -46,7 +46,7 @@ workflow:
- echo "$SSH_CONFIG" > ~/.ssh/config
.repo_checkout: &repo_checkout
- echo "${LOGPREFIX} Perform repo checkout"
- echo "${LOG_PREFIX} Perform repo checkout"
- cd ${CI_PROJECT_DIR}
- repo init --submodules -u ${CI_REPOSITORY_URL}
-b refs/pipelines/${CI_PIPELINE_ID}
......@@ -56,18 +56,18 @@ workflow:
.collect_srcrevs: &collect_srcrevs
# write all package AUTOREVS to file
- |-
SRCREVS_FILE="${CI_PROJECT_DIR}/${BUILDPATH}/${IMAGEPATH}/BUILD_SRCREVS.log"
SRCREVS_FILE="${CI_PROJECT_DIR}/${IMAGE_PATH}/BUILD_SRCREVS.log"
if [ -d "$( dirname "${SRCREVS_FILE}" )" ];then
buildhistory-collect-srcrevs > ${SRCREVS_FILE}
echo "${LOGPREFIX} buildhistory-collect-srcrevs:"
echo "${LOG_PREFIX} buildhistory-collect-srcrevs:"
cat ${SRCREVS_FILE}
fi
.dump_install_command: &dump_install_command
# print install instructions
- |-
if [[ ! -z "${INSTALLSCRIPT}" ]]; then
SCRIPT="${CI_PROJECT_DIR}/${BUILDPATH}/${IMAGEPATH}/${INSTALLSCRIPT}"
if [[ ! -z "${INSTALL_SCRIPT}" ]]; then
SCRIPT="${CI_PROJECT_DIR}/${IMAGE_PATH}/${INSTALL_SCRIPT}"
if [ ! -f "${SCRIPT}" ]; then
echo "Install script missing, searched for '$SCRIPT'"
exit 1
......@@ -98,28 +98,26 @@ workflow:
.build_script: &build_script
# setup build environment
- echo "${LOGPREFIX} Build configuration MACHINE=${CI_PARAM_MACHINE}
DISTRO=${CI_PARAM_DISTRO} IMAGE=${CI_PARAM_IMAGE}"
- source build.env
- echo "${LOGPREFIX} Using build dir ${BUILDPATH}"
- export MACHINE="${CI_PARAM_MACHINE}"
- export DISTRO="${CI_PARAM_DISTRO}"
- echo "${LOG_PREFIX} Build configuration MACHINE=${MACHINE}
DISTRO=${YOCTO_DISTRO} IMAGE=${YOCTO_IMAGE}"
- echo "${LOG_PREFIX} Using build dir ${BUILD_PATH}"
- export MACHINE="${MACHINE}"
- export DISTRO="${YOCTO_DISTRO}"
- export EULA="1"
- source ./"${SETUPSCRIPT}" "${BUILDPATH}"
- source ./"${SETUP_SCRIPT}" "${BUILD_PATH}"
# start build
- echo -e "section_start:`date +%s`:bitbake_run\r\e[0KBitbake Log"
- echo "${LOGPREFIX} bitbake ${CI_PARAM_IMAGE} -c ${BITBAKE_TASK}"
- bitbake "${CI_PARAM_IMAGE}" -c "${BITBAKE_TASK}"
- echo "${LOG_PREFIX} bitbake ${YOCTO_IMAGE} -c ${BITBAKE_TASK}"
- bitbake "${YOCTO_IMAGE}" -c "${BITBAKE_TASK}"
- echo -e "section_end:`date +%s`:bitbake_run\r\e[0K"
.save_build_env: &save_build_env
- echo "BUILD_MACHINE=$CI_PARAM_MACHINE" > build.env
- echo "BUILD_IMAGE=$CI_PARAM_IMAGE" >> build.env
- echo "BUILD_DISTRO=$CI_PARAM_DISTRO" >> build.env
- echo "BUILD_PATH_IMAGE=${BUILDPATH}/${IMAGEPATH}" >> build.env
- echo "BUILD_PATH_SDK=${BUILDPATH}/${SDKPATH}" >> build.env
- echo "BUILD_PATH_LICENSE=${BUILDPATH}/${LICENSESPATH}" >> build.env
- echo "FNG_INSTALL_URL=${JOB_URL}${FNG_INSTALL_PATH}" >> build.env
# Artifact paths are needed for packaging
- echo "IMAGE_PATH=${IMAGE_PATH}" >> build.env
- echo "SDK_PATH=${SDK_PATH}" >> build.env
- echo "LICENSES_PATH=${LICENSES_PATH}" >> build.env
# Install script location is needed in test job
- echo "FNG_INSTALL_URL=${FNG_INSTALL_URL}" >> build.env
# --------------------------------------------------------------------------------------
# Stage: Infrastructure
......@@ -211,15 +209,14 @@ workflow:
needs: []
variables:
GIT_STRATEGY: none
SETUPSCRIPT: "setup-environment"
LOGPREFIX: "CI:build:"
BUILDPATH: "build-${CI_PARAM_DISTRO}-${CI_PARAM_MACHINE}"
IMAGEBASEPATH: "tmp/deploy/images/"
IMAGEPATH: "${IMAGEBASEPATH}/${CI_PARAM_MACHINE}"
LICENSESPATH: "tmp/deploy/licenses"
SDKPATH: "tmp/deploy/sdk/"
JOB_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/"
FNG_INSTALL_PATH: "${BUILDPATH}/${IMAGEPATH}/${INSTALLSCRIPT}"
SETUP_SCRIPT: "setup-environment"
LOG_PREFIX: "CI:build:"
BUILD_PATH: "build-${YOCTO_DISTRO}-${MACHINE}"
IMAGE_PATH: "${BUILD_PATH}/tmp/deploy/images/${MACHINE}"
LICENSES_PATH: "${BUILD_PATH}/tmp/deploy/licenses"
SDK_PATH: "${BUILD_PATH}/tmp/deploy/sdk"
JOB_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}"
FNG_INSTALL_URL: "${JOB_URL}/artifacts/${IMAGE_PATH}/${INSTALL_SCRIPT}"
before_script:
- *docker_check
- *setup_ssh
......@@ -246,8 +243,8 @@ workflow:
# TODO checkout only gitlab-ci repo to allow running on deleted branches
# Include git submodules
GIT_SUBMODULE_STRATEGY: recursive
CI_PARAM_TEST_SUITE: '{platform}.jinja2'
CI_PARAM_EXTRA: --nop
TEST_SUITE: '{platform}.jinja2'
TEST_EXTRA_ARGUMENTS: --nop
GITLAB_SERVER: "${CI_SERVER_HOST}:${CI_SERVER_SSH_PORT}"
GIT_BASE_URL: "ssh://git@${GITLAB_SERVER}/${CI_PROJECT_ROOT_NAMESPACE}"
TESTS_GIT_URL: "${GIT_BASE_URL}/yocto/tests.git"
......@@ -265,7 +262,7 @@ workflow:
--project $CI_PROJECT_ID
--pipeline $CI_PIPELINE_ID
--token=$GITBOT_TOKEN
--name $CI_PARAM_BUILDJOB
--name $BUILD_JOB
--path build.env
- cat build.env
- source build.env
......@@ -273,14 +270,14 @@ workflow:
- .gitlab-ci/scripts/submit_test.py
--fng-install "$FNG_INSTALL_URL"
--name
"Gitlab $BUILD_MACHINE $BUILD_DISTRO $BUILD_IMAGE ($CI_PIPELINE_ID)"
"Gitlab $MACHINE $YOCTO_DISTRO $YOCTO_IMAGE ($CI_PIPELINE_ID)"
--results-path "results"
--report-name "testresults-${CI_JOB_NAME}.md"
--test-repo $TESTS_GIT_URL
--test-repo-branch $TEST_REPO_BRANCH
--test-plan $CI_PARAM_TEST_SUITE
$CI_PARAM_EXTRA
$CI_PARAM_PLATFORMS
--test-plan $TEST_SUITE
$TEST_EXTRA_ARGUMENTS
$PLATFORMS
# --------------------------------------------------------------------------------------
# Stage: package
......@@ -306,17 +303,17 @@ workflow:
# We do this manually since we do not use GitLab's default artifact downloader
- source build.env
script:
# BUILD_PATH_* variables are available via build.env from build job
# IMAGE_PATH, SDK_PATH and LICENSES_PATH are available via build.env from build job
- if [[ "${PACKAGE_TYPE}" == "image" ]]; then
- .gitlab-ci/scripts/package_release.py
--images-dir="${BUILD_PATH_IMAGE}"
--licenses-dir="${BUILD_PATH_LICENSE}"
--images-dir="${IMAGE_PATH}"
--licenses-dir="${LICENSES_PATH}"
--doc-dir=.
--output-dir=release
--release-suffix="${RELEASE_SUFFIX}"
- elif [[ "${PACKAGE_TYPE}" == "sdk" ]]; then
- .gitlab-ci/scripts/package_release.py
--sdk-dir="${BUILD_PATH_SDK}"
--sdk-dir="${SDK_PATH}"
--output-dir=release
--release-suffix="${RELEASE_SUFFIX}"
- fi
......
......@@ -11,7 +11,7 @@ variables:
# In the manifest, the remotes are specified by an identifier. This is used to find
# out included projects for the retrigger job. In custom manifests, the remote may be
# named differently, so we need a variable that may be overriden.
CI_PARAM_SECO_REMOTE: ci-test
SECO_REMOTE: ci-test
# GitLab group to search for projects to retrigger
RETRIGGER_GROUP: ${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/ci-test
......@@ -28,7 +28,7 @@ variables:
seco-ne/yocto/infrastructure/ci-test/minimal-foo
# List of machines to simulate building images for
CI_PARAM_MACHINES: seco-mx6 seco-mx8mm
MACHINES: seco-mx6 seco-mx8mm
.yocto-deploy:
variables:
......@@ -70,9 +70,9 @@ yocto-simulation-pipeline:
variables:
BUILD_ARTIFACTS_PREFIX: >-
https://git.seco.com/seco-ne/yocto/manifest/-/jobs/artifacts/kirkstone/7.0/download?job=build
CI_PARAM_IMAGE: seconorth-image
CI_PARAM_DISTRO: seconorth-wayland
INSTALLSCRIPT: fng-install.sh
YOCTO_IMAGE: seconorth-image
YOCTO_DISTRO: seconorth-wayland
INSTALL_SCRIPT: fng-install.sh
ARTIFACTS_PATH: build-*/tmp/deploy/images/**/*
PACKAGE_TYPE: image
TEST_STAGE: "true"
......@@ -90,9 +90,9 @@ sdk-simulation-pipeline:
variables:
BUILD_ARTIFACTS_PREFIX: >-
https://git.seco.com/seco-ne/yocto/manifest/-/jobs/artifacts/kirkstone/7.0/download?job=buildsdk
CI_PARAM_IMAGE: seconorth-image
CI_PARAM_DISTRO: seconorth-wayland
INSTALLSCRIPT: fng-install.sh
YOCTO_IMAGE: seconorth-image
YOCTO_DISTRO: seconorth-wayland
INSTALL_SCRIPT: fng-install.sh
ARTIFACTS_PATH: build-*/tmp/deploy/sdk/*
MANUAL_BUILD: "true"
PACKAGE_TYPE: sdk
......@@ -11,7 +11,7 @@ variables:
# In the manifest, the remotes are specified by an identifier. This is used to find
# out included projects for the retrigger job. In custom manifests, the remote may be
# named differently, so we need a variable that may be overriden.
CI_PARAM_SECO_REMOTE: seco-ne
SECO_REMOTE: seco-ne
# GitLab group to search for projects to retrigger
RETRIGGER_GROUP: ${CI_PROJECT_ROOT_NAMESPACE}
......@@ -24,7 +24,7 @@ variables:
seco-ne/yocto/layers/meta-seconorth-machine
# List of machines to build images for
CI_PARAM_MACHINES: imx6guf imx6ullguf imx8mguf imx8mpguf
MACHINES: imx6guf imx6ullguf imx8mguf imx8mpguf
.yocto-deploy:
variables:
......@@ -65,9 +65,9 @@ yocto-pipeline:
- .yocto-deploy
variables:
BITBAKE_TASK: build
CI_PARAM_IMAGE: guf-image
CI_PARAM_DISTRO: guf-wayland
INSTALLSCRIPT: fng-install.sh
YOCTO_IMAGE: guf-image
YOCTO_DISTRO: guf-wayland
INSTALL_SCRIPT: fng-install.sh
ARTIFACTS_PATH: build-*/tmp/deploy/images/**/*
PACKAGE_TYPE: image
TEST_STAGE: "true"
......@@ -81,8 +81,8 @@ sdk-pipeline:
- .yocto-deploy
variables:
BITBAKE_TASK: populate_sdk
CI_PARAM_IMAGE: guf-image
CI_PARAM_DISTRO: guf-wayland
YOCTO_IMAGE: guf-image
YOCTO_DISTRO: guf-wayland
ARTIFACTS_PATH: build-*/tmp/deploy/sdk/*
MANUAL_BUILD: "true"
PACKAGE_TYPE: sdk
......@@ -93,9 +93,9 @@ fngsystem-pipeline:
- .fngsystem-deploy
variables:
BITBAKE_TASK: build
CI_PARAM_IMAGE: fngsystem-image
CI_PARAM_DISTRO: guf-fngsystem
INSTALLSCRIPT: fngsystem-self-update.sh
YOCTO_IMAGE: fngsystem-image
YOCTO_DISTRO: guf-fngsystem
INSTALL_SCRIPT: fngsystem-self-update.sh
ARTIFACTS_PATH: build-*/tmp/deploy/images/**/*
PACKAGE_TYPE: image
ALPHAPLAN_STAGE: "true"
......@@ -6,6 +6,8 @@ rule_settings:
- default
disable:
# Might make the code more pythonic, but takes more time to understand
- for-append-to-extend
# Code is easier to read without this
- min-max-identity
# Keep explicit lower range limit instead of using implicit default value
......@@ -14,10 +16,6 @@ rule_settings:
- use-named-expression
# Requires special Python knowlege that not everyone reading the code might have
- use-next
# FIXME: verify if we want to keep the checks below.
# If not, remove them. If yes, move them above this comment.
- low-code-quality
- for-append-to-extend
rule_types:
- refactoring
......
......@@ -18,6 +18,9 @@ critical_error = (
def accept_merge_request(project, mr, rebase=False, should_remove_source_branch=True):
"""Attempt to merge a merge request, rebase if necessary"""
# FIXME: Remove the sourcery check deactivation below and refactor this method in
# order to enhance code quality and make the check pass.
# sourcery skip: low-code-quality
merged = False
pipeline_pending = False
......
......@@ -96,6 +96,9 @@ def create_integration_merge_request(
def main():
# FIXME: Remove the sourcery check deactivation below and refactor this method in
# order to enhance code quality and make the check pass.
# sourcery skip: low-code-quality
parser = argparse.ArgumentParser()
parser.add_argument(
"--gitlab-url",
......
......@@ -183,6 +183,10 @@ class SuiteCollection:
def lava_create_testreport(jobids, lava=None):
# FIXME: Remove the sourcery check deactivation below and refactor this method in
# order to enhance code quality and make the check pass.
# sourcery skip: low-code-quality
# Get credentials
if lava is None:
host = get_lava_host()
......
......@@ -56,6 +56,9 @@ def copy_files(files: list[str], target_dir: str):
def main():
# FIXME: Remove the sourcery check deactivation below and refactor this method in
# order to enhance code quality and make the check pass.
# sourcery skip: low-code-quality
parser = argparse.ArgumentParser()
parser.add_argument(
"--images-dir",
......
......@@ -36,6 +36,9 @@ def call(cmd, stdout=None):
def main():
# FIXME: Remove the sourcery check deactivation below and refactor this method in
# order to enhance code quality and make the check pass.
# sourcery skip: low-code-quality
parser = argparse.ArgumentParser()
parser.add_argument(
"--verbose",
......@@ -177,7 +180,7 @@ def main():
testrepo_revision,
"--fng-install",
args.fnginstall,
"--name",
"--job-name",
args.name.format(platform=platform),
]
logging.debug(f"Generate job: {cmd}")
......
......@@ -190,6 +190,10 @@ def update_submodule_and_include_ref(
commit_and_push=True,
force_clone=False,
):
# FIXME: Remove the sourcery check deactivation below and refactor this method in
# order to enhance code quality and make the check pass.
# sourcery skip: low-code-quality
"""Update the submodule and include refs to the submodule in the given project.
Create mergerequest if needed.
......