Advertisement
yuma2020

deploy.npm.sh

Aug 1st, 2019
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.62 KB | None | 0 0
  1. #!/bin/sh
  2. # File: Frontear
  3.  
  4. # Variables del script
  5. _hoy=$(date +"%m_%d_%Y_%r_%S")
  6. _pwd=$(pwd)
  7. _permisos=$(ls -la *)
  8. # destino=$_pwd/build/bundel.js
  9. # origen=$_pwd/animejs/app-main.js
  10. CFG_FILE=$_pwd/config.ini
  11. $fileconfig=$CFG_FILE
  12.  
  13. crear_config(){
  14. echo '
  15. origen='$_pwd'/animejs/app-main.js
  16. destino='$_pwd'/build/bundel.js
  17. ' > $fileconfig
  18. }
  19.  
  20. check_config() {
  21. if [ ! -e "$fileconfig" ];
  22. then
  23.     echo "File '$fileconfig' does not exist"
  24.     echo "Al parecer no existe este archivo"
  25.     echo "El archivo '$fileconfig' no existe".    " [ ".$_hoy." ]" >> $logger
  26.         crear_config
  27.     echo "configdata deploy work created".             "[".$_hoy."]"
  28.  
  29. else
  30.     echo "Data is exist in '$fileconfig' folder". " [ ".$_hoy." ]"
  31.     echo "Data '$fileconfig' deploy is existed  OK ". " [ "$_hoy" ]" >> $logger
  32.     echo 'Listo todo esta instalado y listo para desplegar'
  33. fi
  34. }
  35. check_config
  36.  
  37. preparar_config(){
  38.  
  39. ORIGEN=$(awk -F "=" '/origen/ {print $2}' "$CFG_FILE")
  40. DESTINO=$(awk -F "=" '/destino/ {print $2}' "$CFG_FILE")
  41.  
  42. echo "Che! este es tu Servidor: "$ORIGEN""
  43. echo "Aquí esta tu Puerto: "$DESTINO""
  44.  
  45. }
  46. preparar_config
  47.  
  48. # Agregada una decoración que me gusta mucho:
  49. PrintLogData(){
  50. cat <<EOF
  51.  
  52.  ✔ Esto es una herramienta de despliegue
  53.  ✔ Su version primitiva esta diseñada
  54.   para brindar apoyo a desempaquetar
  55.   Webpack en su computadora.
  56.  Requisitos:
  57.  🛃 NPM instalado
  58.  🛃 NODE JS instalado
  59.  ❗ En caso de no disponer por favor instala
  60.   esos complementos en el sistema y
  61.   reintentalo
  62.  
  63. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  64. ░░████░████░███████░░░░░░░░░░░░░░░░░░░░░
  65. ░░█▒░█░█░░█░█░░█░░█░░░░░░░░░░░░░░░░░░░░░
  66. ░░█░░█▒████░█░░█░░█░░░░░░░░░░░░░░░░░░░░░
  67. ░░░░░░░█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  68. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  69.  
  70. Author  : Villalba Juan Manuel Pedro
  71. Email   : soporte@hexomedesarrollos.com
  72. Horarios: De 14 pm to 20pm Sat to Sun
  73. Website : www.hexomedesarrollos.com
  74.  
  75. EOF;
  76. }
  77. PrintLogData()
  78.  
  79. echo 'webpack '.$origien' .'$destino' -p' > production.sh
  80. echo ''webpack '.$origien' .'$destino' -d' > desarrollo.sh
  81. echo 'webpack-dev-server' >> desarrollo.sh
  82. chmod +x $_pwd/desarrollos.sh
  83. sh  $_pwd/desarrollos.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement