The CircleCI Orbs were useful for getting started, but now that we only have to deploy to one provider our pipeline should be tailored to efficiently push to just that environment. This inlines all the relevant pieces from the Orbs we were relying on as bash/sh commands instead. This builds the Docker images upfront. Since we have a multi-stage Dockerfile, it builds the first stage as a separate image and then proceeds to build the complete image. This is done so that the first stage (called "builder") can be used for testing. It retains executables like pipenv that we need to install development dependencies needed for tests. Other notes: - CircleCI does not persist Docker images between jobs. As a work-around, we use the CircleCI caching mechanism to create a named cache with *.tar copies of the images. Subsequent jobs use the cache and load the images. - Both the test and integration-tests jobs need to make minor modifications to the container to run correctly. The test job needs to install the development Python dependencies, and the integration-tests job needs to rebuild the JS bundle so that it uses the mock uploader (the container is build to use the Azure uploader by default). - The test and integration-tests jobs run in parallel. - This adjusts the Dockerfile so that the TZ environment variable is set for both stages of the build.
24 lines
515 B
Bash
Executable File
24 lines
515 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# script/cibuild: Run CI related checks and tests
|
|
|
|
source "$(dirname "${0}")"/../script/include/global_header.inc.sh
|
|
|
|
# Run lint/style checks and unit tests
|
|
export FLASK_ENV=ci
|
|
|
|
# Define all relevant python files and directories for this app
|
|
PYTHON_FILES="./app.py ./atst/** ./config"
|
|
|
|
# Enable Python testing
|
|
RUN_PYTHON_TESTS="true"
|
|
|
|
# Enable Javascript testing
|
|
RUN_JS_TESTS="true"
|
|
|
|
# Check python formatting
|
|
source ./script/format check
|
|
|
|
# Run the shared test script
|
|
source ./script/include/run_test
|