Коммит b87c833f создал по автору Житницкая Ирина Станиславовна's avatar Житницкая Ирина Станиславовна
Просмотр файлов

[CI] Adding ci support

владелец 9c571bed
stages:
- readme_cspell_and_cppcheck
- cppcheck
- build
- sign
- validation
build-aurora_5_1_0_100_aarch64:
stage: build
spell-checking:
stage: readme_cspell_and_cppcheck
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./build.sh -a ./ -t AuroraOS-5.1.0.100-base-aarch64
sign-aurora_5_1_0_100_aarch64:
stage: sign
dependencies:
- build-aurora_5_1_0_100_aarch64
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./sign.sh -r ./artifacts
validation-aurora_5_1_0_100_aarch64:
stage: validation
dependencies:
- sign-aurora_5_1_0_100_aarch64
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator /home/gitlab-runner/Aurora5PlatformSDK/ ./artifacts/ru.auroraos.CallApiOverall-0.1-1.aarch64.rpm
- sudo cp ./gitlab-ci/project-words.txt /home/gitlab-runner/cspell
- /home/gitlab-runner/.nvm/versions/node/v22.14.0/bin/npx cspell --config /home/gitlab-runner/cspell/cspell.json "./README.md" "./README.ru.md" --show-suggestions
build-aurora_5_1_0_100_armv7hl:
stage: build
cppcheck:
stage: readme_cspell_and_cppcheck
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
- ./report.txt
when: always
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./build.sh -a ./ -t AuroraOS-5.1.0.100-base-armv7hl
- /opt/cppcheck/cppcheck -q --enable=all --error-exitcode=1 --suppress=missingIncludeSystem --suppress=unknownMacro --template='{id} {file}:{line} {message}' $CI_PROJECT_DIR 2> $CI_PROJECT_DIR/report.txt
include:
- local: 'gitlab-ci/**.yml'
sign-aurora_5_1_0_100_armv7hl:
stage: sign
dependencies:
- build-aurora_5_1_0_100_armv7hl
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./sign.sh -r ./artifacts
validation-aurora_5_1_0_100_armv7hl:
stage: validation
dependencies:
- sign-aurora_5_1_0_100_armv7hl
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator /home/gitlab-runner/Aurora5PlatformSDK/ ./artifacts/ru.auroraos.CallApiOverall-0.1-1.armv7hl.rpm
build-aurora_5_1_0_100_x86_64:
stage: build
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./build.sh -a ./ -t AuroraOS-5.1.0.100-base-x86_64
sign-aurora_5_1_0_100_x86_64:
stage: sign
dependencies:
- build-aurora_5_1_0_100_x86_64
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./sign.sh -r ./artifacts
validation-aurora_5_1_0_100_x86_64:
stage: validation
dependencies:
- sign-aurora_5_1_0_100_x86_64
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator /home/gitlab-runner/Aurora5PlatformSDK/ ./artifacts/ru.auroraos.CallApiOverall-0.1-1.x86_64.rpm
"build-aurora_PSDK_4_VER_armv7hl":
stage: build
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora4PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/build.sh -a ./ -t AuroraOS-$PSDK_4_VER-base-armv7hl
when: always
"build-aurora_PSDK_4_VER_i486":
stage: build
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora4PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/build.sh -a ./ -t AuroraOS-$PSDK_4_VER-base-i486
when: always
"sign-aurora_PSDK_4_VER_armv7hl":
stage: sign
needs: ["build-aurora_PSDK_4_VER_armv7hl"]
dependencies:
- "build-aurora_PSDK_4_VER_armv7hl"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora4PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/sign.sh -r ./artifacts
"sign-aurora_PSDK_4_VER_i486":
stage: sign
needs: ["build-aurora_PSDK_4_VER_i486"]
dependencies:
- "build-aurora_PSDK_4_VER_i486"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora4PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/sign.sh -r ./artifacts
"validation-aurora_PSDK_4_VER_armv7hl":
stage: validation
needs: ["sign-aurora_PSDK_4_VER_armv7hl"]
dependencies:
- "sign-aurora_PSDK_4_VER_armv7hl"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator_4 /home/gitlab-runner/Aurora4PlatformSDK/ ./artifacts/*.armv7hl.rpm
"validation-aurora_PSDK_4_VER_i486":
stage: validation
needs: ["sign-aurora_PSDK_4_VER_i486"]
dependencies:
- "sign-aurora_PSDK_4_VER_i486"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator_4 /home/gitlab-runner/Aurora4PlatformSDK/ ./artifacts/*.x86_64.rpm
"build-aurora_PSDK_5_aarch64":
stage: build
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/build.sh -a ./ -t AuroraOS-$PSDK_5_VER-aarch64
when: always
"build-aurora_PSDK_5_armv7hl":
stage: build
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/build.sh -a ./ -t AuroraOS-$PSDK_5_VER-armv7hl
when: always
"build-aurora_PSDK_5_x86_64":
stage: build
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/build.sh -a ./ -t AuroraOS-$PSDK_5_VER-x86_64
when: always
"sign-aurora_PSDK_5_aarch64":
stage: sign
needs: ["build-aurora_PSDK_5_aarch64"]
dependencies:
- "build-aurora_PSDK_5_aarch64"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/sign.sh -r ./artifacts
"sign-aurora_PSDK_5_armv7hl":
stage: sign
needs: ["build-aurora_PSDK_5_armv7hl"]
dependencies:
- "build-aurora_PSDK_5_armv7hl"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/sign.sh -r ./artifacts
"sign-aurora_PSDK_5_x86_64":
stage: sign
needs: ["build-aurora_PSDK_5_x86_64"]
dependencies:
- "build-aurora_PSDK_5_x86_64"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/Aurora5PlatformSDK/sdks/aurora_psdk/sdk-chroot ./gitlab-ci/sign.sh -r ./artifacts
"validation-aurora_PSDK_5_aarch64":
stage: validation
needs: ["sign-aurora_PSDK_5_aarch64"]
dependencies:
- "sign-aurora_PSDK_5_aarch64"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator /home/gitlab-runner/Aurora5PlatformSDK/ ./artifacts/*.aarch64.rpm
"validation-aurora_PSDK_5_armv7hl":
stage: validation
needs: ["sign-aurora_PSDK_5_armv7hl"]
dependencies:
- "sign-aurora_PSDK_5_armv7hl"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator /home/gitlab-runner/Aurora5PlatformSDK/ ./artifacts/*.armv7hl.rpm
"validation-aurora_PSDK_5_x86_64":
stage: validation
needs: ["sign-aurora_PSDK_5_x86_64"]
dependencies:
- "sign-aurora_PSDK_5_x86_64"
tags:
- aurora_psdk_runner
artifacts:
paths:
- ./artifacts/*.rpm
script:
- /home/gitlab-runner/aurora-utils/rpm_validator /home/gitlab-runner/Aurora5PlatformSDK/ ./artifacts/*.x86_64.rpm
#!/bin/bash
# handle commandline options
usage()
{
echo "Script for building projects with PSDK."
echo
echo "Usage: build.sh <options>"
echo
echo "Options:"
echo "-a | --application Path to application directory for build."
echo "-s | --spec Path to spec file."
echo "-t | --target PSDK target to build RPM with."
echo "-h | --help Print this help and exit."
}
while [[ ${1:-} ]]; do
case "$1" in
-a | --application ) shift
OPT_PROJECT_PATH=$1; shift
;;
-s | --spec ) shift
OPT_SPEC_PATH=$1; shift
;;
-t | --target ) shift
OPT_PSDK_TARGET=$1; shift
;;
-h | --help ) shift
usage
exit;;
* )
usage
exit;;
esac
done
if [[ -z $OPT_PROJECT_PATH ]]; then
echo "Enter path to application directory"
exit
fi
if [[ -z $OPT_PSDK_TARGET ]]; then
echo "Incorrect target of PSDK"
exit
fi
mkdir -p build
mkdir -p artifacts
cd build
sdk-assistant list
# Build project
echo "Build project for $OPT_PSDK_TARGET"
if [[ -z $OPT_SPEC_PATH ]]; then
mb2 --target $OPT_PSDK_TARGET build ../$OPT_PROJECT_PATH
else
mb2 --target $OPT_PSDK_TARGET -s ../$OPT_SPEC_PATH build ../$OPT_PROJECT_PATH
fi
# Copy build artifacts
cp RPMS/* ../artifacts/
auroraos
subprojects
subproject
rpmbuild
сmake
qmake
#!/bin/bash
set -e
# handle commandline options
usage()
{
echo "Script for signing RPM packages with PSDK."
echo
echo "Usage: sign.sh <options>"
echo
echo "Options:"
echo "-r | --rpm Path to directory with RPM packages."
echo "-p | --profile Validation profile for signing RPM-package."
echo " Available validation profiles: regular, extended, mdm, antivirus, auth."
echo "-h | --help Print this help and exit."
}
while [[ ${1:-} ]]; do
case "$1" in
-r | --rpm ) shift
OPT_RPM_PATH=$1; shift
;;
-p | --profile ) shift
OPT_SIGN_PROFILE=$1; shift
;;
-h | --help ) shift
usage
exit;;
* )
usage
exit;;
esac
done
if [[ -z $OPT_RPM_PATH ]]; then
echo "Enter path to directory with RPM packages"
exit 1
fi
if [[ -z $OPT_SIGN_PROFILE ]]; then
OPT_SIGN_PROFILE="regular"
fi
if [[ "$OPT_SIGN_PROFILE" != "regular" ]] && [[ "$OPT_SIGN_PROFILE" != "extended" ]] &&
[[ "$OPT_SIGN_PROFILE" != "mdm" ]] && [[ "$OPT_SIGN_PROFILE" != "antivirus" ]] && [[ "$OPT_SIGN_PROFILE" != "auth" ]]; then
echo "Incorrect validation profile"
exit 1
fi
# Sign artifact
echo "Sign artifact"
rpmsign-external sign \
-k ~/aurora-profiles/$OPT_SIGN_PROFILE/key.pem \
-c ~/aurora-profiles/$OPT_SIGN_PROFILE/cert.pem \
$OPT_RPM_PATH/*
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать