Skip to content

Commit

Permalink
termux.0-to-hero,automated-test (#1, #3): added clone & commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed May 9, 2019
1 parent 167cc37 commit 5002703
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions termux/0-a-heroi/teste-completo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
# OPTIONS: ---
# REQUIREMENTS: Android 5.0+
# Termux (https://termux.com/)
# curl (pkg install curl)
# curl, use comando:
# apt update && apt -y upgrade && pkg install -y curl
#
# Para baixar este arquivo, uma forma e' o seguinte comando
# curl https://raw.githubusercontent.com/EticaAI/eticaai-shell-scripts/master/termux/0-a-heroi/teste-completo.sh -o teste-completo.sh
#
# BUGS: ---
# NOTES: ---
# AUTHOR: Emerson Rocha, [email protected]
Expand All @@ -26,6 +31,13 @@
# REVISION: ---
#===============================================================================

# A linha a seguir indica que erros inesperados devem falhar imediatamente este
# script.
set -e

TEST_AUTOMATIC_REPO_URL="[email protected]:eticaaibot/0-a-heroi-teste.git"
TEST_AUTOMATIC_REPO_FOLDER="0-a-heroi-teste"

### Geracao do par de chave de eticaaibot (feita num Linux Ubuntu)
## ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Destino, private key /alligo/code/eticaai/eticaai-shell-scripts/temp/id_rsa-eticaaibot
Expand Down Expand Up @@ -85,6 +97,41 @@ else
fi
### TESTE SE VARIAVEIS DE AMBIENTE FORAM DEFINIDAS, fim

echo "Criando diretorio "
echo ">>> Criando diretorio $SSL_LOCAL_FOLDER"
mkdir $SSL_LOCAL_FOLDER
curl http://example.com --output $TEST_PRIVATEKEY_LOCALFILE

echo ">>> Importando chave privada padrao"
curl $TEST_PRIVATEKEY --output $TEST_PRIVATEKEY_LOCALFILE

echo ">>> Instalando todas as dependencias de passo a passo 0-a-heroi.sh"
apt update
apt -y upgrade
pkg install -y openssh
pkg install -y git

echo ">>> Testando se o GitHub acredita que podemos commitar..."
ssh -T [email protected]

echo ">>> Criando pasta ~/code/eticaai"
mkdir -p "~/code/eticaai"

echo ">>> entrando na pasta ~/code/eticaai"
cd ~/code/eticaai

echo ">>> clonando $TEST_AUTOMATIC_COMMIT"
git clone $TEST_AUTOMATIC_REPO_URL
cd $TEST_AUTOMATIC_REPO_FOLDER

echo ">>> criando mudanca num arquivo"
echo date >> teste-commit.txt

echo ">>> git add ."
git add .

echo ">>> git commit -m date"
git commit -m date

echo ">>> git push"
git push

echo "FIM DE teste-completo.sh"

0 comments on commit 5002703

Please sign in to comment.