ci: re-enable localstack tests

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville
2021-08-31 14:39:45 +02:00
parent fe2845fdfb
commit 74b1ac3632
4 changed files with 29 additions and 25 deletions

View File

@@ -1,20 +1,3 @@
# Instead of setup, this just runs once
setup_file() {
# Cleanup local Localstack instances
if [ "$(curl -s http://localhost:4566)" = '{"status": "running"}' ] && \
[ "$GITHUB_ACTIONS" != "true" ]; then
echo "Cleanup local LOCALSTACK"
# S3 buckets cleanup
aws --endpoint-url=http://localhost:4566 s3 rm s3://dagger-ci 2>/dev/null || true
aws --endpoint-url=http://localhost:4566 s3 mb s3://dagger-ci 2>/dev/null || true
# ECR repositories cleanup
aws --endpoint-url=http://localhost:4566 ecr delete-repository --repository-name dagger-ci 2>/dev/null || true
aws --endpoint-url=http://localhost:4566 ecr create-repository --repository-name dagger-ci 2>/dev/null || true
fi
}
common_setup() {
load 'node_modules/bats-support/load'
load 'node_modules/bats-assert/load'
@@ -95,4 +78,20 @@ skip_unless_local_kube() {
else
skip "local kubernetes cluster not available"
fi
}
# Cleanup local Localstack instances
setup_localstack() {
if [ "$(curl -s http://localhost:4566)" = '{"status": "running"}' ] && \
[ "$GITHUB_ACTIONS" != "true" ]; then
echo "Cleanup local LOCALSTACK"
# S3 buckets cleanup
aws --endpoint-url=http://localhost:4566 s3 rm s3://dagger-ci || true
aws --endpoint-url=http://localhost:4566 s3 mb s3://dagger-ci || true
# ECR repositories cleanup
aws --endpoint-url=http://localhost:4566 ecr delete-repository --repository-name dagger-ci || true
aws --endpoint-url=http://localhost:4566 ecr create-repository --repository-name dagger-ci || true
fi
}