mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-18 23:52:52 +00:00
feat: add apk deploy via scp
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
SSH_DEPLOY_TARGET=$1
|
||||
SSH_DEPLOY_TARGET=$2
|
||||
SSH_DEPLOY_TARGET="${SSH_DEPLOY_TARGET:-"missingtarget"}"
|
||||
|
||||
SSH_PRIVATE_KEY=$2
|
||||
SSH_PRIVATE_KEY=$3
|
||||
SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY:-"missingkey"}"
|
||||
|
||||
GOTO_FAIL=false
|
||||
@@ -45,13 +45,26 @@ mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
eval `ssh-agent -s`
|
||||
echo "$SSH_PRIVATE_KEY" | base64 -d | tr -d '\r' | ssh-add -
|
||||
##
|
||||
## Use ssh-keyscan to scan the keys of your private server. Replace gitlab.com
|
||||
## with your own domain name. You can copy and repeat that command if you have
|
||||
## more than one server to connect to.
|
||||
|
||||
## Use ssh-keyscan to scan the keys of your private server.
|
||||
## You can copy and repeat that command if you have more than
|
||||
## one server to connect to.
|
||||
ssh-keyscan $SSH_DEPLOY_TARGET_HOST >> ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
scp www.zip "$SSH_DEPLOY_TARGET"
|
||||
ssh "$SSH_DEPLOY_TARGET_USER@$SSH_DEPLOY_TARGET_HOST" "cd $SSH_DEPLOY_TARGET_PATH && unzip -o www.zip && rm -f www.zip"
|
||||
web() {
|
||||
scp www.zip "$SSH_DEPLOY_TARGET"
|
||||
ssh "$SSH_DEPLOY_TARGET_USER@$SSH_DEPLOY_TARGET_HOST" "cd $SSH_DEPLOY_TARGET_PATH && unzip -o www.zip && rm -f www.zip"
|
||||
}
|
||||
|
||||
apk() {
|
||||
scp app/android/app/build/outputs/apk/release/app-release.apk "$SSH_DEPLOY_TARGET"
|
||||
}
|
||||
|
||||
if declare -f "$1" > /dev/null
|
||||
then
|
||||
"$@"
|
||||
else
|
||||
echo "'$1' is not a known function name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user