github.com/mkimuram/operator-sdk@v0.7.1-0.20190410172100-52ad33a4bda0/hack/tests/scorecard-subcommand.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  DEST_IMAGE="quay.io/example/scorecard-proxy"
     4  CSV_PATH="deploy/olm-catalog/memcached-operator/0.0.2/memcached-operator.v0.0.2.clusterserviceversion.yaml"
     5  CONFIG_PATH=".test-osdk-scorecard.yaml"
     6  
     7  set -ex
     8  
     9  # build scorecard-proxy image (and delete intermediate builder image)
    10  ./hack/image/build-scorecard-proxy-image.sh "$DEST_IMAGE"
    11  
    12  # the test framework directory has all the manifests needed to run the cluster
    13  pushd test/test-framework
    14  commandoutput="$(operator-sdk scorecard \
    15    --cr-manifest deploy/crds/cache_v1alpha1_memcached_cr.yaml \
    16    --init-timeout 60 \
    17    --csv-path "$CSV_PATH" \
    18    --verbose \
    19    --proxy-image "$DEST_IMAGE" \
    20    --proxy-pull-policy Never \
    21    2>&1)"
    22  echo $commandoutput | grep "Total Score: 80%"
    23  
    24  # test config file
    25  commandoutput2="$(operator-sdk scorecard \
    26    --proxy-image "$DEST_IMAGE" \
    27    --config "$CONFIG_PATH")"
    28  echo $commandoutput2 | grep "Total Score: 80%"
    29  popd