[IMP] Add Github authentication validations

Before this addition you would only have one chance to fill in the Github credentials.
If they where wrong the script would fail on a lot of the remaining steps, you would need to run the script and you might even get issues because of already used commands.
This commit adds the response from Github to check if the credentials are valid are not.
In case they're invalid we'll ask them again (untill they're correct) and we'll show a warning to the user that they where invalid or that the user does not have enough rights on the Github repository.
If they succeed we'll clone the enterprise repository and continue.
pull/45/head
Yenthe V.G 9 years ago committed by GitHub
parent 9a3f129688
commit 582ecdaba7

@ -115,9 +115,18 @@ if [ $IS_ENTERPRISE = "True" ]; then
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" sudo su $OE_USER -c "mkdir $OE_HOME/enterprise"
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons"
echo -e "\n---- Adding Enterprise code under $OE_HOME/enterprise/addons ----" GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do
echo "------------------------WARNING------------------------------"
echo "Your authentication with Github has failed! Please try again."
printf "In order to clone and install the Odoo enterprise version you \nneed to be an offical Odoo partner and you need access to\nhttp://github.com/odoo/enterprise.\n"
echo "TIP: Press ctrl+c to stop this script."
echo "-------------------------------------------------------------"
echo " "
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
done
echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----"
echo -e "\n---- Installing Enterprise specific libraries ----" echo -e "\n---- Installing Enterprise specific libraries ----"
sudo apt-get install nodejs npm sudo apt-get install nodejs npm
sudo npm install -g less sudo npm install -g less

Loading…
Cancel
Save