Skip to content

Commit 582ecda

Browse files
authored
[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.
1 parent 9a3f129 commit 582ecda

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

odoo_install.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
6262
#--------------------------------------------------
6363
echo -e "\n---- Install tool packages ----"
6464
sudo apt-get install wget git python-pip gdebi-core -y
65-
65+
6666
echo -e "\n---- Install python packages ----"
6767
sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y python-suds
68-
68+
6969
echo -e "\n---- Install python libraries ----"
7070
sudo pip install gdata psycogreen ofxparse XlsxWriter xlrd
7171

@@ -92,7 +92,7 @@ if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
9292
else
9393
echo "Wkhtmltopdf isn't installed due to the choice of the user!"
9494
fi
95-
95+
9696
echo -e "\n---- Create ODOO system user ----"
9797
sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER
9898
#The user should also be added to the sudo'ers group.
@@ -115,9 +115,18 @@ if [ $IS_ENTERPRISE = "True" ]; then
115115
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise"
116116
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons"
117117

118-
echo -e "\n---- Adding Enterprise code under $OE_HOME/enterprise/addons ----"
119-
sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons"
118+
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
119+
while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do
120+
echo "------------------------WARNING------------------------------"
121+
echo "Your authentication with Github has failed! Please try again."
122+
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"
123+
echo "TIP: Press ctrl+c to stop this script."
124+
echo "-------------------------------------------------------------"
125+
echo " "
126+
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
127+
done
120128

129+
echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----"
121130
echo -e "\n---- Installing Enterprise specific libraries ----"
122131
sudo apt-get install nodejs npm
123132
sudo npm install -g less

0 commit comments

Comments
 (0)