diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7a2c4f4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +credentials.py +.idea/ +__pycache__/ +venv/ +.git/ \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..53ca9bf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,37 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{js,py}] +charset = utf-8 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +[{*.jinja2,*.html.j2}] +indent_style = space +indent_size = 2 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +# Indentation override for all JS under lib directory +[lib/**.js] +indent_style = space +indent_size = 2 + +# Matches the exact files either package.json or .travis.yml +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f17c0c0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +app/static/bootstrap-4.2.1/* linguist-vendored +app/static/bootswatch-master/* linguist-vendored +app/static/datatables/* linguist-vendored +app/static/font-awesome/* linguist-vendored diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f31a16e --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +credentials.py +resources.py +.idea/ +__pycache__/ +venv/ +static/policy/ +app/static/site.css +app/static/.webassets-cache/**/* +app/static/brickdb/* +locale.json +app/static/ldddb/* +.vscode/settings.json +locale.xml +app/luclient/* +app/cache/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6775ed1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# syntax=docker/dockerfile:1 + +FROM python:3.8-slim-buster + +RUN apt update +RUN apt -y install zip +RUN apt -y install imagemagick + +COPY requirements.txt requirements.txt + +RUN pip install -r requirements.txt +RUN pip install gunicorn + +COPY wsgi.py wsgi.py +COPY entrypoint.sh entrypoint.sh +COPY ./app /app +COPY ./migrations /migrations + +EXPOSE 8000 +RUN chmod +x entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..9382731 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,50 @@ +properties([ + parameters([ + gitParameter( + branch: '', + branchFilter: 'origin/(.*)', + defaultValue: 'origin/refactor', + description: '', + name: 'BRANCH', + quickFilterEnabled: false, + selectedValue: 'NONE', + sortMode: 'NONE', + tagFilter: '*', + useRepository: 'git@github.com:aronwk-aaron/AccountManager.git', + type: 'PT_BRANCH' + ) + ]) +]) + +node('worker'){ + stage('Clone Code'){ + checkout([ + $class: 'GitSCM', + branches: [[name: params.BRANCH]], + extensions: [], + userRemoteConfigs: [ + [ + credentialsId: 'aronwk', + url: 'git@github.com:aronwk-aaron/AccountManager.git' + ] + ] + ]) + } + def tag = '' + stage("Build Container"){ + + if (params.BRANCH.contains('master')){ + tag = 'latest' + } else { + tag = params.BRANCH.replace('\\', '-') + } + sh "docker build -t aronwk/dlu-account_manager:${tag} ." + } + stage("Push Container"){ + withCredentials([usernamePassword(credentialsId: 'docker-hub-token', passwordVariable: 'password', usernameVariable: 'username')]) { + sh "docker login -u ${username} -p ${password}" + sh "docker push aronwk/dlu-account_manager:${tag}" + sh 'docker logout' + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..250bfe2 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Nexus Dashboard + +**This is a WIP: For Advanced Users** + +
+ +
+ +# Deployment + +## Docker + +```bash + +docker run -d \ + -e APP_SECRET_KEY='