Skip to content
Snippets Groups Projects
Select Git revision
  • d9adab8a52a0afaef19bc6e1d31f6af36eab86e8
  • master default protected
  • ci
  • co
  • dev
  • legacy-v2
  • legacy
7 results

.htaccess

Blame
  • bootstrap.sh 1.02 KiB
    #!/usr/bin/env bash
    
    ########################### Virtualenv setup ####################################
    
    echo ansible > requirements.python.txt
    
    # check existance of virtualenv command
    if ! command -v virtualenv &>/dev/null; then
      echo "This command needs virtualenv to run."
      echo "Install it like this:"
      printf "\tapt install python3-venv\n"
      printf "\tOR pip3 install --user virtualenv\n"
      printf "\texport PATH=\"~/.local/bin:\$PATH\"\n"
      exit 1
    fi
    
    # if not in virtualenv
    if [[ "$VIRTUAL_ENV" == "" ]]; then
      # create virtualenv if not present
      [[ ! -d .venv ]] && python3 -m venv .venv
    
      source .venv/bin/activate
      pip install -r requirements.python.txt
    fi
    
    ########################### Ansible setup ####################################
    ansible-galaxy install -r requirements.galaxy.yml
    
    ########################### Help to ${dummies:Mike} ####################################
    
    echo
    echo "Run playbook with:"
    printf "\tansible-playbook -i inventory.yaml what_is.yml"
    echo
    
    # to stay in our comfy virtualenv
    exec "${SHELL:bash}"