From 64676f725e30dc69ff992409d7a9013bfb2df1b6 Mon Sep 17 00:00:00 2001 From: matic_t Date: Thu, 9 Jul 2020 07:50:47 -0700 Subject: [PATCH] build and upload template script --- .gitignore | 2 +- build/build_and_upload.sh.template | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 build/build_and_upload.sh.template diff --git a/.gitignore b/.gitignore index 522933c..8c8a0b3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ __pycache__ build/* !build/Makefile !build/download_structure_conversions.sh -!build/build_and_upload.sh +!build/build_and_upload.sh.template # using kdev4, works fairly nicely! .kdev4 **/*.kdev4 diff --git a/build/build_and_upload.sh.template b/build/build_and_upload.sh.template new file mode 100755 index 0000000..6537e70 --- /dev/null +++ b/build/build_and_upload.sh.template @@ -0,0 +1,20 @@ +#!/bin/bash + +#USERNAME= vps sign in +#VPS_PASSWORD= vps password +#VPS_USERNAME= user name inside vps +#API_KEY= $(cat path/to/api/token/file) +echo "Must uncomment and fill in variables inside build_and_upload.sh" +exit 1 + + +if [[ -z "$1" ]]; then + echo "Must provide plugin name in environment" 1>&2 + exit 1 +fi + +PLUGIN_NAME=$1 + +API_KEY=$API_KEY make +tar czf - ./config.json ./bundle.js ./local.js ./main.css ./main.html | ssh $USERNAME -p $VPS_PASSWORD "cd plugins && mkdir -p $PLUGIN_NAME && cd $PLUGIN_NAME && tar xvzf -" +ssh -t $USERNAME -p $VPS_PASSWORD "sudo ln -s /home/$VPS_USERNAME/plugins/$PLUGIN_NAME /home/ozbolt/plugins/$PLUGIN_NAME"