mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
152 lines
5.4 KiB
YAML
152 lines
5.4 KiB
YAML
language: python
|
|
|
|
dist: focal
|
|
os: linux
|
|
|
|
jobs:
|
|
include:
|
|
- name: "Paperless on Python 3.6"
|
|
python: "3.6"
|
|
|
|
- name: "Paperless on Python 3.7"
|
|
python: "3.7"
|
|
|
|
- name: "Paperless on Python 3.8"
|
|
python: "3.8"
|
|
|
|
- name: "Documentation"
|
|
script:
|
|
- cd docs/
|
|
- make html
|
|
after_success: true
|
|
|
|
- name: "Front end"
|
|
language: node_js
|
|
node_js:
|
|
- 15
|
|
before_install: true
|
|
install:
|
|
- cd src-ui/
|
|
- npm install -g @angular/cli
|
|
- npm install
|
|
script:
|
|
- ng build --prod
|
|
after_success: true
|
|
|
|
- stage: build_docker
|
|
name: amd64 docker build
|
|
services:
|
|
- docker
|
|
before_install:
|
|
- true
|
|
install:
|
|
- true
|
|
after_success:
|
|
- true
|
|
script:
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
- docker build -f Dockerfile --tag=${DOCKER_REPO}:${TRAVIS_COMMIT}-amd64 .
|
|
- docker push ${DOCKER_REPO}:${TRAVIS_COMMIT}-amd64
|
|
on:
|
|
condition: '"${BUILD_DOCKER}" = 1'
|
|
- stage: build_docker
|
|
name: arm64v8 docker build
|
|
services:
|
|
- docker
|
|
before_install:
|
|
- true
|
|
install:
|
|
- true
|
|
after_success:
|
|
- true
|
|
script:
|
|
- uname -a
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
# travis_wait 60 tells travis to wait for up to 60 minutes - default is 20, which is too short
|
|
- travis_wait 60 docker build -f Dockerfile --tag=${DOCKER_REPO}:${TRAVIS_COMMIT}-arm64v8 .
|
|
- docker push ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm64v8
|
|
arch: arm64-graviton2
|
|
virt: lxc
|
|
on:
|
|
condition: '"${BUILD_DOCKER}" = 1'
|
|
|
|
- stage: build_docker
|
|
name: arm32v7 docker build
|
|
services:
|
|
- docker
|
|
before_install:
|
|
- true
|
|
install:
|
|
- true
|
|
after_success:
|
|
- true
|
|
script:
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
# register binfmt stuff for qemu-static binaries so we can use userland-emulation
|
|
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
# replace the multi-arch reference with a specific, arm32v7 version. else docker will use the platform specific one,
|
|
# which is amd64.
|
|
- sed -i "s/FROM node:15/FROM node@$(docker manifest inspect node:15 | jq -r '.manifests [] | select (.platform.variant == "v7") | .digest')/g" Dockerfile
|
|
- sed -i "s/FROM python:3.7-slim/FROM python@$(docker manifest inspect python:3.7-slim | jq -r '.manifests [] | select (.platform.variant == "v7") | .digest')/g" Dockerfile
|
|
# travis_wait 60 tells travis to wait for up to 60 minutes - default is 20, which is too short
|
|
- travis_wait 60 docker build -f Dockerfile --tag=${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v7 .
|
|
- docker push ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v7
|
|
env:
|
|
- DOCKER_CLI_EXPERIMENTAL=enabled # required for manifest support
|
|
on:
|
|
condition: '"${BUILD_DOCKER}" = 1'
|
|
|
|
- stage: publish_manifest
|
|
env:
|
|
- DOCKER_CLI_EXPERIMENTAL=enabled # required for manifest support
|
|
services:
|
|
- docker
|
|
before_install:
|
|
- true
|
|
install:
|
|
- true
|
|
after_success:
|
|
- true
|
|
script:
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
- docker manifest create ${DOCKER_REPO}:${TRAVIS_COMMIT} ${DOCKER_REPO}:${TRAVIS_COMMIT}-amd64 ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm64v8 ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v7 ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v6
|
|
- docker manifest annotate ${DOCKER_REPO}:${TRAVIS_COMMIT} ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v7 --os linux --arch arm --variant v7
|
|
- docker manifest annotate ${DOCKER_REPO}:${TRAVIS_COMMIT} ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm64v8 --os linux --arch arm64 --variant v8
|
|
- docker manifest push --purge ${DOCKER_REPO}:${TRAVIS_COMMIT}
|
|
- |
|
|
if [ "${TRAVIS_BRANCH}" = "master" ]; then
|
|
echo "Master branch detected"
|
|
DOCKER_TAG="latest"
|
|
else
|
|
DOCKER_TAG=${TRAVIS_TAG}
|
|
fi
|
|
- |
|
|
if [ "${DOCKER_TAG}" != "" ]; then
|
|
echo "Create Tag ${DOCKER_TAG}"
|
|
docker manifest create ${DOCKER_REPO}:${DOCKER_TAG} ${DOCKER_REPO}:${TRAVIS_COMMIT}-amd64 ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm64v8 ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v7 ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v6
|
|
docker manifest annotate ${DOCKER_REPO}:${DOCKER_TAG} ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm32v7 --os linux --arch arm --variant v7
|
|
docker manifest annotate ${DOCKER_REPO}:${DOCKER_TAG} ${DOCKER_REPO}:${TRAVIS_COMMIT}-arm64v8 --os linux --arch arm64 --variant v8
|
|
docker manifest push --purge ${DOCKER_REPO}:${DOCKER_TAG}
|
|
else
|
|
echo "Not a tag and not on master, so not pushing tag/master specific manifest"
|
|
fi
|
|
on:
|
|
condition: '"${BUILD_DOCKER}" = 1'
|
|
|
|
|
|
before_install:
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get install -qq libpoppler-cpp-dev unpaper tesseract-ocr imagemagick ghostscript optipng
|
|
|
|
install:
|
|
- pip install --upgrade pipenv
|
|
- pipenv install --system --dev
|
|
|
|
script:
|
|
- cd src/
|
|
- pipenv run pytest --cov
|
|
- pipenv run pycodestyle
|
|
|
|
after_success:
|
|
- pipenv run coveralls
|