diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000000..a6a6bf87d2 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,24 @@ +gcp_credentials: ENCRYPTED[!17c59813193e86cc337bce848b358412b90f50bc5fe1b8b39d363cdf14a41ebe76cfba0482e7f81d076994b9f6dbfb4c!] + +env: + CIRRUS_CLONE_DEPTH: 1 + # Use bash (instead of sh on linux or cmd.exe on windows) + CIRRUS_SHELL: bash + +container_definition: &CONTAINER_DEFINITION + builder_image_project: language-team + builder_image_name: docker-builder-lt-v1 + cluster_name: cirrus-ci-lt-cluster + zone: us-central1-a + namespace: default + use_in_memory_disk: true + +tests_task: + gke_container: + dockerfile: Dockerfile + <<: *CONTAINER_DEFINITION + dockerfile: Dockerfile + cpu: 1 + memory: 1G + tests_script: + - ./tests.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..f752bea24f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine + +RUN apk add --update --no-cache bash curl jq + +CMD ["sh"] \ No newline at end of file diff --git a/tests.sh b/tests.sh new file mode 100755 index 0000000000..294f7930f2 --- /dev/null +++ b/tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash +echo "Test metadata.json" + +exit_code=0 + +for dir in rules/* +do + dir=${dir%*/} + echo ${dir##*/} + if test -f "$dir/metadata.json"; then + echo "$FILE exists." + HAS_TITLE=`cat $dir/metadata.json | jq 'has("title")'` + if [ "$HAS_TITLE" != "true" ]; then + echo "$dir/metadata.json has no title" + exit_code=1 + fi + else + echo "no $dir/metadata.json" + exit_code=1 + fi +done + +exit $exit_code