Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 2 | # |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 3 | # Copyright (c) 2019-2020, Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | set -u |
| 9 | |
| 10 | bl1_addr="${bl1_addr:-0x0}" |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 11 | bl31_addr="${bl31_addr:-0x04001000}" |
Zelalem | 1b87461 | 2020-08-04 18:08:18 -0500 | [diff] [blame] | 12 | bl32_addr="${bl32_addr:-0x04003000}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 13 | bl33_addr="${bl33_addr:-0x88000000}" |
| 14 | dtb_addr="${dtb_addr:-0x82000000}" |
| 15 | fip_addr="${fip_addr:-0x08000000}" |
| 16 | initrd_addr="${initrd_addr:-0x84000000}" |
| 17 | kernel_addr="${kernel_addr:-0x80080000}" |
| 18 | el3_payload_addr="${el3_payload_addr:-0x80000000}" |
| 19 | |
Manish Pandey | 3c43558 | 2020-07-15 12:14:26 +0100 | [diff] [blame] | 20 | # SPM requires following addresses for RESET_TO_BL31 case |
| 21 | spm_addr="${spm_addr:-0x6000000}" |
| 22 | spmc_manifest_addr="${spmc_addr:-0x0403f000}" |
| 23 | sp1_addr="${sp1_addr:-0x7000000}" |
| 24 | sp2_addr="${sp2_addr:-0x7100000}" |
Olivier Deprez | 0b83409 | 2020-08-21 08:36:01 +0200 | [diff] [blame] | 25 | sp3_addr="${sp3_addr:-0x7200000}" |
Manish Pandey | 3c43558 | 2020-07-15 12:14:26 +0100 | [diff] [blame] | 26 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 27 | ns_bl1u_addr="${ns_bl1u_addr:-0x0beb8000}" |
| 28 | fwu_fip_addr="${fwu_fip_addr:-0x08400000}" |
| 29 | backup_fip_addr="${backup_fip_addr:-0x09000000}" |
| 30 | romlib_addr="${romlib_addr:-0x03ff2000}" |
| 31 | |
| 32 | uboot32_fip_url="$linaro_release/fvp32-latest-busybox-uboot/fip.bin" |
| 33 | |
Alexei Fedorov | e405cc3 | 2020-09-30 18:13:55 +0100 | [diff] [blame] | 34 | rootfs_url="$linaro_release/lt-vexpress64-openembedded_minimal-armv8-gcc-5.2_20170127-761.img.gz" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 35 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 36 | # Default FVP model variables |
| 37 | default_model_dtb="fvp-base-gicv3-psci.dtb" |
| 38 | |
| 39 | # default to the fvp container containing most of the models and its corresponding base |
| 40 | # directory |
| 41 | default_model_name="fvp:fvp_arm_std_library_11.12_38" |
| 42 | default_model_dir="/opt/model/FVP_ARM_Std_Library/models/Linux64_GCC-6.4" |
| 43 | |
| 44 | # This is intentionally black, so a the run config snippet MUST pass this the parameter |
| 45 | # indicating the model's binary |
| 46 | default_model_bin="" |
| 47 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 48 | # FVP Kernel URLs |
| 49 | declare -A fvp_kernels |
| 50 | fvp_kernels=( |
| 51 | [fvp-aarch32-zimage]="$linaro_release/fvp32-latest-busybox-uboot/Image" |
| 52 | [fvp-busybox-uboot]="$linaro_release/fvp-latest-busybox-uboot/Image" |
| 53 | [fvp-oe-uboot32]="$linaro_release/fvp32-latest-oe-uboot/Image" |
| 54 | [fvp-oe-uboot]="$linaro_release/fvp-latest-oe-uboot/Image" |
| 55 | [fvp-quad-busybox-uboot]="$tfa_downloads/quad_cluster/Image" |
| 56 | ) |
| 57 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 58 | # FVP initrd URLs |
| 59 | declare -A fvp_initrd_urls |
| 60 | fvp_initrd_urls=( |
| 61 | [aarch32-ramdisk]="$linaro_release/fvp32-latest-busybox-uboot/ramdisk.img" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 62 | [dummy-ramdisk]="$linaro_release/fvp-latest-oe-uboot/ramdisk.img" |
| 63 | [dummy-ramdisk32]="$linaro_release/fvp32-latest-oe-uboot/ramdisk.img" |
| 64 | [default]="$linaro_release/fvp-latest-busybox-uboot/ramdisk.img" |
| 65 | ) |
| 66 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 67 | get_optee_bin() { |
| 68 | url="$jenkins_url/job/tf-optee-build/PLATFORM_FLAVOR=fvp,label=arch-dev/lastSuccessfulBuild/artifact/artefacts/tee.bin" \ |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 69 | saveas="bl32.bin" fetch_file |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 70 | archive_file "bl32.bin" |
| 71 | } |
| 72 | |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 73 | # For Measured Boot tests using a TA based on OPTEE, it is necessary to use a |
| 74 | # specific build rather than the default one generated by Jenkins. |
| 75 | get_ftpm_optee_bin() { |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 76 | url="$tfa_downloads/ftpm/optee/tee-header_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 77 | saveas="bl32.bin" fetch_file |
| 78 | archive_file "bl32.bin" |
| 79 | |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 80 | url="$tfa_downloads/ftpm/optee/tee-pager_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 81 | saveas="bl32_extra1.bin" fetch_file |
| 82 | archive_file "bl32_extra1.bin" |
| 83 | |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 84 | url="$tfa_downloads/ftpm/optee/tee-pageable_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 85 | saveas="bl32_extra2.bin" fetch_file |
| 86 | archive_file "bl32_extra2.bin" |
| 87 | } |
| 88 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 89 | get_uboot32_bin() { |
| 90 | local tmpdir="$(mktempdir)" |
| 91 | |
| 92 | pushd "$tmpdir" |
| 93 | extract_fip "$uboot32_fip_url" |
| 94 | mv "nt-fw.bin" "uboot.bin" |
| 95 | archive_file "uboot.bin" |
| 96 | popd |
| 97 | } |
| 98 | |
| 99 | get_uboot_bin() { |
| 100 | local uboot_url="$linaro_release/fvp-latest-busybox-uboot/bl33-uboot.bin" |
| 101 | |
| 102 | url="$uboot_url" saveas="uboot.bin" fetch_file |
| 103 | archive_file "uboot.bin" |
| 104 | } |
| 105 | |
| 106 | get_uefi_bin() { |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 107 | uefi_downloads="${uefi_downloads:-http://files.oss.arm.com/downloads/uefi}" |
| 108 | uefi_ci_bin_url="${uefi_ci_bin_url:-$uefi_downloads/Artifacts/Linux/github/fvp/static/DEBUG_GCC5/FVP_AARCH64_EFI.fd}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 109 | |
| 110 | url=$uefi_ci_bin_url saveas="uefi.bin" fetch_file |
| 111 | archive_file "uefi.bin" |
| 112 | } |
| 113 | |
| 114 | get_kernel() { |
| 115 | local kernel_type="${kernel_type:?}" |
| 116 | local url="${fvp_kernels[$kernel_type]}" |
| 117 | |
| 118 | url="${url:?}" saveas="kernel.bin" fetch_file |
| 119 | archive_file "kernel.bin" |
| 120 | } |
| 121 | |
| 122 | get_initrd() { |
| 123 | local initrd_type="${initrd_type:?}" |
| 124 | local url="${fvp_initrd_urls[$initrd_type]}" |
| 125 | |
| 126 | url="${url:?}" saveas="initrd.bin" fetch_file |
| 127 | archive_file "initrd.bin" |
| 128 | } |
| 129 | |
| 130 | get_dtb() { |
| 131 | local dtb_type="${dtb_type:?}" |
| 132 | local dtb_url |
| 133 | local dtb_saveas="$workspace/dtb.bin" |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 134 | local cc="$(get_tf_opt CROSS_COMPILE)" |
| 135 | local pp_flags="-P -nostdinc -undef -x assembler-with-cpp" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 136 | |
| 137 | case "$dtb_type" in |
| 138 | "fvp-base-quad-cluster-gicv3-psci") |
| 139 | # Get the quad-cluster FDT from pdsw area |
| 140 | dtb_url="$tfa_downloads/quad_cluster/fvp-base-quad-cluster-gicv3-psci.dtb" |
| 141 | url="$dtb_url" saveas="$dtb_saveas" fetch_file |
| 142 | ;; |
| 143 | "sgm775") |
| 144 | # Get the SGM775 FDT from pdsw area |
| 145 | dtb_url="$sgm_prebuilts/sgm775.dtb" |
| 146 | url="$dtb_url" saveas="$dtb_saveas" fetch_file |
| 147 | ;; |
| 148 | *) |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 149 | # Preprocess DTS file |
| 150 | ${cc}gcc -E ${pp_flags} -I"$tf_root/fdts" -I"$tf_root/include" \ |
| 151 | -o "$workspace/${dtb_type}.pre.dts" \ |
| 152 | "$tf_root/fdts/${dtb_type}.dts" |
| 153 | # Generate DTB file from DTS |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 154 | dtc -I dts -O dtb \ |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 155 | "$workspace/${dtb_type}.pre.dts" -o "$dtb_saveas" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 156 | esac |
| 157 | |
| 158 | archive_file "$dtb_saveas" |
| 159 | } |
| 160 | |
| 161 | get_rootfs() { |
| 162 | local tmpdir |
| 163 | local fs_base="$(echo $(basename $rootfs_url) | sed 's/\.gz$//')" |
| 164 | local cached="$project_filer/ci-files/$fs_base" |
| 165 | |
| 166 | if upon "$jenkins_run" && [ -f "$cached" ]; then |
| 167 | # Job workspace is limited in size, and the root file system is |
| 168 | # quite large. This means, parallel runs of root file system |
| 169 | # tests could fail. So, for Jenkins runs, copy and use the root |
| 170 | # file system image from the $CI_SCRATCH location |
| 171 | local private="$CI_SCRATCH/$JOB_NAME-$BUILD_NUMBER" |
| 172 | mkdir -p "$private" |
| 173 | rm -f "$private/rootfs.bin" |
| 174 | url="$cached" saveas="$private/rootfs.bin" fetch_file |
| 175 | ln -s "$private/rootfs.bin" "$archive/rootfs.bin" |
| 176 | return |
| 177 | fi |
| 178 | |
| 179 | tmpdir="$(mktempdir)" |
| 180 | pushd "$tmpdir" |
| 181 | url="$rootfs_url" saveas="rootfs.bin" fetch_file |
| 182 | |
| 183 | # Possibly, the filesystem image we just downloaded is compressed. |
| 184 | # Decompress it if required. |
| 185 | if file "rootfs.bin" | grep -iq 'gzip compressed data'; then |
| 186 | echo "Decompressing root file system image rootfs.bin ..." |
| 187 | gunzip --stdout "rootfs.bin" > uncompressed_fs.bin |
| 188 | mv uncompressed_fs.bin "rootfs.bin" |
| 189 | fi |
| 190 | |
| 191 | archive_file "rootfs.bin" |
| 192 | popd |
| 193 | } |
| 194 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 195 | fvp_romlib_jmptbl_backup="$(mktempdir)/jmptbl.i" |
| 196 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 197 | fvp_romlib_runtime() { |
| 198 | local tmpdir="$(mktempdir)" |
| 199 | |
| 200 | # Save BL1 and romlib binaries from original build |
| 201 | mv "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin" "$tmpdir/romlib.bin" |
| 202 | mv "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" "$tmpdir/bl1.bin" |
| 203 | |
| 204 | # Patch index file |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 205 | cp "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" "$fvp_romlib_jmptbl_backup" |
| 206 | sed -i '/fdt/ s/.$/&\ patch/' ${tf_root:?}/plat/arm/board/fvp/jmptbl.i |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 207 | |
| 208 | # Rebuild with patched file |
| 209 | echo "Building patched romlib:" |
| 210 | build_tf |
| 211 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 212 | # Retrieve original BL1 and romlib binaries |
| 213 | mv "$tmpdir/romlib.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin" |
| 214 | mv "$tmpdir/bl1.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" |
| 215 | } |
| 216 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 217 | fvp_romlib_cleanup() { |
| 218 | # Restore original index |
| 219 | mv "$fvp_romlib_jmptbl_backup" "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" |
| 220 | } |
| 221 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 222 | |
| 223 | fvp_gen_bin_url() { |
| 224 | local bin_mode="${bin_mode:?}" |
| 225 | local bin="${1:?}" |
| 226 | |
| 227 | if upon "$jenkins_run"; then |
| 228 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/$bin" |
| 229 | else |
| 230 | echo "file://$workspace/artefacts/$bin_mode/$bin" |
| 231 | fi |
| 232 | } |
| 233 | |
| 234 | gen_fvp_yaml_template() { |
| 235 | local yaml_template_file="$workspace/fvp_template.yaml" |
| 236 | |
| 237 | # must parameters for yaml generation |
| 238 | local payload_type="${payload_type:?}" |
| 239 | |
| 240 | "$ci_root/script/gen_fvp_${payload_type}_yaml.sh" > "$yaml_template_file" |
| 241 | |
| 242 | archive_file "$yaml_template_file" |
| 243 | } |
| 244 | |
| 245 | gen_fvp_yaml() { |
| 246 | local yaml_template_file="$workspace/fvp_template.yaml" |
| 247 | local yaml_file="$workspace/fvp.yaml" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 248 | local yaml_job_file="$workspace/job.yaml" |
| 249 | local lava_model_params="$workspace/lava_model_params" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 250 | |
Leonardo Sandoval | fda4f29 | 2020-10-06 15:59:26 -0500 | [diff] [blame] | 251 | # this function expects a template, quit if it is not present |
| 252 | if [ ! -f "$yaml_template_file" ]; then |
| 253 | return |
| 254 | fi |
| 255 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 256 | # must parameters for yaml generation |
| 257 | local model="${model:?}" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 258 | |
| 259 | # optional parameters, defaults to globals |
| 260 | local model_name="${model_name:-$default_model_name}" |
| 261 | local model_dtb="${model_dtb:-$default_model_dtb}" |
| 262 | local model_dir="${model_dir:-$default_model_dir}" |
| 263 | local model_bin="${model_bin:-$default_model_bin}" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 264 | |
| 265 | # general artefacts |
| 266 | bl1="$(fvp_gen_bin_url bl1.bin)" |
| 267 | fip="$(fvp_gen_bin_url fip.bin)" |
| 268 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 269 | dtb="$(fvp_gen_bin_url ${model_dtb})" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 270 | image="$(fvp_gen_bin_url kernel.bin)" |
| 271 | ramdisk="$(fvp_gen_bin_url initrd.bin)" |
| 272 | |
| 273 | # tftf's ns_bl[1|2]u.bin artefacts |
| 274 | ns_bl1u="$(fvp_gen_bin_url ns_bl1u.bin)" |
| 275 | ns_bl2u="$(fvp_gen_bin_url ns_bl2u.bin)" |
| 276 | |
| 277 | docker_registry="${docker_registry:-}" |
| 278 | docker_registry="$(docker_registry_append)" |
| 279 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 280 | docker_name="${docker_registry}$model_name" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 281 | |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 282 | # generic version string |
| 283 | local version_string="\"Fast Models"' [^\\n]+'"\"" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 284 | |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 285 | sed -e "s|\${ARMLMD_LICENSE_FILE}|${armlmd_license_file}|" \ |
| 286 | -e "s|\${ACTIONS_DEPLOY_IMAGES_BL1}|${bl1}|" \ |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 287 | -e "s|\${ACTIONS_DEPLOY_IMAGES_FIP}|${fip}|" \ |
| 288 | -e "s|\${ACTIONS_DEPLOY_IMAGES_DTB}|${dtb}|" \ |
| 289 | -e "s|\${ACTIONS_DEPLOY_IMAGES_IMAGE}|${image}|" \ |
| 290 | -e "s|\${ACTIONS_DEPLOY_IMAGES_RAMDISK}|${ramdisk}|" \ |
| 291 | -e "s|\${ACTIONS_DEPLOY_IMAGES_NS_BL1U}|${ns_bl1u}|" \ |
| 292 | -e "s|\${ACTIONS_DEPLOY_IMAGES_NS_BL2U}|${ns_bl2u}|" \ |
| 293 | -e "s|\${BOOT_DOCKER_NAME}|${docker_name}|" \ |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 294 | -e "s|\${BOOT_IMAGE_DIR}|${model_dir}|" \ |
| 295 | -e "s|\${BOOT_IMAGE_BIN}|${model_bin}|" \ |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 296 | -e "s|\${BOOT_VERSION_STRING}|${version_string}|" \ |
| 297 | < "$yaml_template_file" \ |
| 298 | > "$yaml_file" |
| 299 | |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 300 | # LAVA expects 'macro' names for binaries, so replace them |
| 301 | sed -e "s|bl1.bin|{BL1}|" \ |
| 302 | -e "s|fip.bin|{FIP}|" \ |
| 303 | -e "s|kernel.bin|{IMAGE}|" \ |
| 304 | -e "s|initrd.bin|{RAMDISK}|" \ |
| 305 | < "$archive/model_params" \ |
| 306 | > "$lava_model_params" |
| 307 | |
| 308 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 309 | # include the model parameters |
| 310 | while read -r line; do |
| 311 | if [ -n "$line" ]; then |
| 312 | yaml_line="- \"${line}\"" |
| 313 | sed -i -e "/\${BOOT_ARGUMENTS}/i \ \ \ \ $yaml_line" "$yaml_file" |
| 314 | fi |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 315 | done < "$lava_model_params" |
| 316 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 317 | sed -i -e '/\${BOOT_ARGUMENTS}/d' "$yaml_file" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 318 | cp "$yaml_file" "$yaml_job_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 319 | |
| 320 | archive_file "$yaml_file" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame^] | 321 | archive_file "$yaml_job_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | docker_registry_append() { |
| 325 | # if docker_registry is empty, just use local docker registry |
| 326 | [ -z "$docker_registry" ] && return |
| 327 | |
| 328 | local last=-1 |
| 329 | local last_char="${docker_registry:last}" |
| 330 | |
| 331 | if [ "$last_char" != '/' ]; then |
| 332 | docker_registry="${docker_registry}/"; |
| 333 | fi |
| 334 | echo "$docker_registry" |
| 335 | } |
| 336 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 337 | set +u |