Skip to content

Commit

Permalink
Cambios en instaladores
Browse files Browse the repository at this point in the history
  • Loading branch information
gmorales254 committed Mar 26, 2022
1 parent 45462d6 commit d272a8b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 21 deletions.
32 changes: 19 additions & 13 deletions DB/install.sql

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions REPORTS/install.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO ccdata.reports (name, file, description, DSN, parameters, grouped, language, license, visible)
VALUES ('CRMLite - Management and Customer information detail', 'CRMLiteManagementCustomerDetail.jrxml', '', 'Repo', 'INITIAL_DATE:Timestamp;FINAL_DATE:Timestamp;QUEUE:Queue;', 'CRMLite', 'en', 'CCS', 1),
('CRMLite - Detalle de gestiones y clientes', 'CRMLiteManagementCustomerDetail.jrxml', 'Gestiones realizadas sobre CRMLite e informacion de los clientes respectivos', 'Repo', 'INITIAL_DATE:Timestamp;FINAL_DATE:Timestamp;QUEUE:Queue;', 'CRMLite', 'es', 'CCS', 1);
39 changes: 31 additions & 8 deletions installCRMLite.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
TOKEN="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"
echo "Enter Database USER: "
read DBUSER
echo "Enter Database PASS: "
read -sp DBPASS
#Directorio de instalacion
cd /tmp/
#Descarga del repo de CRMLiteManager
REPO="gmorales254/CRMLite-Manager"
GITHUB="https://api.github.com"
CRMLITEVERSION=`curl -sL -H "Authorization: token $TOKEN" -H "Accept: application/vnd.github.v3.raw" https://api.github.com/repos/$REPO/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d " "`
asset_id=`curl -s $GITHUB/repos/$REPO/releases -H "Authorization: token $TOKEN" -H "Accept: application/vnd.github.v3.raw" | jq ".[0].assets | map(select(.name == \"CRMLiteManager$CRMLITEVERSION.zip\"))[0].id"`
cd /tmp/
curl -fkSL# -o CRMLiteManager$CRMLITEVERSION.zip -H "Authorization: token $TOKEN" -H "Accept:application/octet-stream" $GITHUB/repos/$REPO/releases/assets/$asset_id
echo "Archivo descargado: CRMLiteManager$CRMLITEVERSION.zip"
unzip CRMLiteManager$CRMLITEVERSION.zip
printf '########################\n ## Archivo descomprimido, carpeta: CRMLiteManager ##\n'
CRMLITEVERSION=`curl -sL -H "Accept: application/vnd.github.v3.raw" https://api.github.com/repos/$REPO/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d " "`
asset_id=`curl -s $GITHUB/repos/$REPO/releases -H "Accept: application/vnd.github.v3.raw" | jq ".[0].assets | map(select(.name == \"CRMLite-Manager$CRMLITEVERSION.zip\"))[0].id"`
curl -fkSL# -o CRMLite-Manager$CRMLITEVERSION.zip -H "Accept:application/octet-stream" $GITHUB/repos/$REPO/releases/assets/$asset_id
echo "Archivo descargado: CRMLite-Manager$CRMLITEVERSION.zip"
unzip CRMLite-Manager$CRMLITEVERSION.zip
printf '########################\n ## Archivo descomprimido, carpeta: /tmp/CRMLite-Manager ##\n'

#Descarga del repo de CRMLite
REPO="gmorales254/CRMLite"
GITHUB="https://api.github.com"
CRMLITEVERSION=`curl -sL -H "Accept: application/vnd.github.v3.raw" https://api.github.com/repos/$REPO/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d " "`
asset_id=`curl -s $GITHUB/repos/$REPO/releases -H "Accept: application/vnd.github.v3.raw" | jq ".[0].assets | map(select(.name == \"CRMLite$CRMLITEVERSION.zip\"))[0].id"`
curl -fkSL# -o CRMLite$CRMLITEVERSION.zip -H "Accept:application/octet-stream" $GITHUB/repos/$REPO/releases/assets/$asset_id
echo "Archivo descargado: CRMLite$CRMLITEVERSION.zip"
unzip CRMLite$CRMLITEVERSION.zip
printf '########################\n ## Archivo descomprimido, carpeta: /tmp/CRMLiteBUILD ##\n'
# Mover todo a los lugares correspondientes
cp /tmp/CRMLite-Manager/CRMLiteManager /etc/IntegraServer/web/forms
cp /tmp/CRMLiteBUILD/CRMLite /etc/IntegraServer/web/forms
mysql -u $DBUSER -p$DBPASS -D "ccrepo" -f < '/tmp/CRMLite-Manager/DB/install.sql'
# Reportes
cp /tmp/CRMLite-Manager/REPORTS/* /etc/IntegraServer/reports
mysql -u $DBUSER -p$DBPASS -D "ccrepo" -f < '/tmp/CRMLite-Manager/REPORTS/install.sql'

0 comments on commit d272a8b

Please sign in to comment.