build and upload template script

This commit is contained in:
matic_t 2020-07-09 07:50:47 -07:00
parent a63e1f5e73
commit 64676f725e
2 changed files with 21 additions and 1 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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"