diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..45770805 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,65 @@ +version: 2.0 +jobs: + build: + docker: + - image: registry.atat.codes:443/atat-app-builder:circleci + auth: + username: $REGISTRY_USERNAME + password: $REGISTRY_PASSWORD + environment: + KEEP_EXISTING_VENV: true + PGHOST: localhost + PGUSER: root + PGDATABASE: circle_test + REDIS_URI: redis://localhost:6379 + - image: circleci/postgres:9.6.5-alpine-ram + - image: circleci/redis:4-alpine3.8 + steps: + - checkout + - run: + name: "Clone Submodules" + command: | + git submodule update --init --recursive + - restore_cache: + name: "Load Cache: Pipenv References" + keys: + - pipenv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }} + - pipenv-v1-{{ .Branch }}- + - pipenv-v1- + - restore_cache: + name: "Load Cache: Python Venv" + keys: + - venv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }} + - venv-v1-{{ .Branch }}- + - venv-v1- + - restore_cache: + name: "Load Cache: Yarn" + keys: + - yarn-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} + - yarn-v1-{{ .Branch }}- + - yarn-v1- + - run: ./script/setup + - save_cache: + name: "Save Cache: Pipenv Refrences" + paths: + - ~/.local/share + key: pipenv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }} + - save_cache: + name: "Save Cache: Python Venv" + paths: + - ./.venv + key: venv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }} + - save_cache: + name: "Save Cache: Yarn" + paths: + - ~/.cache/yarn + key: yarn-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} + - restore_cache: + keys: + - disa-crls + - run: ./script/sync-crls + - save_cache: + paths: + - ./crl + key: disa-crls + - run: ./script/cibuild diff --git a/.gitmodules b/.gitmodules index e2e55be7..0e4a0b6f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "script/include"] path = script/include - url = git@github.com:dod-ccpo/scriptz.git + url = https://github.com/dod-ccpo/scriptz.git branch = master diff --git a/atst/app.py b/atst/app.py index f0e5ffc6..e882c5cc 100644 --- a/atst/app.py +++ b/atst/app.py @@ -114,6 +114,12 @@ def make_config(): # ENV_CONFIG will override values in BASE_CONFIG. config.read(config_files) + # Check for ENV variables as a final source of overrides + for confsetting in config.options("default"): + env_override = os.getenv(confsetting.upper()) + if env_override: + config.set("default", confsetting, env_override) + # Assemble DATABASE_URI value database_uri = ( "postgres://" diff --git a/script/cibuild b/script/cibuild index 55ac15cb..1493008c 100755 --- a/script/cibuild +++ b/script/cibuild @@ -7,18 +7,12 @@ source "$(dirname "${0}")"/../script/include/global_header.inc.sh # Run lint/style checks and unit tests export FLASK_ENV=ci -# Enable database resetting -RESET_DB="true" - # Define all relevant python files and directories for this app -PYTHON_FILES="./app.py ./atst ./config" +PYTHON_FILES="./app.py ./atst/** ./config" # Enable Python testing RUN_PYTHON_TESTS="true" -# Compile assets -yarn build - # Check python formatting source ./script/format check diff --git a/script/include b/script/include index c44ca507..c55d1eb5 160000 --- a/script/include +++ b/script/include @@ -1 +1 @@ -Subproject commit c44ca5070da78fd522a2e485aaa225cc638e11d3 +Subproject commit c55d1eb5db0255784e46aec1006e4419465ef945