mirror of
https://github.com/analogdevicesinc/linux.git
synced 2026-05-30 00:55:04 +08:00
ci: travis: add support for RPi release branch build and upload
Add support for building and uploading artifacts using the new release branch naming. Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
This commit is contained in:
committed by
Andreea Andrisan
parent
ba4c8d3d41
commit
9598f5b9ad
@@ -2,12 +2,14 @@ trigger:
|
||||
- rpi-6.1.y
|
||||
- rpi-6.6.y
|
||||
- rpi-6.12.y
|
||||
- staging-rpi/*
|
||||
- staging/rpi/*
|
||||
- rpi/release/*
|
||||
|
||||
pr:
|
||||
- rpi-6.1.y
|
||||
- rpi-6.6.y
|
||||
- rpi-6.12.y
|
||||
- rpi/release/*
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
@@ -90,7 +92,8 @@ stages:
|
||||
condition: and(
|
||||
succeeded(),
|
||||
or(eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.12.y'),
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'))
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'),
|
||||
startsWith(variables['Build.SourceBranch'], 'refs/heads/rpi/release/'))
|
||||
)
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
@@ -111,7 +114,8 @@ stages:
|
||||
condition: and(
|
||||
succeeded(),
|
||||
or(eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.12.y'),
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'))
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'),
|
||||
startsWith(variables['Build.SourceBranch'], 'refs/heads/rpi/release/'))
|
||||
)
|
||||
pool:
|
||||
name: Default
|
||||
@@ -128,7 +132,12 @@ stages:
|
||||
displayName: "Push to Artifactory"
|
||||
|
||||
- job: Push_to_Cloudsmith
|
||||
condition: succeeded()
|
||||
condition: and(
|
||||
succeeded(),
|
||||
or(eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.12.y'),
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'),
|
||||
startsWith(variables['Build.SourceBranch'], 'refs/heads/rpi/release/'))
|
||||
)
|
||||
pool:
|
||||
name: Default
|
||||
demands:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
timestamp=$(date +%Y_%m_%d-%H_%M)
|
||||
GIT_SHA=$(git rev-parse --short HEAD)
|
||||
GIT_SHA_DATE=$(git show -s --format=%cd --date=format:'%Y-%m-%d %H:%M' ${GIT_SHA} | sed -e "s/ \|\:/-/g")
|
||||
ARTIFACTS_BRANCH_UPLOAD=${BUILD_SOURCEBRANCHNAME##*/}
|
||||
|
||||
#create version file found in the boot partition
|
||||
create_version_file() {
|
||||
@@ -72,7 +73,7 @@ artifacts_artifactory() {
|
||||
cd ${SOURCE_DIRECTORY}
|
||||
python ../ci/travis/upload_to_artifactory_parallel.py \
|
||||
--base_path="${ARTIFACTORY_PATH}" \
|
||||
--server_path="linux_rpi/${BUILD_SOURCEBRANCHNAME}/${timestamp}" \
|
||||
--server_path="linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/${timestamp}" \
|
||||
--local_path="${timestamp}" \
|
||||
--token="${ARTIFACTORY_TOKEN}" \
|
||||
--log_file="upload_to_artifactory.log" \
|
||||
@@ -89,38 +90,38 @@ artifacts_swdownloads() {
|
||||
|
||||
cd ${SOURCE_DIRECTORY}/${timestamp}/32bit || exit 1
|
||||
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
|
||||
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
|
||||
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
|
||||
md5_modules_32bit=($(md5sum rpi_modules_32bit.tar.gz| cut -d ' ' -f 1))
|
||||
rm rpi_modules_32bit.tar.gz
|
||||
tar -C ${PWD} -czvf rpi_latest_boot_32bit.tar.gz *
|
||||
md5_boot_32bit=($(md5sum rpi_latest_boot_32bit.tar.gz| cut -d ' ' -f 1))
|
||||
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
|
||||
-i ${KEY_FILE} -r rpi_latest_boot_32bit.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
|
||||
-i ${KEY_FILE} -r rpi_latest_boot_32bit.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
|
||||
|
||||
cd ${SOURCE_DIRECTORY}/${timestamp}/64bit || exit 1
|
||||
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
|
||||
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
|
||||
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
|
||||
md5_modules_64bit=($(md5sum rpi_modules_64bit.tar.gz| cut -d ' ' -f 1))
|
||||
rm rpi_modules_64bit.tar.gz
|
||||
tar -C ${PWD} -czvf rpi_latest_boot_64bit.tar.gz *
|
||||
md5_boot_64bit=($(md5sum rpi_latest_boot_64bit.tar.gz| cut -d ' ' -f 1))
|
||||
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
|
||||
-i ${KEY_FILE} -r rpi_latest_boot_64bit.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
|
||||
-i ${KEY_FILE} -r rpi_latest_boot_64bit.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
|
||||
|
||||
echo "git_branch=${BUILD_SOURCEBRANCHNAME}" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_modules_32bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_latest_boot_32bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_modules_32bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_latest_boot_32bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "checksum_modules_32bit=${md5_modules_32bit}" >> rpi_archives_properties.txt
|
||||
echo "checksum_boot_files_32bit=${md5_boot_32bit}" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_modules_64bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_latest_boot_64bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_modules_64bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_latest_boot_64bit.tar.gz" >> rpi_archives_properties.txt
|
||||
echo "checksum_modules_64bit=${md5_modules_64bit}" >> rpi_archives_properties.txt
|
||||
echo "checksum_boot_files_64bit=${md5_boot_64bit}" >> rpi_archives_properties.txt
|
||||
echo "git_sha=${GIT_SHA}" >> rpi_archives_properties.txt
|
||||
echo "git_sha_date=${GIT_SHA_DATE}" >> rpi_archives_properties.txt
|
||||
|
||||
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
|
||||
-i ${KEY_FILE} -r rpi_archives_properties.txt ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
|
||||
-i ${KEY_FILE} -r rpi_archives_properties.txt ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
|
||||
}
|
||||
|
||||
#upload artifacts to Cloudsmith
|
||||
@@ -136,7 +137,7 @@ artifacts_cloudsmith() {
|
||||
|
||||
python3 ${BUILD_SOURCESDIRECTORY}/wiki-scripts/utils/cloudsmith_utils/upload_to_cloudsmith.py \
|
||||
--repo="sdg-linux-rpi" \
|
||||
--version="linux_rpi/${BUILD_SOURCEBRANCHNAME}/${timestamp}/" \
|
||||
--version="linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/${timestamp}/" \
|
||||
--local_path="${SOURCE_DIRECTORY}/${timestamp}" \
|
||||
--tags="git_sha-${GIT_SHA};timestamp_${timestamp}" \
|
||||
--token="${CLOUDSMITH_API_KEY}" \
|
||||
|
||||
@@ -181,7 +181,7 @@ build_default() {
|
||||
|
||||
make ${DEFCONFIG}
|
||||
if [[ "${SYSTEM_PULLREQUEST_TARGETBRANCH}" =~ ^rpi-.* || "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/rpi-.* \
|
||||
|| "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/staging-rpi ]]; then
|
||||
|| "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/staging/rpi/* || "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/rpi/release/* ]]; then
|
||||
echo "Rpi build"
|
||||
make -j$NUM_JOBS DTC_FLAGS=-@ $IMAGE modules dtbs
|
||||
make INSTALL_MOD_PATH="${PWD}/modules" modules_install
|
||||
|
||||
Reference in New Issue
Block a user