Skip to content

Commit

Permalink
First public release 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryBrain committed Aug 6, 2019
0 parents commit aefa4de
Show file tree
Hide file tree
Showing 187 changed files with 30,918 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
@@ -0,0 +1 @@
node_modules
159 changes: 159 additions & 0 deletions .drone.yml
@@ -0,0 +1,159 @@
---
kind: pipeline
name: default

platform:
os: linux
arch: amd64

node:
memory: high

steps:
- name: Change file ownership
image: alpine:latest
commands:
- chown -R 1001:0 /drone/src

- name: Build project
image: axarev/documentparser
environment:
LD_LIBRARY_PATH: /opt/rh/rh-nodejs8/root/usr/lib64
NODE_ENV: development
commands:
- export PATH=/opt/rh/rh-nodejs8/root/usr/bin:$PATH
- npm install

- name: Run formatter
image: axarev/documentparser
environment:
LD_LIBRARY_PATH: /opt/rh/rh-nodejs8/root/usr/lib64
commands:
- export PATH=/opt/rh/rh-nodejs8/root/usr/bin:$PATH
- npm run format

- name: Run linter
image: node:8
commands:
- npm run lint

- name: Run tests
image: axarev/documentparser
environment:
LD_LIBRARY_PATH: /opt/rh/rh-nodejs8/root/usr/lib64
commands:
- export PATH=/opt/rh/rh-nodejs8/root/usr/bin:$PATH
- npm run test

- name: Code-analysis
image: aosapps/drone-sonar-plugin:1.0
settings:
sonar_host:
from_secret: sonar_host
sonar_token:
from_secret: sonar_token
when:
branch:
- master

- name: Tag with demo
image: busybox
commands:
- echo demo > .tags
when:
branch:
- demo

- name: Build Docker image
image: plugins/docker
settings:
repo: axarev/documentparser
context: .
dockerfile: docker/parsr/Dockerfile
username:
from_secret: registry_user
password:
from_secret: registry_password
build_args:
DEV_MODE: 'true'
# auto_tag: true
when:
branch:
- develop
- demo
event:
exclude:
- pull_request

- name: Deploy dev
image: docker
environment:
DOCKER_HOST:
from_secret: docker_host
CA:
from_secret: docker_ca
CLIENT_CERT:
from_secret: docker_cert
CLIENT_KEY:
from_secret: docker_key
DOCKER_CERT_PATH: /cert
DOCKER_TLS_VERIFY: 1
DOCKER_IMAGE: axarev/documentparser:latest
DOCKER_SERVICE: documentparser_documentparser-dev
REGISTRY_USER:
from_secret: registry_user
REGISTRY_PASSWORD:
from_secret: registry_password
commands:
- mkdir -p "$DOCKER_CERT_PATH"
- echo "$CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$CLIENT_CERT" > $DOCKER_CERT_PATH/cert.pem
- echo "$CLIENT_KEY" > $DOCKER_CERT_PATH/key.pem
- docker login -u "$REGISTRY_USER" -p"$REGISTRY_PASSWORD"
- docker service update --with-registry-auth --image $DOCKER_IMAGE $DOCKER_SERVICE
- rm -rf $DOCKER_CERT_PATH
when:
branch:
- develop
- drone-ci
event:
exclude:
- pull_request

- name: Deploy demo
image: docker
environment:
DOCKER_HOST:
from_secret: docker_host
CA:
from_secret: docker_ca
CLIENT_CERT:
from_secret: docker_cert
CLIENT_KEY:
from_secret: docker_key
DOCKER_CERT_PATH: /cert
DOCKER_TLS_VERIFY: 1
DOCKER_IMAGE: axarev/documentparser:demo
DOCKER_SERVICE: documentparser_parsr-demo
REGISTRY_USER:
from_secret: registry_user
REGISTRY_PASSWORD:
from_secret: registry_password
commands:
- mkdir -p "$DOCKER_CERT_PATH"
- echo "$CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$CLIENT_CERT" > $DOCKER_CERT_PATH/cert.pem
- echo "$CLIENT_KEY" > $DOCKER_CERT_PATH/key.pem
- docker login -u "$REGISTRY_USER" -p"$REGISTRY_PASSWORD"
- docker service update --with-registry-auth --image $DOCKER_IMAGE $DOCKER_SERVICE
- rm -rf $DOCKER_CERT_PATH
when:
branch:
- demo
event:
exclude:
- pull_request


image_pull_secrets:
- dockerconfigjson
108 changes: 108 additions & 0 deletions .gitignore
@@ -0,0 +1,108 @@
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

*dist*
samples
mutool-extraction
mutool-images
pipeline


# vscode settings
.vscode/settings.json

# SonarQube
.sonar/
.scannerwork/

# python / jupyter ignores
.ipynb_checkpoints
__pycache__
8 changes: 8 additions & 0 deletions .prettierrc.js
@@ -0,0 +1,8 @@
// Rationale about style choices can be found there https://prettier.io/docs/en/rationale.html

module.exports = {
printWidth: 100,
singleQuote: true,
useTabs: true,
trailingComma: 'all',
};
20 changes: 20 additions & 0 deletions .s2i/bin/assemble
@@ -0,0 +1,20 @@
#!/bin/bash


[ -x /usr/libexec/s2i/assemble ] && /usr/libexec/s2i/assemble


echo ""

echo "Installing API"
npm run install:api

echo

echo "Installing Frontend (from demo)"
# "install:front": "npm install && npm run build:ts && npm run build:sass",
#npm run install:front
npm run build:ts
cd demo/web-viewer
npm install
npm run build:sass
3 changes: 3 additions & 0 deletions .s2i/bin/run
@@ -0,0 +1,3 @@
#!/bin/bash

exec /usr/libexec/s2i/run
28 changes: 28 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/dist/bin/index.js",
"outFiles": ["${workspaceRoot}/dist/bin/**/*.js"],
"sourceMaps": true,
"args": [
"-f", "${workspaceRoot}/samples/README.pdf",
"-o", "${workspaceRoot}/demo/web-viewer/pipeline/output",
"-n", "example",
"-c", "${workspaceRoot}/server/defaultConfig.json",
"-l", "debug",
"-p"
],
"env": {
"NODE_DEBUG": "pipeline"
},
"outputCapture": "std"
}
]
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": ["$tsc"],
"group": {
"kind": "build",
"isDefault": true,
}
}
]
}

0 comments on commit aefa4de

Please sign in to comment.