build: add automated release uploader, but only for tags.

This commit is contained in:
Starbeamrainbowlabs 2019-08-06 22:05:45 +01:00
parent 5d7b45b8e2
commit 6a0c01356f
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 21 additions and 2 deletions

23
build
View File

@ -15,8 +15,11 @@ lantern_path="./lantern-build-engine";
# Custom Settings
###
# Put any custom settings here.
# build_output_folder="./dist";
# Deployment settings
deploy_ssh_user="ci";
deploy_ssh_host="apt.starbeamrainbowlabs.com";
deploy_ssh_port="22";
deploy_root_dir="CIAptPackages";
###############################################################################
@ -99,8 +102,24 @@ task_archive() {
task_end $?;
}
task_upload-release() {
task_begin "Uploading release .deb file";
sftp -i "${SSH_KEY_PATH}" -P "${deploy_ssh_port}" -o PasswordAuthentication=no "${deploy_ssh_user}@${deploy_ssh_host}" << SFTPCOMMANDS
put ./*.deb ${deploy_root_dir}
bye
SFTPCOMMANDS
task_end $?;
}
task_ci() {
tasks_run setup build package archive;
if [[ "$(git tag --points-at HEAD | wc -l)" -gt 0 ]]; then
echo "Found tag $(git tag --points-at HEAD), uploading release";
tasks_run upload-release;
fi
}
###############################################################################