aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2019-11-02 18:59:58 +0100
committerPatrick Spek <p.spek@tyil.nl>2019-11-02 18:59:58 +0100
commitfce4fd307412688ea304a2b59e116f1d4731b219 (patch)
treef0d52a3591d6d2662beaefc7afe420925ea8b3e2
parent05aed947e3bc4bd4213b93537a5c72ce87c2dec1 (diff)
Upload releases to dist.tyil.nl
-rw-r--r--.gitlab-ci.yml11
-rwxr-xr-xbin/release-ftp.sh38
2 files changed, 48 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f2ac750..125e4c5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -83,4 +83,13 @@ Docker:
- docker build --build-arg "VERSION=$CI_COMMIT_REF_NAME" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
-# TODO: Release the tarball to some Raku server
+dist.tyil.nl:
+ stage: Release
+ image: alpine:latest
+ env:
+ FTP_HOST: minion4.tyil.net
+ FTP_PORT: "3386"
+ before_script:
+ - apk add --no-cache lftp
+ script:
+ - bin/release-ftp.sh
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 "$@"