From 6a0c01356f40d96478f47b73b5a8fa8ca1dac258 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 6 Aug 2019 22:05:45 +0100 Subject: [PATCH] build: add automated release uploader, but only for tags. --- build | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/build b/build index 09ab237..3a0b964 100755 --- a/build +++ b/build @@ -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 } ###############################################################################