Convert to using workslow with separate jobs
- Split build into app_setup and test jobs - Add workflow sequence info - Add DB reset to cibuild since it uses a fresh DB in a new build stage
This commit is contained in:
parent
26a83df444
commit
d77383ad9a
@ -19,18 +19,11 @@ defaults:
|
||||
REGISTRY_LOCATION: registry.atat.codes:443
|
||||
|
||||
jobs:
|
||||
build:
|
||||
app_setup:
|
||||
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: *sourceImage
|
||||
auth: *sourceAuth
|
||||
environment: *appEnvironment
|
||||
- image: circleci/postgres:9.6.5-alpine-ram
|
||||
- image: circleci/redis:4-alpine3.8
|
||||
steps:
|
||||
@ -39,6 +32,8 @@ jobs:
|
||||
name: "Clone Submodules"
|
||||
command: |
|
||||
git submodule update --init --recursive
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- restore_cache:
|
||||
name: "Load Cache: Pipenv References"
|
||||
keys:
|
||||
@ -57,6 +52,10 @@ jobs:
|
||||
- yarn-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||
- yarn-v1-{{ .Branch }}-
|
||||
- yarn-v1-
|
||||
- restore_cache:
|
||||
name: "Load Cache: Node Modules"
|
||||
keys:
|
||||
- node-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||
- run: ./script/setup
|
||||
- save_cache:
|
||||
name: "Save Cache: Pipenv Refrences"
|
||||
@ -73,12 +72,48 @@ jobs:
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
key: yarn-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- disa-crls
|
||||
- run: ./script/sync-crls
|
||||
- save_cache:
|
||||
name: "Save Cache: Node Modules"
|
||||
paths:
|
||||
- ./node_modules
|
||||
key: node-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||
- restore_cache:
|
||||
name: "Load Cache: CRLs"
|
||||
keys:
|
||||
- disa-crls-v1
|
||||
- disa-crls
|
||||
- run:
|
||||
name: "Update CRLs"
|
||||
command: ./script/sync-crls
|
||||
- save_cache:
|
||||
name: "Save Cache: CRLs"
|
||||
paths:
|
||||
- ./crl
|
||||
key: disa-crls
|
||||
- run: ./script/cibuild
|
||||
key: disa-crls-v1-{{ .Branch }}-{{ epoch}}
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- .
|
||||
|
||||
test:
|
||||
docker:
|
||||
- image: *sourceImage
|
||||
auth: *sourceAuth
|
||||
environment: *appEnvironment
|
||||
- image: circleci/postgres:9.6.5-alpine-ram
|
||||
- image: circleci/redis:4-alpine3.8
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: "Run Tests"
|
||||
command: ./script/cibuild
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
run-tests:
|
||||
jobs:
|
||||
- app_setup
|
||||
- test:
|
||||
requires:
|
||||
- app_setup
|
||||
|
@ -13,6 +13,9 @@ PYTHON_FILES="./app.py ./atst/** ./config"
|
||||
# Enable Python testing
|
||||
RUN_PYTHON_TESTS="true"
|
||||
|
||||
# Reset the DB, since the one script/setup created might not be persisted
|
||||
RESET_DB="true"
|
||||
|
||||
# Check python formatting
|
||||
source ./script/format check
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user