diff options
author | Patrick Spek <p.spek@tyil.nl> | 2019-11-02 18:59:58 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2019-11-02 18:59:58 +0100 |
commit | fce4fd307412688ea304a2b59e116f1d4731b219 (patch) | |
tree | f0d52a3591d6d2662beaefc7afe420925ea8b3e2 /bin | |
parent | 05aed947e3bc4bd4213b93537a5c72ce87c2dec1 (diff) |
Upload releases to dist.tyil.nl
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/release-ftp.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/bin/release-ftp.sh b/bin/release-ftp.sh new file mode 100755 index 0000000..8837a22 --- /dev/null +++ b/bin/release-ftp.sh @@ -0,0 +1,38 @@ +#! /usr/bin/env sh + +readonly DISTNAME="rakudo-star-$CI_COMMIT_REF_NAME" + +main() +{ + if list_releases | grep -Fq "$DISTNAME" + then + printf "A release named %s already exists!\n" "$DISTNAME" + exit 1 + fi + + upload_release +} + +list_releases() +{ + lftp -e <<-EOI + open $FTP_HOST:${FTP_PORT:-21}; + user sftp://$FTP_USER $FTP_PASSWORD; + cd ${FTP_DIR:-rakudo-star}; + ls; + bye; + EOI +} + +upload_release() +{ + lftp -e <<-EOI + open $FTP_HOST:${FTP_PORT:-21}; + user sftp://$FTP_USER $FTP_PASSWORD; + cd ${FTP_DIR:-rakudo-star}; + put work/release/rakudo-star-$CI_COMMIT_REF_NAME; + bye; + EOI +} + +main "$@" |