-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy.sh
executable file
·42 lines (31 loc) · 1023 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
wsd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
output='/tmp'
# Download Freemius API wrapper in php
if [ ! -d "$wsd/freemius-php-api" ]; then
echo "Download Freemius PHP SDK"
git clone git@github.com:Freemius/php-sdk.git "$wsd"/freemius-php-api
fi
if [ ! -f "$wsd/config.ini" ]; then
echo "file config.ini missing"
exit
fi
# Read the config.ini
eval $(crudini --get --format=sh "$wsd"/config.ini $1)
eval $(crudini --get --format=sh "$wsd"/config.ini Login)
if [ -z "$path" ]; then
echo "- Missing Plugin path in $wsd/config.ini"
exit
fi
echo "- Deploy process started"
. "$wsd"/package.sh $path $filename
filezip="$output"/"$packagename"-"$version".zip
php "$wsd"/deploy.php "$user" "$pubkey" "$secretkey" "$filezip" "$id" "$sandbox" "$version"
status=$?
if [ $status -ne 3 ]; then
rm "$filezip"
filezipfree="$output"/"$packagename"-"$version".free.zip
. "$wsd"/release.sh $filezipfree
else
echo "Error happened, file zip generated at $filezip"
fi