Skip to content

Commit

Permalink
Merge pull request #3600 from uselagoon/testing/fix_dwp_rerun
Browse files Browse the repository at this point in the history
add CLEAR_API_DATA env to allow API data clearing
  • Loading branch information
tobybellwood authored Nov 27, 2023
2 parents 9476e37 + 6a40c1b commit b9895d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ PUBLISH_PLATFORM_ARCH := linux/amd64,linux/arm64
# Skip image scanning by default to make building images substantially faster
SCAN_IMAGES := false

# Clear all data from the API on a retest run, usually to clear up after a failure. Set false to preserve
CLEAR_API_DATA ?= true

# Init the file that is used to hold the image tag cross-reference table
$(shell >build.txt)
$(shell >scan.txt)
Expand Down Expand Up @@ -629,6 +632,7 @@ k3d/retest:
LAGOON_FEATURE_FLAG_DEFAULT_ISOLATION_NETWORK_POLICY=enabled \
USE_CALICO_CNI=false \
LAGOON_FEATURE_FLAG_DEFAULT_ROOTLESS_WORKLOAD=enabled \
CLEAR_API_DATA=$(CLEAR_API_DATA) \
&& docker run --rm --network host --name ct-$(CI_BUILD_TAG) \
--volume "$$(pwd)/test-suite-run.ct.yaml:/etc/ct/ct.yaml" \
--volume "$$(pwd):/workdir" \
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ services:
depends_on:
- api
image: ${IMAGE_REPO:-lagoon}/local-api-data-watcher-pusher
environment:
- CLEAR_API_DATA=false
volumes:
- ./local-dev/api-data-watcher-pusher:/home
local-dbaas-provider:
Expand Down
5 changes: 4 additions & 1 deletion local-dev/api-data-watcher-pusher/data-init-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ send_task_data() {
wait_for_services

# Optionally clear *some* API data prior to reloading - not really necessary any more
# send_graphql_query $clear_gql_file_path
if expr "$CLEAR_API_DATA" : '[Tt][Rr][Uu][Ee]' > /dev/null; then
echo "Clearing Lagoon data first"
send_graphql_query $clear_gql_file_path
fi

# Create the lagoon-demo project and associated users, groups, deployments, tasks etc
send_graphql_query $populate_demo_lagoon_gql_file_path
Expand Down

0 comments on commit b9895d7

Please sign in to comment.