Advertisement
sergio_educacionit

entrypoint.sh

Dec 2nd, 2023 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # set -e
  4.  
  5. # Evaluar si el comando ping existe, de lo contrario se instala.
  6.  
  7.  
  8. apt update && apt install apache2 git -y
  9.  
  10. deploy_app () {
  11.  
  12. cd /web-app && git pull
  13. cp -v -r /web-app/album/* /var/www/html
  14.  
  15. }
  16.  
  17.  
  18. # Si el directorio '/web-app' no existe
  19. # clonarlo
  20.  
  21. if ! test -d /web-app; then
  22.  
  23. git clone https://gitlab.com/sergio.pernas2/web-app.git /web-app
  24.  
  25. deploy_app
  26. else
  27.  
  28. # Si el repositorio ya se ha cloando
  29. # traer posibles cambios de la rama main
  30.  
  31. deploy_app
  32. fi
  33.  
  34.  
  35.  
  36.  
  37.  
  38. exec "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement