root: migrate pipenv to poetry (#1995)
This commit is contained in:
parent
10110deae5
commit
320a600349
|
@ -17,6 +17,8 @@ values =
|
||||||
beta
|
beta
|
||||||
stable
|
stable
|
||||||
|
|
||||||
|
[bumpversion:file:pyproject.toml]
|
||||||
|
|
||||||
[bumpversion:file:docker-compose.yml]
|
[bumpversion:file:docker-compose.yml]
|
||||||
|
|
||||||
[bumpversion:file:schema.yml]
|
[bumpversion:file:schema.yml]
|
||||||
|
|
|
@ -33,40 +33,36 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
- id: cache-pipenv
|
- id: cache-poetry
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: scripts/ci_prepare.sh
|
run: scripts/ci_prepare.sh
|
||||||
- name: run job
|
- name: run job
|
||||||
run: pipenv run make ci-${{ matrix.job }}
|
run: poetry run make ci-${{ matrix.job }}
|
||||||
test-migrations:
|
test-migrations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
- id: cache-poetry
|
||||||
python-version: '3.9'
|
|
||||||
- id: cache-pipenv
|
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: scripts/ci_prepare.sh
|
run: scripts/ci_prepare.sh
|
||||||
- name: run migrations
|
- name: run migrations
|
||||||
run: pipenv run python -m lifecycle.migrate
|
run: poetry run python -m lifecycle.migrate
|
||||||
test-migrations-from-stable:
|
test-migrations-from-stable:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -74,75 +70,79 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
- name: prepare variables
|
- name: prepare variables
|
||||||
id: ev
|
id: ev
|
||||||
run: |
|
run: |
|
||||||
python ./scripts/gh_env.py
|
python ./scripts/gh_env.py
|
||||||
- id: cache-pipenv
|
sudo pip install -U pipenv
|
||||||
|
- id: cache-poetry
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: checkout stable
|
- name: checkout stable
|
||||||
id: stable
|
|
||||||
run: |
|
run: |
|
||||||
# Save current branch
|
|
||||||
current=$(git branch --show)
|
|
||||||
echo ##[set-output name=originalBranch]$current
|
|
||||||
# Copy current, latest config to local
|
# Copy current, latest config to local
|
||||||
cp authentik/lib/default.yml local.env.yml
|
cp authentik/lib/default.yml local.env.yml
|
||||||
cp -R .github ..
|
cp -R .github ..
|
||||||
cp -R scripts ..
|
cp -R scripts ..
|
||||||
|
cp -R poetry.lock pyproject.toml ..
|
||||||
git checkout $(git describe --abbrev=0 --match 'version/*')
|
git checkout $(git describe --abbrev=0 --match 'version/*')
|
||||||
rm -rf .github/ scripts/
|
rm -rf .github/ scripts/
|
||||||
mv ../.github ../scripts .
|
mv ../.github ../scripts ../poetry.lock ../pyproject.toml .
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
scripts/ci_prepare.sh
|
scripts/ci_prepare.sh
|
||||||
# Sync anyways since stable will have different dependencies
|
# Sync anyways since stable will have different dependencies
|
||||||
pipenv sync --dev
|
# TODO: Remove after next stable release
|
||||||
|
if [[ -f "Pipfile.lock" ]]; then
|
||||||
|
pipenv install --dev
|
||||||
|
fi
|
||||||
|
poetry install
|
||||||
- name: run migrations to stable
|
- name: run migrations to stable
|
||||||
run: pipenv run python -m lifecycle.migrate
|
run: poetry run python -m lifecycle.migrate
|
||||||
- name: checkout current code
|
- name: checkout current code
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
git fetch
|
git fetch
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git checkout ${{ steps.stable.outputs.originalBranch }}
|
# TODO: Remove after next stable release
|
||||||
pipenv sync --dev
|
rm -f poetry.lock
|
||||||
|
git checkout $GITHUB_SHA
|
||||||
|
# TODO: Remove after next stable release
|
||||||
|
if [[ -f "Pipfile.lock" ]]; then
|
||||||
|
pipenv install --dev
|
||||||
|
fi
|
||||||
|
poetry install
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: scripts/ci_prepare.sh
|
run: scripts/ci_prepare.sh
|
||||||
- name: migrate to latest
|
- name: migrate to latest
|
||||||
run: pipenv run python -m lifecycle.migrate
|
run: poetry run python -m lifecycle.migrate
|
||||||
test-unittest:
|
test-unittest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
- id: cache-poetry
|
||||||
python-version: '3.9'
|
|
||||||
- id: cache-pipenv
|
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: scripts/ci_prepare.sh
|
run: scripts/ci_prepare.sh
|
||||||
- uses: testspace-com/setup-testspace@v1
|
- uses: testspace-com/setup-testspace@v1
|
||||||
with:
|
with:
|
||||||
domain: ${{github.repository_owner}}
|
domain: ${{github.repository_owner}}
|
||||||
- name: run unittest
|
- name: run unittest
|
||||||
run: |
|
run: |
|
||||||
pipenv run make test
|
poetry run make test
|
||||||
pipenv run coverage xml
|
poetry run coverage xml
|
||||||
- name: run testspace
|
- name: run testspace
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
|
@ -154,16 +154,14 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
- id: cache-poetry
|
||||||
python-version: '3.9'
|
|
||||||
- id: cache-pipenv
|
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: scripts/ci_prepare.sh
|
run: scripts/ci_prepare.sh
|
||||||
- uses: testspace-com/setup-testspace@v1
|
- uses: testspace-com/setup-testspace@v1
|
||||||
with:
|
with:
|
||||||
|
@ -172,8 +170,8 @@ jobs:
|
||||||
uses: helm/kind-action@v1.2.0
|
uses: helm/kind-action@v1.2.0
|
||||||
- name: run integration
|
- name: run integration
|
||||||
run: |
|
run: |
|
||||||
pipenv run make test-integration
|
poetry run make test-integration
|
||||||
pipenv run coverage xml
|
poetry run coverage xml
|
||||||
- name: run testspace
|
- name: run testspace
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
|
@ -185,8 +183,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
|
@ -195,14 +191,14 @@ jobs:
|
||||||
- uses: testspace-com/setup-testspace@v1
|
- uses: testspace-com/setup-testspace@v1
|
||||||
with:
|
with:
|
||||||
domain: ${{github.repository_owner}}
|
domain: ${{github.repository_owner}}
|
||||||
- id: cache-pipenv
|
- id: cache-poetry
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
scripts/ci_prepare.sh
|
scripts/ci_prepare.sh
|
||||||
docker-compose -f tests/e2e/docker-compose.yml up -d
|
docker-compose -f tests/e2e/docker-compose.yml up -d
|
||||||
|
@ -219,8 +215,8 @@ jobs:
|
||||||
npm run build
|
npm run build
|
||||||
- name: run e2e
|
- name: run e2e
|
||||||
run: |
|
run: |
|
||||||
pipenv run make test-e2e-provider
|
poetry run make test-e2e-provider
|
||||||
pipenv run coverage xml
|
poetry run coverage xml
|
||||||
- name: run testspace
|
- name: run testspace
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
|
@ -232,8 +228,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
|
@ -242,14 +236,14 @@ jobs:
|
||||||
- uses: testspace-com/setup-testspace@v1
|
- uses: testspace-com/setup-testspace@v1
|
||||||
with:
|
with:
|
||||||
domain: ${{github.repository_owner}}
|
domain: ${{github.repository_owner}}
|
||||||
- id: cache-pipenv
|
- id: cache-poetry
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
scripts/ci_prepare.sh
|
scripts/ci_prepare.sh
|
||||||
docker-compose -f tests/e2e/docker-compose.yml up -d
|
docker-compose -f tests/e2e/docker-compose.yml up -d
|
||||||
|
@ -266,8 +260,8 @@ jobs:
|
||||||
npm run build
|
npm run build
|
||||||
- name: run e2e
|
- name: run e2e
|
||||||
run: |
|
run: |
|
||||||
pipenv run make test-e2e-rest
|
poetry run make test-e2e-rest
|
||||||
pipenv run coverage xml
|
poetry run coverage xml
|
||||||
- name: run testspace
|
- name: run testspace
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -22,22 +22,20 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
- id: cache-poetry
|
||||||
python-version: '3.9'
|
|
||||||
- id: cache-pipenv
|
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
|
key: ${{ runner.os }}-poetry-cache-v3-${{ hashFiles('**/poetry.lock') }}
|
||||||
- name: prepare
|
- name: prepare
|
||||||
env:
|
env:
|
||||||
INSTALL: ${{ steps.cache-pipenv.outputs.cache-hit }}
|
INSTALL: ${{ steps.cache-poetry.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gettext
|
sudo apt-get install -y gettext
|
||||||
scripts/ci_prepare.sh
|
scripts/ci_prepare.sh
|
||||||
- name: run compile
|
- name: run compile
|
||||||
run: pipenv run ./manage.py compilemessages
|
run: poetry run make ./manage.py compilemessages
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v3
|
uses: peter-evans/create-pull-request@v3
|
||||||
id: cpr
|
id: cpr
|
||||||
|
|
30
Dockerfile
30
Dockerfile
|
@ -1,16 +1,4 @@
|
||||||
# Stage 1: Lock python dependencies
|
# Stage 1: Build website
|
||||||
FROM docker.io/python:3.10.1-slim-bullseye as locker
|
|
||||||
|
|
||||||
COPY ./Pipfile /app/
|
|
||||||
COPY ./Pipfile.lock /app/
|
|
||||||
|
|
||||||
WORKDIR /app/
|
|
||||||
|
|
||||||
RUN pip install pipenv && \
|
|
||||||
pipenv lock -r > requirements.txt && \
|
|
||||||
pipenv lock -r --dev-only > requirements-dev.txt
|
|
||||||
|
|
||||||
# Stage 2: Build website
|
|
||||||
FROM --platform=${BUILDPLATFORM} docker.io/node:16 as website-builder
|
FROM --platform=${BUILDPLATFORM} docker.io/node:16 as website-builder
|
||||||
|
|
||||||
COPY ./website /work/website/
|
COPY ./website /work/website/
|
||||||
|
@ -18,7 +6,7 @@ COPY ./website /work/website/
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN cd /work/website && npm i && npm run build-docs-only
|
RUN cd /work/website && npm i && npm run build-docs-only
|
||||||
|
|
||||||
# Stage 3: Build webui
|
# Stage 2: Build webui
|
||||||
FROM --platform=${BUILDPLATFORM} docker.io/node:16 as web-builder
|
FROM --platform=${BUILDPLATFORM} docker.io/node:16 as web-builder
|
||||||
|
|
||||||
COPY ./web /work/web/
|
COPY ./web /work/web/
|
||||||
|
@ -27,7 +15,7 @@ COPY ./website /work/website/
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN cd /work/web && npm i && npm run build
|
RUN cd /work/web && npm i && npm run build
|
||||||
|
|
||||||
# Stage 4: Build go proxy
|
# Stage 3: Build go proxy
|
||||||
FROM docker.io/golang:1.17.5-bullseye AS builder
|
FROM docker.io/golang:1.17.5-bullseye AS builder
|
||||||
|
|
||||||
WORKDIR /work
|
WORKDIR /work
|
||||||
|
@ -43,22 +31,26 @@ COPY ./go.sum /work/go.sum
|
||||||
|
|
||||||
RUN go build -o /work/authentik ./cmd/server/main.go
|
RUN go build -o /work/authentik ./cmd/server/main.go
|
||||||
|
|
||||||
# Stage 5: Run
|
# Stage 4: Run
|
||||||
FROM docker.io/python:3.10.1-slim-bullseye
|
FROM docker.io/python:3.10.1-slim-bullseye
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY --from=locker /app/requirements.txt /
|
|
||||||
COPY --from=locker /app/requirements-dev.txt /
|
|
||||||
|
|
||||||
ARG GIT_BUILD_HASH
|
ARG GIT_BUILD_HASH
|
||||||
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
|
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
|
||||||
|
|
||||||
|
COPY ./pyproject.toml /
|
||||||
|
COPY ./poetry.lock /
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
curl ca-certificates gnupg git runit libpq-dev \
|
curl ca-certificates gnupg git runit libpq-dev \
|
||||||
postgresql-client build-essential libxmlsec1-dev \
|
postgresql-client build-essential libxmlsec1-dev \
|
||||||
pkg-config libmaxminddb0 && \
|
pkg-config libmaxminddb0 && \
|
||||||
pip install -r /requirements.txt --no-cache-dir && \
|
pip install poetry && \
|
||||||
|
poetry config virtualenvs.create false && \
|
||||||
|
poetry install --no-dev && \
|
||||||
|
rm -rf ~/.cache/pypoetry && \
|
||||||
apt-get remove --purge -y build-essential git && \
|
apt-get remove --purge -y build-essential git && \
|
||||||
apt-get autoremove --purge -y && \
|
apt-get autoremove --purge -y && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -106,20 +106,24 @@ web-extract:
|
||||||
# These targets are use by GitHub actions to allow usage of matrix
|
# These targets are use by GitHub actions to allow usage of matrix
|
||||||
# which makes the YAML File a lot smaller
|
# which makes the YAML File a lot smaller
|
||||||
|
|
||||||
ci-pylint:
|
ci--meta-debug:
|
||||||
|
python -V
|
||||||
|
node --version
|
||||||
|
|
||||||
|
ci-pylint: ci--meta-debug
|
||||||
pylint authentik tests lifecycle
|
pylint authentik tests lifecycle
|
||||||
|
|
||||||
ci-black:
|
ci-black: ci--meta-debug
|
||||||
black --check authentik tests lifecycle
|
black --check authentik tests lifecycle
|
||||||
|
|
||||||
ci-isort:
|
ci-isort: ci--meta-debug
|
||||||
isort --check authentik tests lifecycle
|
isort --check authentik tests lifecycle
|
||||||
|
|
||||||
ci-bandit:
|
ci-bandit: ci--meta-debug
|
||||||
bandit -r authentik tests lifecycle
|
bandit -r authentik tests lifecycle
|
||||||
|
|
||||||
ci-pyright:
|
ci-pyright: ci--meta-debug
|
||||||
pyright e2e lifecycle
|
pyright e2e lifecycle
|
||||||
|
|
||||||
ci-pending-migrations:
|
ci-pending-migrations: ci--meta-debug
|
||||||
./manage.py makemigrations --check
|
./manage.py makemigrations --check
|
||||||
|
|
68
Pipfile
68
Pipfile
|
@ -1,68 +0,0 @@
|
||||||
[[source]]
|
|
||||||
name = "pypi"
|
|
||||||
url = "https://pypi.org/simple"
|
|
||||||
verify_ssl = true
|
|
||||||
|
|
||||||
[packages]
|
|
||||||
boto3 = "*"
|
|
||||||
celery = "*"
|
|
||||||
channels = "*"
|
|
||||||
channels-redis = "*"
|
|
||||||
codespell = "*"
|
|
||||||
colorama = "*"
|
|
||||||
dacite = "*"
|
|
||||||
deepmerge = "*"
|
|
||||||
defusedxml = "*"
|
|
||||||
django = "*"
|
|
||||||
django-dbbackup = { git = 'https://github.com/django-dbbackup/django-dbbackup.git', ref = '9d1909c30a3271c8c9c8450add30d6e0b996e145' }
|
|
||||||
django-filter = "*"
|
|
||||||
django-guardian = "*"
|
|
||||||
django-model-utils = "*"
|
|
||||||
django-otp = "*"
|
|
||||||
django-prometheus = "*"
|
|
||||||
django-redis = "*"
|
|
||||||
django-storages = "*"
|
|
||||||
djangorestframework = "*"
|
|
||||||
djangorestframework-guardian = "*"
|
|
||||||
docker = "*"
|
|
||||||
drf-spectacular = "*"
|
|
||||||
duo-client = "*"
|
|
||||||
facebook-sdk = "*"
|
|
||||||
geoip2 = "*"
|
|
||||||
gunicorn = "*"
|
|
||||||
kubernetes = "==v19.15.0"
|
|
||||||
ldap3 = "*"
|
|
||||||
lxml = "*"
|
|
||||||
packaging = "*"
|
|
||||||
psycopg2-binary = "*"
|
|
||||||
pycryptodome = "*"
|
|
||||||
pyjwt = "*"
|
|
||||||
pyyaml = "*"
|
|
||||||
requests-oauthlib = "*"
|
|
||||||
sentry-sdk = { git = 'https://github.com/beryju/sentry-python.git', ref = '379aee28b15d3b87b381317746c4efd24b3d7bc3' }
|
|
||||||
service_identity = "*"
|
|
||||||
structlog = "*"
|
|
||||||
swagger-spec-validator = "*"
|
|
||||||
twisted = "==21.7.0"
|
|
||||||
ua-parser = "*"
|
|
||||||
urllib3 = {extras = ["secure"],version = "*"}
|
|
||||||
uvicorn = {extras = ["standard"],version = "*"}
|
|
||||||
webauthn = "*"
|
|
||||||
xmlsec = "*"
|
|
||||||
flower = "*"
|
|
||||||
wsproto = "*"
|
|
||||||
|
|
||||||
[dev-packages]
|
|
||||||
bandit = "*"
|
|
||||||
black = "==21.11b1"
|
|
||||||
bump2version = "*"
|
|
||||||
colorama = "*"
|
|
||||||
coverage = {extras = ["toml"],version = "*"}
|
|
||||||
pylint = "*"
|
|
||||||
pylint-django = "*"
|
|
||||||
pytest = "*"
|
|
||||||
pytest-django = "*"
|
|
||||||
pytest-randomly = "*"
|
|
||||||
requests-mock = "*"
|
|
||||||
selenium = "*"
|
|
||||||
importlib-metadata = "*"
|
|
File diff suppressed because it is too large
Load Diff
|
@ -67,7 +67,7 @@ if [[ "$1" == "server" ]]; then
|
||||||
/authentik-proxy
|
/authentik-proxy
|
||||||
elif [[ "$1" == "worker" ]]; then
|
elif [[ "$1" == "worker" ]]; then
|
||||||
echo "worker" > $MODE_FILE
|
echo "worker" > $MODE_FILE
|
||||||
check_if_root "celery -A authentik.root.celery worker -Ofair --autoscale 3,1 -E -B -s /tmp/celerybeat-schedule -Q authentik,authentik_scheduled,authentik_events"
|
check_if_root "celery -A authentik.root.celery worker -Ofair --max-tasks-per-child=1 --autoscale 3,1 -E -B -s /tmp/celerybeat-schedule -Q authentik,authentik_scheduled,authentik_events"
|
||||||
elif [[ "$1" == "flower" ]]; then
|
elif [[ "$1" == "flower" ]]; then
|
||||||
echo "flower" > $MODE_FILE
|
echo "flower" > $MODE_FILE
|
||||||
celery -A authentik.root.celery flower
|
celery -A authentik.root.celery flower
|
||||||
|
@ -80,7 +80,7 @@ elif [[ "$1" == "restore" ]]; then
|
||||||
elif [[ "$1" == "bash" ]]; then
|
elif [[ "$1" == "bash" ]]; then
|
||||||
/bin/bash
|
/bin/bash
|
||||||
elif [[ "$1" == "test" ]]; then
|
elif [[ "$1" == "test" ]]; then
|
||||||
pip install --no-cache -r requirements-dev.txt
|
poetry install
|
||||||
touch /unittest.xml
|
touch /unittest.xml
|
||||||
chown authentik:authentik /unittest.xml
|
chown authentik:authentik /unittest.xml
|
||||||
check_if_root "python -m manage test authentik"
|
check_if_root "python -m manage test authentik"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -89,3 +89,78 @@ DJANGO_SETTINGS_MODULE = "authentik.root.settings"
|
||||||
python_files = ["tests.py", "test_*.py", "*_tests.py"]
|
python_files = ["tests.py", "test_*.py", "*_tests.py"]
|
||||||
junit_family = "xunit2"
|
junit_family = "xunit2"
|
||||||
addopts = "-p no:celery --junitxml=unittest.xml"
|
addopts = "-p no:celery --junitxml=unittest.xml"
|
||||||
|
|
||||||
|
[tool.poetry]
|
||||||
|
name = "authentik"
|
||||||
|
version = "2021.12.4"
|
||||||
|
description = ""
|
||||||
|
authors = ["Jens Langhammer <jens.langhammer@beryju.org>"]
|
||||||
|
|
||||||
|
[tool.poetry.dependencies]
|
||||||
|
python = "^3.10"
|
||||||
|
boto3 = "*"
|
||||||
|
celery = "*"
|
||||||
|
channels = "*"
|
||||||
|
channels-redis = "*"
|
||||||
|
codespell = "*"
|
||||||
|
colorama = "*"
|
||||||
|
dacite = "*"
|
||||||
|
deepmerge = "*"
|
||||||
|
defusedxml = "*"
|
||||||
|
django = "*"
|
||||||
|
django-dbbackup = { git = 'https://github.com/django-dbbackup/django-dbbackup.git', rev = '9d1909c30a3271c8c9c8450add30d6e0b996e145' }
|
||||||
|
django-filter = "*"
|
||||||
|
django-guardian = "*"
|
||||||
|
django-model-utils = "*"
|
||||||
|
django-otp = "*"
|
||||||
|
django-prometheus = "*"
|
||||||
|
django-redis = "*"
|
||||||
|
django-storages = "*"
|
||||||
|
djangorestframework = "*"
|
||||||
|
djangorestframework-guardian = "*"
|
||||||
|
docker = "*"
|
||||||
|
drf-spectacular = "*"
|
||||||
|
duo-client = "*"
|
||||||
|
facebook-sdk = "*"
|
||||||
|
geoip2 = "*"
|
||||||
|
gunicorn = "*"
|
||||||
|
kubernetes = "==v19.15.0"
|
||||||
|
ldap3 = "*"
|
||||||
|
lxml = "*"
|
||||||
|
packaging = "*"
|
||||||
|
psycopg2-binary = "*"
|
||||||
|
pycryptodome = "*"
|
||||||
|
pyjwt = "*"
|
||||||
|
pyyaml = "*"
|
||||||
|
requests-oauthlib = "*"
|
||||||
|
sentry-sdk = { git = 'https://github.com/beryju/sentry-python.git', rev = '379aee28b15d3b87b381317746c4efd24b3d7bc3' }
|
||||||
|
service_identity = "*"
|
||||||
|
structlog = "*"
|
||||||
|
swagger-spec-validator = "*"
|
||||||
|
twisted = "==21.7.0"
|
||||||
|
ua-parser = "*"
|
||||||
|
urllib3 = {extras = ["secure"],version = "*"}
|
||||||
|
uvicorn = {extras = ["standard"],version = "*"}
|
||||||
|
webauthn = "*"
|
||||||
|
xmlsec = "*"
|
||||||
|
flower = "*"
|
||||||
|
wsproto = "*"
|
||||||
|
|
||||||
|
[tool.poetry.dev-dependencies]
|
||||||
|
bandit = "*"
|
||||||
|
black = "*"
|
||||||
|
bump2version = "*"
|
||||||
|
colorama = "*"
|
||||||
|
coverage = {extras = ["toml"],version = "*"}
|
||||||
|
pylint = "*"
|
||||||
|
pylint-django = "*"
|
||||||
|
pytest = "*"
|
||||||
|
pytest-django = "*"
|
||||||
|
pytest-randomly = "*"
|
||||||
|
requests-mock = "*"
|
||||||
|
selenium = "*"
|
||||||
|
importlib-metadata = "*"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/bash -xe
|
#!/bin/bash -xe
|
||||||
docker-compose -f scripts/ci.docker-compose.yml up -d
|
docker-compose -f scripts/ci.docker-compose.yml up -d
|
||||||
|
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y libxmlsec1-dev pkg-config
|
sudo apt install -y libxmlsec1-dev pkg-config
|
||||||
sudo pip install -U wheel pipenv
|
python3 -m pip install -U wheel poetry
|
||||||
|
poetry env use python3.10
|
||||||
if [[ "$INSTALL" != "true" ]]; then
|
if [[ "$INSTALL" != "true" ]]; then
|
||||||
pipenv install --dev
|
poetry install
|
||||||
fi
|
fi
|
||||||
pipenv run python -m scripts.generate_ci_config
|
poetry run python -m scripts.generate_ci_config
|
||||||
npm install -g pyright@1.1.136
|
npm install -g pyright@1.1.136
|
||||||
|
|
|
@ -9,7 +9,7 @@ To create a local development setup for authentik, you need the following:
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- Python 3.9
|
- Python 3.9
|
||||||
- pipenv, which is used to manage dependencies, and can be installed with `pip install pipenv`
|
- poetry, which is used to manage dependencies, and can be installed with `pip install poetry`
|
||||||
- Go 1.16
|
- Go 1.16
|
||||||
- PostgreSQL (any recent version will do)
|
- PostgreSQL (any recent version will do)
|
||||||
- Redis (any recent version will do)
|
- Redis (any recent version will do)
|
||||||
|
@ -19,8 +19,8 @@ For PostgreSQL and Redis, you can use the docker-compose file in `scripts/`. You
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pipenv shell # Creates a python virtualenv, and activates it in a new shell
|
poetry shell # Creates a python virtualenv, and activates it in a new shell
|
||||||
pipenv sync --dev # Install all required dependencies, including development dependencies
|
poetry install # Install all required dependencies, including development dependencies
|
||||||
```
|
```
|
||||||
|
|
||||||
To configure authentik to use the local databases, create a file in the authentik directory called `local.env.yml`, with the following contents
|
To configure authentik to use the local databases, create a file in the authentik directory called `local.env.yml`, with the following contents
|
||||||
|
|
Reference in New Issue