Last active
May 13, 2021 20:55
-
-
Save yagoernandes/7e446a6f3cd7d01a18f480b7277103e0 to your computer and use it in GitHub Desktop.
Terraformar virtualbox ubuntu 20.04 para executar os projetos da Denox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # (VIRTUALBOX) Adicionando dependencias (virtualbox ubuntu server 20.04) | |
| sudo add-apt-repository -y multiverse && | |
| sudo apt update && | |
| sudo apt install -y virtualbox-guest-dkms virtualbox-guest-x11 openssh-server && | |
| # Instala o cli da aws (necessário somente para subir o sistema) | |
| sudo apt install awscli -y && | |
| # (BACK) Instala as dependências | |
| sudo apt install build-essential -y && | |
| # Criando os diretórios padrão | |
| mkdir ~/denox && | |
| mkdir ~/workspaces && | |
| # (FRONT) Instalando o NVM (Node) | |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash && | |
| # (BACK) Instalando o Anaconda (Python) | |
| cd /tmp && | |
| curl https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh --output anaconda.sh && | |
| bash anaconda.sh -u && | |
| # Carregando arquivo do bash | |
| source ~/.bashrc && | |
| # (FRONT) Configurando o NVM | |
| nvm install 12.16.1 && | |
| npm i -g yarn && | |
| # (BACK) Criando os ambientes no Anaconda | |
| conda create --name py36 python=3.6 && | |
| conda create --name py27 python=2.7 && | |
| # Configurando o git | |
| cd ~/denox/ && | |
| git config --global credential.helper cache && | |
| git config --global credential.helper 'cache --timeout=28880' && | |
| git config --global user.name "Yago Ernandes" | |
| git config --global user.email "yagodourado@denox.com.br" | |
| # (FRONT) Baixando repositórios | |
| cd ~/denox/ && | |
| git clone https://git.denox.com.br/analytics/denox_pro_transporte.git && | |
| git clone https://git.denox.com.br/analytics/denox_pro_apvs.git && | |
| git clone https://git.denox.com.br/analytics/denox_pro_braskem.git && | |
| git clone https://git.denox.com.br/analytics/denox_pro_vale.git && | |
| git clone https://git.denox.com.br/analytics/denox_pro_porto_seguro.git && | |
| git clone https://git.denox.com.br/analytics/geo_analytics_v2.git && | |
| # (BACK) Baixando repositórios | |
| cd ~/denox/ && | |
| git clone https://git.denox.com.br/analytics/mxt_tools.git --recurse-submodules && | |
| git clone https://git.denox.com.br/analytics/mxt_api_geoanalytics.git --recurse-submodules && | |
| git clone https://git.denox.com.br/analytics/mxt_api_analytics.git --recurse-submodules && | |
| git clone https://git.denox.com.br/analytics/mxt_api_transporte.git --recurse-submodules && | |
| git clone https://git.denox.com.br/analytics/mxt_robo_furto_roubo.git --recurse-submodules && | |
| git clone https://git.denox.com.br/analytics/mxt_api_vale.git --recurse-submodule && | |
| git clone https://git.denox.com.br/analytics/mxt_robo_transporte.git --recurse-submodules && | |
| # (VIRTUALBOX) Configurando SSH | |
| cd ~/.ssh && | |
| ssh-keygen && | |
| sudo service ssh restart && | |
| # (BACK) Instalando dependencias no ambiente virtual 2.7 | |
| conda activate py27 && | |
| cd ~/denox/mxt_tools/src/ && | |
| pip install -r requirements_2.txt && | |
| cd ~/denox/mxt_tools/src/boilerplate && | |
| python setup_mxt_tools.py develop && | |
| cd ~/denox/mxt_api_analytics/mxt_api_analytics/ && | |
| pip install -r requirements2.txt && | |
| conda deactivate && | |
| # (BACK) Instalando dependencias no ambiente virtual 3.6 | |
| conda activate py36 && | |
| cd ~/denox/mxt_tools/src/ && | |
| pip install -r requirements.txt && | |
| cd ~/denox/mxt_tools/src/boilerplate_3/ && | |
| python setup_mxt_tools3.py develop && | |
| cd ~/denox/mxt_api_transporte/mxt_api_transporte/ && | |
| pip install -r requirements.txt && | |
| cd ~/denox/mxt_robo_transporte/mxt_robo_transporte/ && | |
| pip install -r requirements.txt && | |
| # (BACK) Instalando dependências que faltam | |
| pip install tornado aredis parse jsonpath_rw celery==4.3.0 PyJWT==1.6.4 motor && | |
| # (FRONT) Instalando as dependências dos projetos Node | |
| cd ~/denox/denox_pro_apvs && git checkout develop && yarn && | |
| cd ~/denox/denox_pro_braskem && git checkout develop && yarn && | |
| cd ~/denox/denox_pro_porto_seguro && git checkout develop && yarn && | |
| cd ~/denox/denox_pro_transporte && git checkout develop && yarn && | |
| cd ~/denox/denox_pro_vale && git checkout develop && yarn && | |
| cd ~/denox/geo_analytics_v2/frontend && git checkout develop && yarn && | |
| # Pede as credenciais da aws (região padrão: us-east-1) | |
| aws configure | |
| # (VIRTUALBOX) Desativando notificação do kernel linux para limite de espaço | |
| echo fs.inotify.max_user_watches=999999999 | sudo tee -a /etc/sysctl.conf && | |
| sudo sysctl --system && | |
| # (VIRTUALBOX) Reiniciando | |
| sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment