Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
stewartshea committed Jan 26, 2025
1 parent b3972c8 commit 9a555dd
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions .test/azure/aks-and-k8s/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tasks:
desc: "Generate workspaceInfo and rebuild/test"
cmds:
- task: generate-rwl-config
- task: build-rwl
- task: run-rwl-discovery

clean:
Expand Down Expand Up @@ -84,11 +85,11 @@ tasks:
EOF
silent: true

run-rwl-discovery:
desc: "Run RunWhen Local Discovery on test infrastructure"
build-rwl:
desc: "Build RWL test image"
cmds:
- |
BUILD_DIR=/home/runwhen/runwhen-local/src
BUILD_DIR=../../../src/
CONTAINER_NAME="RunWhenLocal"
if docker ps -q --filter "name=$CONTAINER_NAME" | grep -q .; then
echo "Stopping and removing existing container $CONTAINER_NAME..."
Expand All @@ -106,6 +107,27 @@ tasks:
## Building Container Image
docker buildx build --builder mybuilder --platform linux/amd64 -t runwhen-local:test -f $BUILD_DIR/Dockerfile $BUILD_DIR --load
silent: true

run-rwl-discovery:
desc: "Run RunWhen Local Discovery on test infrastructure"
cmds:
- |
rm slx_count.txt || true
CONTAINER_NAME="RunWhenLocal"
if docker ps -q --filter "name=$CONTAINER_NAME" | grep -q .; then
echo "Stopping and removing existing container $CONTAINER_NAME..."
docker stop $CONTAINER_NAME && docker rm $CONTAINER_NAME
elif docker ps -a -q --filter "name=$CONTAINER_NAME" | grep -q .; then
echo "Removing existing stopped container $CONTAINER_NAME..."
docker rm $CONTAINER_NAME
else
echo "No existing container named $CONTAINER_NAME found."
fi
echo "Cleaning up output directory..."
rm -rf output || { echo "Failed to remove output directory"; exit 1; }
mkdir output && chmod 777 output || { echo "Failed to set permissions"; exit 1; }
echo "Starting new container $CONTAINER_NAME..."
Expand All @@ -119,10 +141,11 @@ tasks:
}
echo "Review generated config files under output/workspaces/"
echo "Total SLXs: $(find $(find 'output/' -type d -name 'slxs') -mindepth 1 -type d | wc -l)"
total_slxs=$(find $(find 'output/' -type d -name 'slxs') -mindepth 1 -type d | wc -l)
echo "Total SLXs: $total_slxs"
echo "$total_slxs" > slx_count.txt
silent: true


ci-test-1:
desc: "Run CI Discovery Test 1 - K8s & AKS - defaultLOD None, K8s context defaultNamespaceLOD Basic, AKS defaultNamespaceLOD Detailed"
env:
Expand Down

0 comments on commit 9a555dd

Please sign in to comment.