Commit 814572ef authored by Guido Gunther's avatar Guido Gunther Committed by Gogs
Browse files

Merge branch 'master' of Angus_Ainslie/image-builder into master

parents bc362b73 b88f0f8f
#!/bin/bash
#
# Copyright (C) 2017 Purism SPC
# Copyright (C) 2017-2018 Purism SPC
#
# SPDX-License-Identifier: GPL-3.0+
#
set -e
BUILD_NUMBER=$1
TAG=$2
shift
shift
FILES="$@"
DATE=$(date --iso)
REMOTE=librem5@storage.puri.sm
BUILD_DIR="${TAG}-${DATE}-B${BUILD_NUMBER}"
TARGET="librem5/binaries/ci/${BUILD_DIR}"
BUILD_DIR=""
OUT_DIR=""
BUILD_TYPE="ci"
usage() {
echo "Usage : $1 "
echo " -h Display this help message."
echo " -b build number"
echo " -t a tag for the type of build"
echo " -o output path"
echo " -T build type [ci|unstable]"
}
while getopts ":hb:t:o:" opt; do
case ${opt} in
b)
BUILD_NUMBER=$OPTARG
echo "Build number : ${BUILD_NUMBER}"
;;
t)
TAG=$OPTARG
echo "Tag : ${TAG}"
;;
o)
OUT_DIR=$OPTARG
echo "Out dir : ${OUT_DIR}"
;;
T)
BUILD_TYPE=$OPTARG
echo "Build type : ${BUILD_TYPE}"
;;
\?)
echo "Invalid Option: -$OPTARG" 1>&2
usage "$0"
exit 0
;;
h )
usage "$0"
exit 0
;;
esac
done
shift "$((OPTIND-1))"
FILES="$@"
echo "Copying files ${FILES}"
[ -z ${TAG} ] || BUILD_DIR="${TAG}-"
BUILD_DIR+="${DATE}"
[ -z ${BUILD_NUMBER} ] || BUILD_DIR+="-B${BUILD_NUMBER}"
TARGET="librem5/binaries/${BUILD_TYPE}/${BUILD_DIR}"
[ -z ${OUT_DIR} ] || TARGET+="/${OUT_DIR}"
echo "Uploading to ${REMOTE}:${TARGET}"
ssh -p 3376 ${REMOTE} "mkdir -p ${TARGET}"
ssh -p 3376 ${REMOTE} "mkdir -p librem5/binaries/ci/latest"
ssh -p 3376 ${REMOTE} "mkdir -p librem5/binaries/${BUILD_TYPE}/latest/${OUT_DIR}"
for FILE in ${FILES}; do
echo "Uploding file ${FILE}"
BASE=`basename ${FILE}`
scp -P 3376 -r ${FILE} "${REMOTE}:${TARGET}"
ssh -p 3376 ${REMOTE} "ln -nsf ../${BUILD_DIR}/${BASE} ${TARGET}/../latest/${BASE}"
ssh -p 3376 ${REMOTE} "ln -rnsf ${TARGET}/${BASE} librem5/binaries/${BUILD_TYPE}/latest/${OUT_DIR}/${BASE}"
done
......@@ -16,7 +16,7 @@ node {
)
}
stage('Publish') {
sh "bin/publish_ci_files ${BUILD_NUMBER} kernel files/*"
sh "bin/publish_ci_files -b ${BUILD_NUMBER} -t kernel -o files files/*"
}
stage('Results') {
archive artifacts
......
......@@ -16,7 +16,7 @@ node {
)
}
stage('Publish') {
sh "bin/publish_ci_files ${BUILD_NUMBER} uboot files/*"
sh "bin/publish_ci_files -b ${BUILD_NUMBER} -t uboot -o files files/*"
}
stage('Results') {
archive artifacts
......
Supports Markdown
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