Skip to content

Commit 6667ef6

Browse files
committed
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>
1 parent 6a4f988 commit 6667ef6

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

azure-pipelines-rpi.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ trigger:
22
- rpi-6.1.y
33
- rpi-6.6.y
44
- rpi-6.12.y
5-
- staging-rpi/*
5+
- staging/rpi/*
6+
- rpi/release/*
67

78
pr:
89
- rpi-6.1.y
910
- rpi-6.6.y
1011
- rpi-6.12.y
12+
- rpi/release/*
1113

1214
resources:
1315
repositories:
@@ -90,7 +92,8 @@ stages:
9092
condition: and(
9193
succeeded(),
9294
or(eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.12.y'),
93-
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'))
95+
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'),
96+
startsWith(variables['Build.SourceBranch'], 'refs/heads/rpi/release/'))
9497
)
9598
pool:
9699
vmImage: 'ubuntu-latest'
@@ -111,7 +114,8 @@ stages:
111114
condition: and(
112115
succeeded(),
113116
or(eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.12.y'),
114-
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'))
117+
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'),
118+
startsWith(variables['Build.SourceBranch'], 'refs/heads/rpi/release/'))
115119
)
116120
pool:
117121
name: Default
@@ -128,7 +132,12 @@ stages:
128132
displayName: "Push to Artifactory"
129133

130134
- job: Push_to_Cloudsmith
131-
condition: succeeded()
135+
condition: and(
136+
succeeded(),
137+
or(eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.12.y'),
138+
eq(variables['Build.SourceBranch'], 'refs/heads/rpi-6.6.y'),
139+
startsWith(variables['Build.SourceBranch'], 'refs/heads/rpi/release/'))
140+
)
132141
pool:
133142
name: Default
134143
demands:

ci/travis/prepare_artifacts_rpi.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
timestamp=$(date +%Y_%m_%d-%H_%M)
55
GIT_SHA=$(git rev-parse --short HEAD)
66
GIT_SHA_DATE=$(git show -s --format=%cd --date=format:'%Y-%m-%d %H:%M' ${GIT_SHA} | sed -e "s/ \|\:/-/g")
7+
ARTIFACTS_BRANCH_UPLOAD=${BUILD_SOURCEBRANCHNAME##*/}
78

89
#create version file found in the boot partition
910
create_version_file() {
@@ -72,7 +73,7 @@ artifacts_artifactory() {
7273
cd ${SOURCE_DIRECTORY}
7374
python ../ci/travis/upload_to_artifactory_parallel.py \
7475
--base_path="${ARTIFACTORY_PATH}" \
75-
--server_path="linux_rpi/${BUILD_SOURCEBRANCHNAME}/${timestamp}" \
76+
--server_path="linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/${timestamp}" \
7677
--local_path="${timestamp}" \
7778
--token="${ARTIFACTORY_TOKEN}" \
7879
--log_file="upload_to_artifactory.log" \
@@ -89,38 +90,38 @@ artifacts_swdownloads() {
8990

9091
cd ${SOURCE_DIRECTORY}/${timestamp}/32bit || exit 1
9192
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
92-
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
93+
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
9394
md5_modules_32bit=($(md5sum rpi_modules_32bit.tar.gz| cut -d ' ' -f 1))
9495
rm rpi_modules_32bit.tar.gz
9596
tar -C ${PWD} -czvf rpi_latest_boot_32bit.tar.gz *
9697
md5_boot_32bit=($(md5sum rpi_latest_boot_32bit.tar.gz| cut -d ' ' -f 1))
9798
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
98-
-i ${KEY_FILE} -r rpi_latest_boot_32bit.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
99+
-i ${KEY_FILE} -r rpi_latest_boot_32bit.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
99100

100101
cd ${SOURCE_DIRECTORY}/${timestamp}/64bit || exit 1
101102
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
102-
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
103+
-i ${KEY_FILE} -r *.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
103104
md5_modules_64bit=($(md5sum rpi_modules_64bit.tar.gz| cut -d ' ' -f 1))
104105
rm rpi_modules_64bit.tar.gz
105106
tar -C ${PWD} -czvf rpi_latest_boot_64bit.tar.gz *
106107
md5_boot_64bit=($(md5sum rpi_latest_boot_64bit.tar.gz| cut -d ' ' -f 1))
107108
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
108-
-i ${KEY_FILE} -r rpi_latest_boot_64bit.tar.gz ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
109+
-i ${KEY_FILE} -r rpi_latest_boot_64bit.tar.gz ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
109110

110111
echo "git_branch=${BUILD_SOURCEBRANCHNAME}" >> rpi_archives_properties.txt
111-
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_modules_32bit.tar.gz" >> rpi_archives_properties.txt
112-
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_latest_boot_32bit.tar.gz" >> rpi_archives_properties.txt
112+
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_modules_32bit.tar.gz" >> rpi_archives_properties.txt
113+
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_latest_boot_32bit.tar.gz" >> rpi_archives_properties.txt
113114
echo "checksum_modules_32bit=${md5_modules_32bit}" >> rpi_archives_properties.txt
114115
echo "checksum_boot_files_32bit=${md5_boot_32bit}" >> rpi_archives_properties.txt
115-
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_modules_64bit.tar.gz" >> rpi_archives_properties.txt
116-
echo "https://swdownloads.analog.com/cse/linux_rpi/${BUILD_SOURCEBRANCHNAME}/rpi_latest_boot_64bit.tar.gz" >> rpi_archives_properties.txt
116+
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_modules_64bit.tar.gz" >> rpi_archives_properties.txt
117+
echo "https://swdownloads.analog.com/cse/linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/rpi_latest_boot_64bit.tar.gz" >> rpi_archives_properties.txt
117118
echo "checksum_modules_64bit=${md5_modules_64bit}" >> rpi_archives_properties.txt
118119
echo "checksum_boot_files_64bit=${md5_boot_64bit}" >> rpi_archives_properties.txt
119120
echo "git_sha=${GIT_SHA}" >> rpi_archives_properties.txt
120121
echo "git_sha_date=${GIT_SHA_DATE}" >> rpi_archives_properties.txt
121122

122123
scp -2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss \
123-
-i ${KEY_FILE} -r rpi_archives_properties.txt ${DEST_SERVER}/${BUILD_SOURCEBRANCHNAME}
124+
-i ${KEY_FILE} -r rpi_archives_properties.txt ${DEST_SERVER}/${ARTIFACTS_BRANCH_UPLOAD}
124125
}
125126

126127
#upload artifacts to Cloudsmith
@@ -136,7 +137,7 @@ artifacts_cloudsmith() {
136137

137138
python3 ${BUILD_SOURCESDIRECTORY}/wiki-scripts/utils/cloudsmith_utils/upload_to_cloudsmith.py \
138139
--repo="sdg-linux-rpi" \
139-
--version="linux_rpi/${BUILD_SOURCEBRANCHNAME}/${timestamp}/" \
140+
--version="linux_rpi/${ARTIFACTS_BRANCH_UPLOAD}/${timestamp}/" \
140141
--local_path="${SOURCE_DIRECTORY}/${timestamp}" \
141142
--tags="git_sha-${GIT_SHA};timestamp_${timestamp}" \
142143
--token="${CLOUDSMITH_API_KEY}" \

ci/travis/run-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ build_default() {
181181

182182
make ${DEFCONFIG}
183183
if [[ "${SYSTEM_PULLREQUEST_TARGETBRANCH}" =~ ^rpi-.* || "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/rpi-.* \
184-
|| "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/staging-rpi ]]; then
184+
|| "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/staging/rpi/* || "${BUILD_SOURCEBRANCH}" =~ ^refs/heads/rpi/release/* ]]; then
185185
echo "Rpi build"
186186
make -j$NUM_JOBS DTC_FLAGS=-@ $IMAGE modules dtbs
187187
make INSTALL_MOD_PATH="${PWD}/modules" modules_install

0 commit comments

Comments
 (0)