Skip to content
Snippets Groups Projects
Commit c9ad0a62 authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[CICD] Include CI/CD for Edgehog layer integration

* Include general gitlab-ci repository containing all '.yml' and '.py'
files to perform automation tasks
* The repository needs to be included as a submodule with a relative
path
* Modify .gitlab-ci.yml file which basically includes a file in the
gitlab-ci repository
* Allow in the .gitignore file to include .gitlab-ci and .gitmodules
files
parent 75144d15
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,8 @@ modules.order
!.gitignore
!.mailmap
!.gitlab-ci.yml
!.gitlab-ci
!.gitmodules
#
# Generated include files
......
Subproject commit 21a1fc479314becb3174ec3b9a93af89eff3af1c
stages:
- build
- deploy
- test
- stress_test
- onoff_test
variables:
TEST_REPO_URL: "https://gitlab-ci-token:${TEST_TOKEN}@git.seco.com/devops/lava-test-suite/lava-test.git"
TEST_BRANCH: main
DOC_FOLDER_NAME: "lava-test-doc"
PATH_MOD: "build_kernel"
FILE_CP_EXT: dtb dtbo
KERNEL: 5-10-52
DISTRO: seco-imx-xwayland
TAG_NAME: nightly
AZURE_CONTAINER_NAME: secosoftware-devops
GIT_SUBMODULE_STRATEGY: none
.initENV: &initENV
- mkdir -p ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- echo ~/.ssh/known_hosts
- echo "$SSH_CONFIG_FILE" > ~/.ssh/config
- echo ~/.ssh/config
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
.build:
image: secodocker/seco-builder:latest
cache: {}
tags:
- kernel_build
stage: build
script:
- |
echo "Starting build stage .."
if [[ $PROCESSOR == "imx8"* ]]; then
source /opt/fsl-imx-wayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux
export ARCH=arm64
elif [[ $PROCESSOR == "imx6"* ]]; then
source /opt/fsl-imx-fb/5.10-hardknott/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi
export ARCH=arm
fi
unset LD_LIBRARY_PATH
make ${DEFCONFIG_FILE}
mkdir ${PATH_MOD}/boot -p
make -j$(nproc)
cp $IMAGE_DIR $PATH_MOD/boot/ -f
touch copy_files.sh
chmod a+x copy_files.sh
echo "#!/bin/bash" >> copy_files.sh
for ext in ${FILE_CP_EXT[@]}; do
echo "find ${SRC_DIR} -name \"*"${BOARD}"*"${ext}"\" -exec cp {} ${PATH_MOD}/boot/ \;" >> copy_files.sh
done
./copy_files.sh
make -j$(nproc) modules_install INSTALL_MOD_PATH=${PATH_MOD}
artifacts:
name:
paths:
- $PATH_MOD
expire_in: 48 hrs
rules: &trigger_rule
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline"
when: always
.deploy:
image: mcr.microsoft.com/azure-cli
stage: deploy
tags:
- azure_deploy
cache: {}
timeout: 1h
script:
- echo "Deploying packages..."
- base_directory=$PWD
- ls -l
- echo ${base_directory}
- cd ${PATH_MOD}
- echo ${PATH_MOD}
- DATE=$(date +%Y%m%d)
- kernel_filename="seco_"${PROCESSOR}"_"${BOARD}"_kernel_"${KERNEL}"_"${TAG_NAME}"_"${DATE}".tar.gz"
- kernel_filename_latest="seco_"${PROCESSOR}"_"${BOARD}"_kernel_"${KERNEL}"_"${TAG_NAME}"_latest.tar.gz"
- tar -czvf ${kernel_filename} boot lib
- ls -l
- echo $AZURE_CONTAINER_NAME
- echo $AZURE_PATH
- |
az storage blob upload --account-name $AZURE_STORAGE_ACCOUNT \
--sas-token $AZURE_STORAGE_SAS_TOKEN \
--file $base_directory/$PATH_MOD/$kernel_filename \
--container-name $AZURE_CONTAINER_NAME \
--name $AZURE_PATH/$TAG_NAME/$kernel_filename
rules:
- *trigger_rule
---
# ---------------------------------------------------------------------------------------
# Include the default CI steps from the gitlab-ci repo
# ---------------------------------------------------------------------------------------
include:
- project: '${CI_PROJECT_ROOT_NAMESPACE}/infrastructure/gitlab-ci'
ref: befb5fcb7f3b5833bc7b862f0f69aa4e6bb4c253
file: 'layers-integration.yml'
.test:
image: lorenzo-lava-submitter:v0.1
tags:
- lava-server
stage: test
timeout: 24h
cache: {}
dependencies: []
artifacts:
when: always
paths:
- "results/**"
reports:
junit: results/results-*.xml
variables:
GIT_STRATEGY: none
before_script:
- *initENV
- git clone git@git.seco.com:devops/lava-test-suite/lava-test.git
script:
- |
DATE=$(date +%Y%m%d)
uboot_filename="seco_"${PROCESSOR}"_"${UBOOT_BOARD}"_uboot_"${KERNEL}"_"${TAG_NAME}"_"${DATE}".tar.gz"
uboot_url=$(az storage blob url --account-name $AZURE_STORAGE_ACCOUNT \
--sas-token $AZURE_STORAGE_SAS_TOKEN \
--container-name $AZURE_CONTAINER_NAME \
--name $AZURE_PATH/$TAG_NAME/$uboot_filename)
uboot_url=$(echo $uboot_url | sed 's/?.*//' | sed 's/\"//g')
echo ${uboot_url}
kernel_filename="seco_"${PROCESSOR}"_"${BOARD}"_kernel_"${KERNEL}"_"${TAG_NAME}"_"${DATE}".tar.gz"
kernel_url=$(az storage blob url --account-name $AZURE_STORAGE_ACCOUNT \
--sas-token $AZURE_STORAGE_SAS_TOKEN \
--container-name $AZURE_CONTAINER_NAME \
--name $AZURE_PATH/$TAG_NAME/$kernel_filename)
kernel_url=$(echo $kernel_url | sed 's/?.*//' | sed 's/\"//g')
python3 lava-test/scripts/submit_test.py \
--uboot-update True \
--uboot ${uboot_url} \
--kernel-update True \
--kernel ${kernel_url} \
--lavaserver-ip 10.197.197.10 \
--webserver-ip lavalab.seco.com \
--jobname kernel_tests \
"Gitlab build test ${CI_PIPELINE_ID}" \
--results-path "results" \
--test-repo ${TEST_REPO_URL} \
--test-repo-branch ${TEST_BRANCH} \
--test-plan ${CI_PARAM_TEST_SUITE} \
${CI_PARAM_EXTRA} \
${CI_PARAM_PLATFORMS}
rules:
- *trigger_rule
GITLAB_CI_REVISION: befb5fcb7f3b5833bc7b862f0f69aa4e6bb4c253
# FIXME: This is only necessary due to the following GitLab limitation:
# https://gitlab.com/gitlab-org/gitlab/-/issues/209904
# As soon as this gets fixed upstream, the hard-coded branch name should be removed.
MASTER_BRANCH: seco/lf-5.10.y/develop
BB_RECIPE_NAME: linux-seco-imx-src-5.10.52
LAYER_PROJECT_PATH: yocto_ng/layers/seco/meta-seco-imx
.stress_test:
image: lorenzo-lava-submitter:v0.1
tags:
- lava-server
stage: stress_test
timeout: 24h
cache: {}
dependencies: []
artifacts:
when: always
paths:
- "results/**"
reports:
junit: results/results-*.xml
variables:
GIT_STRATEGY: none
before_script:
- *initENV
- git clone git@git.seco.com:devops/lava-test-suite/lava-test.git
script:
- |
python3 lava-test/scripts/submit_test.py \
--lavaserver-ip 10.197.197.10 \
--webserver-ip lavalab.seco.com \
--jobname kernel_stress_tests \
"Gitlab build test ${CI_PIPELINE_ID}" \
--results-path "results" \
--test-repo ${TEST_REPO_URL} \
--test-repo-branch ${TEST_BRANCH} \
--test-plan ${CI_PARAM_TEST_SUITE} \
${CI_PARAM_EXTRA} \
${CI_PARAM_PLATFORMS}
rules:
- *trigger_rule
.onoff_test:
image: lorenzo-lava-submitter:v0.1
tags:
- lava-server
stage: onoff_test
timeout: 48h
cache: {}
dependencies: []
variables:
GIT_STRATEGY: none
before_script:
- *initENV
- git clone git@git.seco.com:devops/lava-test-suite/lava-test.git
script:
- python3 lava-test/scripts/submit.py lava-test/jobs/${BOARD}_poweronoff_ping.yaml
rules:
- when: manual
include:
- 'board_config/imx6/.a62_config.yml'
- 'board_config/imx6/.928_config.yml'
- 'board_config/imx6/.b08_config.yml'
- 'board_config/imx6/.c23_config.yml'
- 'board_config/imx8/.c26_config.yml'
- 'board_config/imx8/.c20_config.yml'
- 'board_config/imx8/.c12_config.yml'
- 'board_config/imx8/.d18_config.yml'
\ No newline at end of file
[submodule ".gitlab-ci"]
path = .gitlab-ci
url = ../../../../../../../yocto_ng/infrastructure/gitlab-ci.git
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment