Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e
- # instalar apache2 y git
- apt update && apt install apache2 git -y
- # clonar repositorio via https
- git clone https://gitlab.com/sergio.pernas1/dashboard.git /app
- # Definir en que rama se debe desplegar al aplicacion
- # ${BRANCHAPP:-main} si la variable esta vacia porque no se definio al momento de lanzar el contenedor
- # entonces se rellna con la cadena 'main' para evitar el error de operador unario de bash a la hora
- # de evaluar la condicion.
- if [ $BRANCHAPP == 'main' ];then
- cd /app && git checkout main
- elif [ $BRANCHAPP == 'testing' ];then
- cd /app && git checkout testing
- elif [ $BRANCHAPP == 'develop' ];then
- cd /app && git checkout develop
- else
- echo "se debe indicar la rama -v BRANCHAPP=main|testing|develop"
- exit 1
- if
- cp /app/apache2.conf /etc/apache2/apache2.conf
- cp /app/000-default.conf /etc/apache2/sites-available/
- exec $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement