Advertisement
Sergio_Istea

entrypoint.sh

Nov 28th, 2023
1,685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 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 /web-app/* /var/www/html
  14.  
  15.  
  16. }
  17.  
  18.  
  19. # Si el directorio '/web-app' no existe
  20. # clonarlo
  21.  
  22. if ! test -d /web-app; then
  23.  
  24.     git clone https://gitlab.com/sergio.pernas1/web-app.git /web-app
  25.  
  26.     deploy_app
  27. else
  28.  
  29.     # Si el repositorio ya se ha cloando
  30.     # traer posibles cambios de la rama main
  31.  
  32.     deploy_app
  33. fi
  34.  
  35.  
  36.  
  37.  
  38.  
  39. exec "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement