Skip to content

Commit

Permalink
[AIRFLOW-5288] Auto-remove temporary containers for static checks (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
potiuk authored Aug 23, 2019
1 parent d24db82 commit 3c60a11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/ci/_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ function run_flake8() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" | tee -a "${OUTPUT_LOG}"
else
docker run "${AIRFLOW_CONTAINER_EXTRA_DOCKER_FLAGS[@]}" \
Expand All @@ -533,6 +534,7 @@ function run_flake8() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" \
"${FILES[@]}" | tee -a "${OUTPUT_LOG}"
fi
Expand All @@ -546,6 +548,7 @@ function run_docs() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}"
}

Expand All @@ -557,6 +560,7 @@ function run_check_license() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_CI_IMAGE}"
}

Expand All @@ -570,6 +574,7 @@ function run_mypy() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" \
"airflow" "tests" "docs" | tee -a "${OUTPUT_LOG}"
else
Expand All @@ -580,6 +585,7 @@ function run_mypy() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" \
"${FILES[@]}" | tee -a "${OUTPUT_LOG}"
fi
Expand All @@ -595,6 +601,7 @@ function run_pylint_main() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" | tee -a "${OUTPUT_LOG}"
else
docker run "${AIRFLOW_CONTAINER_EXTRA_DOCKER_FLAGS[@]}" \
Expand All @@ -604,6 +611,7 @@ function run_pylint_main() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" \
"${FILES[@]}" | tee -a "${OUTPUT_LOG}"
fi
Expand All @@ -620,6 +628,7 @@ function run_pylint_tests() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" | tee -a "${OUTPUT_LOG}"
else
docker run "${AIRFLOW_CONTAINER_EXTRA_DOCKER_FLAGS[@]}" \
Expand All @@ -629,6 +638,7 @@ function run_pylint_tests() {
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_SLIM_CI_IMAGE}" \
"${FILES[@]}" | tee -a "${OUTPUT_LOG}"
fi
Expand All @@ -643,6 +653,7 @@ function run_docker_lint() {
docker run \
-v "$(pwd):/root" \
-w /root \
--rm \
hadolint/hadolint /bin/hadolint Dockerfile*
echo
echo "Docker pylint completed with no errors"
Expand All @@ -654,6 +665,7 @@ function run_docker_lint() {
docker run \
-v "$(pwd):/root" \
-w /root \
--rm \
hadolint/hadolint /bin/hadolint "$@"
echo
echo "Docker pylint completed with no errors"
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/ci_check_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ docker run "${AIRFLOW_CONTAINER_EXTRA_DOCKER_FLAGS[@]}" -t \
--env AIRFLOW_CI_SILENT \
--env HOST_USER_ID="$(id -ur)" \
--env HOST_GROUP_ID="$(id -gr)" \
--rm \
"${AIRFLOW_CHECKLICENCE_IMAGE}"

script_end

0 comments on commit 3c60a11

Please sign in to comment.