Skip to content

Commit

Permalink
Merge pull request #17 from Monogramm/develop
Browse files Browse the repository at this point in the history
🔖 v1.0.0
  • Loading branch information
madmath03 authored Nov 28, 2019
2 parents 1e968f0 + 171f6cf commit 90ea2c4
Show file tree
Hide file tree
Showing 56 changed files with 2,430 additions and 343 deletions.
82 changes: 82 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"globals": {
"frappe": true,
"__": true,
"_p": true,
"_f": true,
"repl": true,
"Class": true,
"locals": true,
"cint": true,
"cstr": true,
"cur_frm": true,
"cur_dialog": true,
"cur_page": true,
"cur_list": true,
"cur_tree": true,
"msg_dialog": true,
"is_null": true,
"in_list": true,
"has_common": true,
"has_words": true,
"validate_email": true,
"get_number_format": true,
"format_number": true,
"format_currency": true,
"comment_when": true,
"open_url_post": true,
"toTitle": true,
"lstrip": true,
"strip": true,
"strip_html": true,
"replace_all": true,
"flt": true,
"precision": true,
"CREATE": true,
"AMEND": true,
"CANCEL": true,
"copy_dict": true,
"get_number_format_info": true,
"print_table": true,
"Layout": true,
"web_form_settings": true,
"$c": true,
"$a": true,
"$i": true,
"$bg": true,
"$y": true,
"$c_obj": true,
"refresh_many": true,
"refresh_field": true,
"toggle_field": true,
"get_field_obj": true,
"get_query_params": true,
"unhide_field": true,
"hide_field": true,
"set_field_options": true,
"getCookie": true,
"getCookies": true,
"get_url_arg": true,
"md5": true,
"$": true,
"jQuery": true,
"moment": true,
"hljs": true,
"Awesomplete": true,
"Sortable": true,
"Showdown": true,
"Taggle": true,
"Gantt": true,
"Slick": true,
"Webcam": true,
"PhotoSwipe": true,
"PhotoSwipeUI_Default": true,
"fluxify": true,
"io": true,
"QUnit": true,
"JsBarcode": true,
"L": true,
"Chart": true,
"DataTable": true
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.egg-info
*.swp
tags
node_modules
erpnext_ocr/docs/current
*.iml
*.xml
*.xml
*.prof
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ branches:

before_script:
- env | sort
- dir="test"
- home=$(pwd)
- dir=".travis"
- export IMAGE_NAME=docker-erpnext-ext:erpnext_ocr-travis
- export BUILD_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}
- export BUILD_URL=https://github.com/${TRAVIS_PULL_REQUEST_SLUG:-${TRAVIS_REPO_SLUG}}
Expand Down Expand Up @@ -42,7 +43,7 @@ script:
- docker-compose -f docker-compose.${DATABASE}.yml ps "erpnext_app" | grep "Up"
- docker-compose -f docker-compose.${DATABASE}.yml logs "erpnext_web"
- docker-compose -f docker-compose.${DATABASE}.yml ps "erpnext_web" | grep "Up"
- echo 'Wait until test finished (1-2 minutes)' && sleep 90
- echo 'Wait until test finished (3 minutes)' && sleep 180
- docker-compose -f docker-compose.${DATABASE}.yml logs "sut"
- docker-compose -f docker-compose.${DATABASE}.yml ps "sut" | grep "Exit 0"
# Test container restart
Expand All @@ -55,10 +56,15 @@ script:
- docker-compose -f docker-compose.${DATABASE}.yml ps "erpnext_app" | grep "Up"
- docker-compose -f docker-compose.${DATABASE}.yml logs "erpnext_web"
- docker-compose -f docker-compose.${DATABASE}.yml ps "erpnext_web" | grep "Up"
- echo 'Wait until test finished (1-2 minutes)' && sleep 90
- echo 'Wait until test finished (3 minutes)' && sleep 180
- docker-compose -f docker-compose.${DATABASE}.yml logs "sut"
- docker-compose -f docker-compose.${DATABASE}.yml ps "sut" | grep "Exit 0"

#after_script:
# - cd "$home"
# - sudo pip install python-coveralls
# - coveralls -b "$home" -d /srv/erpnext/frappe/sites/.coverage

notifications:
email: false

Expand Down
File renamed without changes.
File renamed without changes.
25 changes: 12 additions & 13 deletions test/Dockerfile.alpine → .travis/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
FROM monogramm/docker-erpnext:%%VERSION%%-alpine

RUN set -ex; \
sudo apk add --update \
chromium \
chromium-chromedriver \
;

# Build environment variables
ENV DOCKER_TAG=travis \
DOCKER_VCS_REF=${TRAVIS_COMMIT} \
DOCKER_BUILD_DATE=${TRAVIS_BUILD_NUMBER}
DOCKER_BUILD_DATE=${TRAVIS_BUILD_NUMBER} \
LANG=C.UTF-8 \
LC_ALL=C

# Copy the whole repository to app folder for manual install
#COPY --chown=frappe:frappe . "/home/$FRAPPE_USER"/frappe-bench/apps/erpnext_ocr
Expand All @@ -17,6 +25,9 @@ RUN set -ex; \
imagemagick \
imagemagick-dev \
tesseract-ocr \
tesseract-ocr-dev \
leptonica \
pkgconfig \
; \
sudo sed -i \
-e 's/rights="none" pattern="PDF"/rights="read" pattern="PDF"/g' \
Expand All @@ -29,15 +40,3 @@ RUN set -ex; \
"/home/$FRAPPE_USER"/frappe-bench/logs/* \
; \
bench get-app --branch ${BUILD_BRANCH} ${BUILD_URL}
#echo "Manually installing app for CI (not needed normally)"; \
#./env/bin/pip install -q -e "apps/erpnext_ocr" --no-cache-dir; \
#test ! "$FRAPPE_BRANCH" = "v10.x.x" \
# && ./env/bin/pip3 install -q -e "apps/erpnext_ocr" --no-cache-dir \
# && bench build --app erpnext_ocr \
#; \
#sudo mkdir -p "${FRAPPE_WD}/sites"; \
#sudo touch "${FRAPPE_WD}/sites/apps.txt"; \
#sudo chown $FRAPPE_USER:$FRAPPE_USER "${FRAPPE_WD}/sites/apps.txt"; \
#echo "frappe" > "${FRAPPE_WD}/sites/apps.txt"; \
#echo "erpnext" >> "${FRAPPE_WD}/sites/apps.txt"; \
#echo "erpnext_ocr" >> "${FRAPPE_WD}/sites/apps.txt"
32 changes: 20 additions & 12 deletions test/Dockerfile.debian → .travis/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
FROM monogramm/docker-erpnext:%%VERSION%%-debian

# Install Google Chrome & Chrome WebDriver for UI tests
RUN set -ex; \
sudo apt-get update -q; \
sudo apt-get install -y --no-install-recommends \
unzip \
; \
CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`; \
sudo mkdir -p /opt/chromedriver-$CHROMEDRIVER_VERSION; \
sudo curl -sS -o /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip; \
sudo unzip -qq /tmp/chromedriver_linux64.zip -d /opt/chromedriver-$CHROMEDRIVER_VERSION; \
sudo rm /tmp/chromedriver_linux64.zip; \
sudo chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver; \
sudo ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver; \
export PATH="$PATH;/usr/local/bin/chromedriver"

# Build environment variables
ENV DOCKER_TAG=travis \
DOCKER_VCS_REF=${TRAVIS_COMMIT} \
Expand All @@ -16,8 +31,13 @@ RUN set -ex; \
sudo apt-get install -y --no-install-recommends \
ghostscript \
imagemagick \
libmagickwand-dev \
tesseract-ocr \
libtesseract-dev \
libleptonica-dev \
pkg-config \
; \
sudo rm -rf /var/lib/apt/lists/*; \
sudo sed -i \
-e 's/rights="none" pattern="PDF"/rights="read" pattern="PDF"/g' \
/etc/ImageMagick*/policy.xml \
Expand All @@ -29,15 +49,3 @@ RUN set -ex; \
"/home/$FRAPPE_USER"/frappe-bench/logs/* \
; \
bench get-app --branch ${BUILD_BRANCH} ${BUILD_URL}
#echo "Manually installing app for CI (not needed normally)"; \
#./env/bin/pip install -q -e "apps/erpnext_ocr" --no-cache-dir; \
#test ! "$FRAPPE_BRANCH" = "v10.x.x" \
# && ./env/bin/pip3 install -q -e "apps/erpnext_ocr" --no-cache-dir \
# && bench build --app erpnext_ocr \
#; \
#sudo mkdir -p "${FRAPPE_WD}/sites"; \
#sudo touch "${FRAPPE_WD}/sites/apps.txt"; \
#sudo chown $FRAPPE_USER:$FRAPPE_USER "${FRAPPE_WD}/sites/apps.txt"; \
#echo "frappe" > "${FRAPPE_WD}/sites/apps.txt"; \
#echo "erpnext" >> "${FRAPPE_WD}/sites/apps.txt"; \
#echo "erpnext_ocr" >> "${FRAPPE_WD}/sites/apps.txt"
33 changes: 20 additions & 13 deletions test/Dockerfile.debian-slim → .travis/Dockerfile.debian-slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
FROM monogramm/docker-erpnext:%%VERSION%%-debian-slim

# Install Google Chrome & Chrome WebDriver for UI tests
RUN set -ex; \
sudo apt-get update -q; \
sudo apt-get install -y --no-install-recommends \
iputils-ping \
unzip \
; \
CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`; \
sudo mkdir -p /opt/chromedriver-$CHROMEDRIVER_VERSION; \
sudo curl -sS -o /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip; \
sudo unzip -qq /tmp/chromedriver_linux64.zip -d /opt/chromedriver-$CHROMEDRIVER_VERSION; \
sudo rm /tmp/chromedriver_linux64.zip; \
sudo chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver; \
sudo ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver; \
export PATH="$PATH;/usr/local/bin/chromedriver"

# Build environment variables
ENV DOCKER_TAG=travis \
DOCKER_VCS_REF=${TRAVIS_COMMIT} \
Expand All @@ -17,8 +33,11 @@ RUN set -ex; \
ghostscript \
imagemagick \
tesseract-ocr \
iputils-ping \
libtesseract-dev \
libleptonica-dev \
pkg-config \
; \
sudo rm -rf /var/lib/apt/lists/*; \
sudo sed -i \
-e 's/rights="none" pattern="PDF"/rights="read" pattern="PDF"/g' \
/etc/ImageMagick*/policy.xml \
Expand All @@ -30,15 +49,3 @@ RUN set -ex; \
"/home/$FRAPPE_USER"/frappe-bench/logs/* \
; \
bench get-app --branch ${BUILD_BRANCH} ${BUILD_URL}
#echo "Manually installing app for CI (not needed normally)"; \
#./env/bin/pip install -q -e "apps/erpnext_ocr" --no-cache-dir; \
#test ! "$FRAPPE_BRANCH" = "v10.x.x" \
# && ./env/bin/pip3 install -q -e "apps/erpnext_ocr" --no-cache-dir \
# && bench build --app erpnext_ocr \
#; \
#sudo mkdir -p "${FRAPPE_WD}/sites"; \
#sudo touch "${FRAPPE_WD}/sites/apps.txt"; \
#sudo chown $FRAPPE_USER:$FRAPPE_USER "${FRAPPE_WD}/sites/apps.txt"; \
#echo "frappe" > "${FRAPPE_WD}/sites/apps.txt"; \
#echo "erpnext" >> "${FRAPPE_WD}/sites/apps.txt"; \
#echo "erpnext_ocr" >> "${FRAPPE_WD}/sites/apps.txt"
22 changes: 22 additions & 0 deletions .travis/Dockerfile_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM %%IMAGE_NAME%%

ADD docker_test.sh /docker_test.sh

RUN set -ex; \
sudo chmod 755 /docker_test.sh; \
sudo pip install python-coveralls

EXPOSE 4444

# Default Chrome configuration
ENV DISPLAY=:20.0 \
SCREEN_GEOMETRY="1440x900x24" \
CHROMEDRIVER_PORT=4444 \
CHROMEDRIVER_WHITELISTED_IPS="127.0.0.1" \
CHROMEDRIVER_URL_BASE='' \
CHROMEDRIVER_EXTRA_ARGS=''

# Test environment variables
ENV TEST_VERSION=${TEST_VERSION}

CMD ["/docker_test.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ services:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
- DOCKER_DEBUG=1
# Test setup
- TEST_VERSION=${VERSION}
- TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID}
- TRAVIS_BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}
- TRAVIS_BUILD_WEB_URL=${TRAVIS_BUILD_WEB_URL}
- TRAVIS_COMMIT=${TRAVIS_COMMIT}
- TRAVIS_COMMIT_MESSAGE=${TRAVIS_COMMIT_MESSAGE}
- TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}
- TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
- TRAVIS_JOB_NAME=${TRAVIS_JOB_NAME}
- TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
- TRAVIS_JOB_WEB_URL=${TRAVIS_JOB_WEB_URL}
- TRAVIS_BRANCH=${TRAVIS_BRANCH}
volumes_from:
- erpnext_app
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ services:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
- DOCKER_DEBUG=1
# Test setup
- TEST_VERSION=${VERSION}
- TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID}
- TRAVIS_BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}
- TRAVIS_BUILD_WEB_URL=${TRAVIS_BUILD_WEB_URL}
- TRAVIS_COMMIT=${TRAVIS_COMMIT}
- TRAVIS_COMMIT_MESSAGE=${TRAVIS_COMMIT_MESSAGE}
- TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}
- TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
- TRAVIS_JOB_NAME=${TRAVIS_JOB_NAME}
- TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
- TRAVIS_JOB_WEB_URL=${TRAVIS_JOB_WEB_URL}
- TRAVIS_BRANCH=${TRAVIS_BRANCH}
volumes_from:
- erpnext_app
volumes:
Expand Down
File renamed without changes.
Loading

0 comments on commit 90ea2c4

Please sign in to comment.