Commit 1a21c829 authored by Angus Ainslie (Purism)'s avatar Angus Ainslie (Purism)
Browse files

get_image.sh : script to get the latest test image

parent b7eb36a5
#!/bin/bash
#
# Copyright (C) 2018 Purism SPC
#
# SPDX-License-Identifier: GPL-3.0+
#
usage() {
echo "Usage : $1 "
echo " -h Display this help message."
echo " -T [ci|test] get this version of the image "
echo " -n don't extract the image"
}
build_type=test
pureos_board=devkit
no_extract=0
while getopts "dT:" opt; do
case ${opt} in
T)
build_type=$OPTARG
;;
d)
no_extract=1
;;
\?)
echo "Invalid Option: -$OPTARG" 1>&2
usage "$0"
exit 0
;;
h)
usage "$0"
exit 0
;;
esac
done
[ ! -e files ] && mkdir files
base_url=https://arm01.puri.sm/job/Images/job/${pureos_board}-${build_type}_image_build/lastSuccessfulBuild/artifact/
wget -N "${base_url}/${pureos_board}-${build_type}.img.xz" -P files/
if [ "${no_extract}" == 0 ]; then
xz -vdk -f files/${pureos_board}-${build_type}.img.xz
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment