summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-07-03 10:33:17 +0530
committerGitHub <noreply@github.com>2020-07-03 07:03:17 +0200
commitff3d2fcce3f1d74bdb1e13e3634f1ea9a9f9f1e5 (patch)
treee93a9e60223020c47c0eaf397bc30f1e59db3ea9
parent9fb492b572d7807450f0752c6222fe0e246acea9 (diff)
release: script improvements (#915)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rwxr-xr-xrelease/deploy-github.sh1
-rwxr-xr-xrelease/deploy-snapshot.sh8
-rwxr-xr-xrelease/deploy-telegram.sh13
-rwxr-xr-xrelease/encrypt-secret.sh1
-rwxr-xr-xrelease/signing-cleanup.sh1
-rwxr-xr-xrelease/signing-setup.sh1
6 files changed, 8 insertions, 17 deletions
diff --git a/release/deploy-github.sh b/release/deploy-github.sh
index 2dca0e2d..9480604b 100755
--- a/release/deploy-github.sh
+++ b/release/deploy-github.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+set -ex
trap 'exit 1' SIGINT SIGTERM
diff --git a/release/deploy-snapshot.sh b/release/deploy-snapshot.sh
index 6d9cfdbb..80606f67 100755
--- a/release/deploy-snapshot.sh
+++ b/release/deploy-snapshot.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
+set -ex
export SSHDIR="$HOME/.ssh"
mkdir -p "$SSHDIR"
@@ -6,8 +7,7 @@ echo "$ACTIONS_DEPLOY_KEY" > "$SSHDIR/key"
chmod 600 "$SSHDIR/key"
export SERVER_DEPLOY_STRING="$SSH_USERNAME@$SERVER_ADDRESS:$SERVER_DESTINATION"
mkdir -p "$GITHUB_WORKSPACE/APS"
-cp -v "$GITHUB_WORKSPACE/app/build/outputs/apk/free/release/*.apk" "$GITHUB_WORKSPACE/APS"
-cp -v "$GITHUB_WORKSPACE/app/build/outputs/apk/nonFree/release/*.apk" "$GITHUB_WORKSPACE/APS"
+cp -v ./app/build/outputs/apk/free/release/*.apk "$GITHUB_WORKSPACE/APS/"
+cp -v ./app/build/outputs/apk/nonFree/release/*.apk "$GITHUB_WORKSPACE/APS/"
cd "$GITHUB_WORKSPACE/APS"
-rsync -ahvcr --omit-dir-times --progress --delete --no-o --no-g -e "ssh -i $SSHDIR/key -o StrictHostKeyChecking=no -p $SSH_PORT" . "$SERVER_DEPLOY_STRING" || exit 1
-exit 0
+rsync -ahvcr --omit-dir-times --progress --delete --no-o --no-g -e "ssh -i $SSHDIR/key -o StrictHostKeyChecking=no -p $SSH_PORT" . "$SERVER_DEPLOY_STRING"
diff --git a/release/deploy-telegram.sh b/release/deploy-telegram.sh
deleted file mode 100755
index 79ae9458..00000000
--- a/release/deploy-telegram.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-
-function send_to_tg() {
- local FILE
- local CHAT_ID
- local CAPTION
- FILE="${1}"
- CHAT_ID="${2}"
- CAPTION="${3}"
- curl -F chat_id="${CHAT_ID}" -F document="@${FILE}" -F caption="${CAPTION}" -F parse_mode="Markdown" "https://api.telegram.org/bot${TG_TOKEN:?}/sendDocument" >/dev/null 2>&1
-}
-
-send_to_tg "${TG_FILE:?}" "${TG_TO:?}" "aps-${GITHUB_RUN_NUMBER}-debug"
diff --git a/release/encrypt-secret.sh b/release/encrypt-secret.sh
index 6d71c4bc..7c762d19 100755
--- a/release/encrypt-secret.sh
+++ b/release/encrypt-secret.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+set -ex
# Simple script that uses OpenSSL to encrypt a provided file with a provided key, and writes the result
# to the provided path. Yes it's very needy.
diff --git a/release/signing-cleanup.sh b/release/signing-cleanup.sh
index babe793e..d529c4e9 100755
--- a/release/signing-cleanup.sh
+++ b/release/signing-cleanup.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+set -ex
# Delete Release key
rm -f keystore.jks
diff --git a/release/signing-setup.sh b/release/signing-setup.sh
index 896a78b0..d46504c3 100755
--- a/release/signing-setup.sh
+++ b/release/signing-setup.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+set -ex
ENCRYPT_KEY=$1