github.com/kyma-project/kyma-environment-broker@v0.0.1/scripts/check_artifacts_existence.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # standard bash error handling
     4  set -o nounset  # treat unset variables as an error and exit immediately.
     5  set -o errexit  # exit immediately when a command fails.
     6  set -E          # must be set if you want the ERR trap
     7  set -o pipefail # prevents errors in a pipeline from being masked
     8  
     9  # This script has the following arguments:
    10  #                       -  image tag - mandatory
    11  #
    12  # ./check_artifacts_existence.sh v2.1.0
    13  
    14  # Expected variables:
    15  #             IMAGE_REPO - binary image repository
    16  #             GITHUB_TOKEN - github token
    17  
    18  export IMAGE_TAG=$1
    19  
    20  PROTOCOL=docker://
    21  
    22  if [ $(skopeo list-tags ${PROTOCOL}${IMAGE_REPO} | jq '.Tags|any(. == env.IMAGE_TAG)') == "true" ]
    23  then
    24    echo "::warning ::Kyma Environment Broker binary image for tag ${IMAGE_TAG} already exists"
    25  else
    26    echo "No previous Kyma Environment Broker binary image found for tag ${IMAGE_TAG}"
    27  fi