Last active
September 12, 2018 20:49
-
-
Save rodrigolck/3845ddefa0b398db05001cf084753571 to your computer and use it in GitHub Desktop.
Installer file for tic_tac_toe_api project made for UFSCAR 2018
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
#!/bin/bash | |
sudo apt install -y curl | |
# Adiciona o Repo do Docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# Adiciona node 8.X | |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
# Executar para Mint 18.3 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" | |
# Atualizando pacotes | |
sudo apt update -y | |
sudo apt install -f -y | |
# Instalando libs | |
sudo apt install -y git meld libcurl3-dev apt-transport-https ca-certificates software-properties-common nodejs build-essential libncurses5-dev openssl libssl-dev fop xsltproc unixodbc-dev | |
# Importa o GITAWARE, para tornar mais facil a visualizacao de qual branch a atual | |
cd | |
git clone git://github.com/jimeh/git-aware-prompt.git .bash/git-aware-prompt | |
echo export GITAWAREPROMPT='~/.bash/git-aware-prompt' >> ~/.bashrc | |
echo 'source "${GITAWAREPROMPT}/main.sh"' >> ~/.bashrc | |
echo 'export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "' >> ~/.bashrc | |
# Instalar RVM em conjunto com Ruby, Rails e Bundler | |
gpg2 --keyserver hkp://keys.gnupg.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
# Se esta linha abaixo der erro, deve ser provavelmente por causa do OpenSSL, assim será preciso utilizar a versão 1.0 | |
\curl -sSL https://get.rvm.io | bash -s stable --ruby | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc | |
source ~/.bashrc | |
gem install bundler | |
# Plugin para ajudar a ver o diff | |
echo '#!/usr/bin/python' > ~/diff.py | |
echo -e "\nimport sys\nimport os\n\nos.system('meld \"%s\" \"%s\"' % (sys.argv[2], sys.argv[5]))" >> ~/diff.py | |
git config --global diff.external ~/diff.py | |
chmod +x ~/diff.py | |
# Instalando Docker | |
# WARNING: Se estiver no ubuntu: https://linuxconfig.org/how-to-install-docker-on-ubuntu-18-04-bionic-beaver | |
# sudo echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic nightly" > /etc/apt/sources.list.d/docker.list | |
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# sudo apt update | |
sudo apt-get remove docker docker-engine docker.io -y | |
sudo apt-get install docker-ce -y | |
# Adiciona o usuário corrente no grupo Docker para não precisar usar o sudo (na próxima sessão) | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
# Habilita o Docker na inicialização do sistema | |
sudo systemctl enable docker | |
# Instalando Container Mongo | |
sudo docker run -p 27017:27017 --name mongo-3 -v ~/docker-mongo-3-data:/data/db -d mongo:3.4 | |
sudo docker run -d --name kong-database --net="host" -e "POSTGRES_USER=kong" -e "POSTGRES_DB=kong" postgres:9.5 | |
sudo docker run --rm --net="host" -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=localhost" kong kong migrations up | |
sudo docker run -d --name kong --net="host" -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=localhost" -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \ | |
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" -e "KONG_PROXY_ERROR_LOG=/dev/stderr" -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \ | |
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001" -e "KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444" kong | |
echo '#!/bin/bash' > ~/start_docker.sh | |
echo 'docker start mongo-3 kong-database kong' > ~/start_docker.sh | |
cd | |
mkdir Workspace | |
cd Workspace | |
git clone https://github.com/pantsel/konga.git | |
cd konga | |
npm i | |
npm start | |
# login: admin | password: adminadminadmin | |
# Install Erlang OTP | |
cd /tmp | |
curl -L http://www.erlang.org/download/otp_src_20.3.tar.gz | tar xz | |
cd otp_src_20.3/ | |
./configure | |
make | |
sudo make install | |
# Install Elixir | |
cd /tmp | |
git clone https://github.com/elixir-lang/elixir.git | |
cd elixir | |
git checkout v1.6 | |
make clean test | |
sudo make install | |
sudo chmod 755 -R /usr/local/lib/elixir/bin/ | |
# Install Phoenix | |
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment