Merge pull request 'Readme + skripta za upload na VPS' (#1) from mt-initial-setup into master
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
27
build/build_and_upload.sh.template
Executable file
27
build/build_and_upload.sh.template
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
#############################################################################
|
||||
# NOTE: Update .template if logical changes are made to the script #
|
||||
#############################################################################
|
||||
|
||||
# Alter these variables
|
||||
#USERNAME= vps_sign_in(probably name@lexonomy.cjvt.si
|
||||
#VPS_PASSWORD= vps password
|
||||
#VPS_USERNAME= user name inside vps(probably name from @lexonomy)
|
||||
#API_KEY= $(cat path/to/api/token/file)
|
||||
|
||||
# Exit if no argument is passed on run
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Must provide plugin name in environment" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PLUGIN_NAME=$1
|
||||
# Build the plugin
|
||||
API_KEY=$API_KEY make
|
||||
|
||||
# zip all the required files and upload them to ssh
|
||||
tar czf - ./config.json ./bundle.js ./local.js ./main.css ./main.html | ssh $USERNAME -p $VPS_PASSWORD "cd plugins && mkdir $PLUGIN_NAME && cd $PLUGIN_NAME && tar xvzf -"
|
||||
|
||||
# Create a simlink on VPS that will enable specific plugin on https://lexonomy.cjvt.si/
|
||||
# Routes must be absolute or it doesn't work.
|
||||
ssh -t $USERNAME -p $VPS_PASSWORD "sudo ln -s /home/$VPS_USERNAME/plugins/$PLUGIN_NAME /home/ozbolt/plugins/$PLUGIN_NAME"
|
||||
5
build/config.json
Normal file
5
build/config.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": [], "globals": [],
|
||||
"javascript": "$LOCATION$/bundle.js",
|
||||
"css": ["$LOCATION$/main.css"]
|
||||
}
|
||||
Reference in New Issue
Block a user