Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10.1 #1

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c4ca1fc
wip
Dec 18, 2016
552bfc8
be verbose about addons dir
Dec 21, 2016
2dd5356
remove odooku compat
Jan 17, 2017
aff5e04
update path of addons
xtornasol512 May 7, 2018
aaedcff
upgrade python version
vezino Apr 28, 2022
7f4e059
upgrade version from 2.7.12 to 2.7.18
vezino Apr 28, 2022
1568873
add some debug
vezino Apr 29, 2022
02fb128
more debuging
vezino Apr 29, 2022
f438482
debug message
vezino Apr 29, 2022
19d3f7e
change workspace runtimes
vezino Apr 29, 2022
05d9c98
verify pip install
vezino Apr 29, 2022
dd55d09
ensure pip installed
vezino Apr 29, 2022
519442c
verify pip installed
vezino Apr 29, 2022
a8fe80d
try install
vezino Apr 29, 2022
35b6a55
remove stuff
vezino Apr 29, 2022
e7f568f
set correct version
vezino Apr 29, 2022
982b017
update version
vezino Apr 29, 2022
c56fac6
check python version inside oddo install
vezino Apr 29, 2022
11f6bcd
remove commands
vezino Apr 29, 2022
75254cf
check pip installed
vezino Apr 29, 2022
3117e2c
install pip
vezino Apr 29, 2022
d99826f
check paths
vezino Apr 29, 2022
944f548
fix typo
vezino Apr 29, 2022
65ecdb7
remove pip install
vezino Apr 29, 2022
9689b6c
check pip
vezino Apr 29, 2022
2eb4ade
check where im i
vezino Apr 29, 2022
ecb767f
not sure where
vezino Apr 29, 2022
54254f1
what about not install python runtime?
vezino Apr 29, 2022
b27c2ad
find pip
vezino Apr 29, 2022
92f0dde
order code
vezino Apr 29, 2022
e89969a
find python
vezino Apr 29, 2022
f508138
remove build pack install manually
vezino Apr 29, 2022
7e71a8f
fix path
vezino Apr 29, 2022
39f4035
remove python
vezino Apr 29, 2022
212bde0
remove hardcode
vezino Apr 29, 2022
b618832
set pythonhome
vezino Apr 29, 2022
1277862
fix path
vezino Apr 29, 2022
d81bd32
check pip version
vezino Apr 29, 2022
165aef3
fix typo
vezino Apr 29, 2022
1adbb89
try another way
vezino Apr 29, 2022
63fbe1f
install python complements, not a new python only the missing pices
vezino Apr 29, 2022
fd484c2
install pip
vezino Apr 29, 2022
a5d0ef8
duuhhhh!
vezino Apr 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 35 additions & 42 deletions lib/steps/odoo-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,56 @@ GITHUB_URL="https://github.com"
ODOO_REPO=`$JQ -r .odoo.repo ./odooku.json`
ODOO_BRANCH=`$JQ -r .odoo.branch ./odooku.json`
ODOO_COMMIT=`$JQ -r .odoo.commit ./odooku.json`
PYTHONHOME="/app/.heroku/python/lib/python2.7"
PYTHONPATH="/app/.heroku/python/lib/python2.7"

if [ $ODOO_COMMIT == "null" ]; then
# Grab latest commit from github api
ODOO_COMMIT=`curl -s $GITHUB_API_URL/repos/$ODOO_REPO/commits/$ODOO_BRANCH 2> /dev/null | $JQ -r '.sha'`
puts-line "Using latest commit $ODOO_REPO (${ODOO_BRANCH}) @ (${ODOO_COMMIT})"
fi

COMPAT_REPO=`$JQ -r .compat.repo ./odooku.json`
COMPAT_BRANCH=`$JQ -r .compat.branch ./odooku.json`
COMPAT_COMMIT=`$JQ -r .compat.commit ./odooku.json`

if [ $COMPAT_COMMIT == "null" ]; then
# Grab latest commit from github api
COMPAT_COMMIT=`curl -s $GITHUB_API_URL/repos/$COMPAT_REPO/commits/$COMPAT_BRANCH 2> /dev/null | $JQ -r '.sha'`
puts-line "Using latest commit $COMPAT_REPO (${COMPAT_BRANCH}) @ (${COMPAT_COMMIT})"
fi

# Create final stack
STACK="{\"odoo\":{\"repo\": \"$ODOO_REPO\", \"branch\": \"$ODOO_BRANCH\", \"commit\": \"$ODOO_COMMIT\"},\"compat\": {\"repo\": \"$COMPAT_REPO\", \"branch\": \"$COMPAT_BRANCH\", \"commit\": \"$COMPAT_COMMIT\"}}"
STACK="{\"odoo\":{\"repo\": \"$ODOO_REPO\", \"branch\": \"$ODOO_BRANCH\", \"commit\": \"$ODOO_COMMIT\"}}"

# See if anything has chanfed
if [ ! -f ".heroku/odoo/stack/odooku.json" ] || [ `echo $STACK | $JQ -cS .` != `$JQ -cS . .heroku/odoo/stack/odooku.json` ] || [ -d "./patch" ]; then
# See if anything has changed
if [ ! -f ".heroku/odoo/stack.json" ] || [ `echo $STACK | $JQ -cS .` != `$JQ -cS . .heroku/odoo/stack.json` ]; then

puts-line "New Odoo installation detected"
ODOO_ARCHIVE="$GITHUB_URL/$ODOO_REPO/archive/$ODOO_COMMIT.tar.gz"
COMPAT_ARCHIVE="$GITHUB_URL/$COMPAT_REPO/archive/$COMPAT_COMMIT.tar.gz"

mkdir ./odoo_tmp ./compat_tmp
mkdir ./odoo_tmp
puts-line "Fetching $ODOO_REPO (${ODOO_BRANCH}) @ (${ODOO_COMMIT})"
curl -sL $ODOO_ARCHIVE 2> /dev/null | tar xz -C ./odoo_tmp --strip 1
puts-line "Fetching $COMPAT_REPO (${COMPAT_BRANCH}) @ (${COMPAT_COMMIT})"
curl -sL $COMPAT_ARCHIVE 2> /dev/null | tar xz -C ./compat_tmp --strip 1

puts-step "Installing Odoo"
puts-line "Applying Odooku patches"
cp -a ./compat_tmp/patch/. ./odoo_tmp/
if [ -d "./patch" ]; then
puts-line "Applying patches in ./patch"
cp -a ./patch/. ./odoo_tmp/
fi

puts-line "Running Odooku runtime setup.py"
pip install --upgrade --no-dependencies --src=./.heroku/src --disable-pip-version-check --no-cache-dir ./compat_tmp/runtime 2>&1 | tee $WARNINGS_LOG | cleanup-pip-output | indent
puts-line "Check python version"
python --version

puts-line "Check python path"
puts-line $PYTHONPATH

puts-line "Check python home"
puts-line $PYTHONHOME

puts-line "Find python"
find . -name python

puts-line "Check where im I"
pwd
ls -la

puts-line "find pip"
find . -name pip
puts-line "pip version"
python -m pip --version

puts-line "Running Odoo setup.py"
pip install --upgrade --no-dependencies --src=./.heroku/src --disable-pip-version-check --no-cache-dir ./odoo_tmp 2>&1 | tee $WARNINGS_LOG | cleanup-pip-output | indent
rm -rf .heroku/odoo/addons .heroku/odoo/compat_addons &> /dev/null || true
rm -rf .heroku/odoo/addons &> /dev/null || true
mv ./odoo_tmp/addons .heroku/odoo/addons
mv ./compat_tmp/addons .heroku/odoo/compat_addons

# Keep stack
mkdir -p .heroku/odoo/stack
echo $STACK > .heroku/odoo/stack/odooku.json

# Move over requirements, unless they are already provided by the app
if [ ! -f "./compat_requirements.txt" ]; then
cp ./compat_tmp/requirements.txt ./compat_requirements.txt
else
puts-line "Detected custom compat_requirements.txt"
fi
echo $STACK > .heroku/odoo/stack.json

if [ ! -f "./odoo_requirements.txt" ]; then
cp ./odoo_tmp/requirements.txt ./odoo_requirements.txt
Expand All @@ -73,16 +64,18 @@ if [ ! -f ".heroku/odoo/stack/odooku.json" ] || [ `echo $STACK | $JQ -cS .` != `
fi

# Cleanup
rm -rf ./odoo_tmp ./compat_tmp
rm -rf ./odoo_tmp
else
puts-line "Odoo installation is up to date"
fi

# Export additional requirements
export REQUIREMENTS="$REQUIREMENTS odoo_requirements.txt compat_requirements.txt"
export REQUIREMENTS="$REQUIREMENTS odoo_requirements.txt"

# Export addon locations
export ODOOKU_ADDONS="$HOME/.heroku/odoo/lib/python2.7/site-packages/openerp/addons,$HOME/.heroku/odoo/compat_addons,$HOME/.heroku/odoo/addons"
export ODOOKU_ADDONS="$HOME/.heroku/odoo/lib/python2.7/site-packages/odoo/addons,$HOME/.heroku/odoo/addons"
if [ -d "./addons" ]; then
export ODOOKU_ADDONS="$ODOOKU_ADDONS,$HOME/addons"
puts-line "Detected addons directory"
# add custom module paths here
export ODOOKU_ADDONS="$ODOOKU_ADDONS,$HOME/addons,$HOME/addons/vittal_odoo_modules"
fi
53 changes: 47 additions & 6 deletions lib/steps/runtimes/python
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
#!/usr/bin/env bash
ARCHIVE="https://odooku.s3.amazonaws.com/runtimes/python-2.7.12.tar.gz"
#ARCHIVE="https://odooku.s3.amazonaws.com/runtimes/python-2.7.12.tar.gz"
ARCHIVE="https://www.python.org/ftp/python/2.7.17/Python-2.7.17.tgz"

if [ ! -f ".heroku/odoo/bin/python" ]; then
puts-step "Bootstrapping python"
mkdir -p .heroku/odoo
curl -s $ARCHIVE 2> /dev/null | tar zxv -C .heroku/odoo &> /dev/null
fi
puts-line "Inside runtimes/python"


# if [ ! -f ".heroku/odoo/bin/python" ]; then
# puts-step "Bootstrapping python"
# mkdir -p .heroku/odoo
# curl -s $ARCHIVE 2> /dev/null | tar zxv -C .heroku/odoo &> /dev/null
# ls -la
# pwd
# puts-line "After curl python"
# python --version
# #python -m ensurepip --upgrade
# #pip --version
# fi


#!/usr/bin/env bash
# Build Path: /app/.heroku/odoo/

# OUT_PREFIX=$1

# PYTHON_VERSION=2.7.17

# echo "-----> Building Python ${PYTHON_VERSION}"
# curl -L https://python.org/ftp/python/2.7.17/Python-${PYTHON_VERSION}.tgz | tar xz
# pushd Python-${PYTHON_VERSION}
# ./configure --prefix=${OUT_PREFIX}
# make -s
# make install -s
# popd

# PYTHONHOME=${OUT_PREFIX} ${OUT_PREFIX}/bin/python -m ensurepip

puts-step "Bootstrapping python - pip"
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
pwd
ls -la
puts-step "Install pip"
python -m get-pip.py

puts-step "Proof pip"
find . -name pip

puts-step "pip version"
pip --version
4 changes: 2 additions & 2 deletions workspace/runtimes/python-2.7.12 → workspace/runtimes/python-2.7.17
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

OUT_PREFIX=$1

PYTHON_VERSION=2.7.12
PYTHON_VERSION=2.7.17

echo "-----> Building Python ${PYTHON_VERSION}"
curl -L https://python.org/ftp/python/2.7.12/Python-${PYTHON_VERSION}.tgz | tar xz
curl -L https://python.org/ftp/python/2.7.17/Python-${PYTHON_VERSION}.tgz | tar xz
pushd Python-${PYTHON_VERSION}
./configure --prefix=${OUT_PREFIX}
make -s
Expand Down