Sha256: 33f0290b328573a0763fd21ffa23e6569fc7db4af16b4340f96150607a4fab96

Contents?: true

Size: 1.4 KB

Versions: 4

Compression:

Stored size: 1.4 KB

Contents

#!/bin/bash

set -e

readonly REGISTRY="cyberark"
readonly INTERNAL_REGISTRY="registry2.itci.conjur.net"
readonly VERSION="$(cat VERSION)"
readonly VERSION_TAG="5-${VERSION}"
readonly image_name="conjur-cli"
readonly full_image_name="${REGISTRY}/${image_name}:latest"

readonly TAGS=(
  "5"
  "5-latest"
  "$VERSION_TAG"
)

# fetching tags is required for git_description to work
git fetch --tags
git_description=$(git describe)

# if it’s not a tagged commit, VERSION will have extra junk (i.e. -g666c4b2), so we won’t publish that commit
# only when tag matches the VERSION, push VERSION and latest releases
# and x and x.y releases
#Ex: v5-6.2.1
if [ "${git_description}" = "v${VERSION}" ]; then
  echo "Revision ${git_description} matches version ${VERSION} exactly. Pushing to Dockerhub..."

  for tag in "${TAGS[@]}"; do
    echo "Tagging and pushing ${REGISTRY}/${image_name}:${tag}"

    # push to dockerhub
    docker tag "${full_image_name}" "${REGISTRY}/${image_name}:${tag}"
    docker push "${REGISTRY}/${image_name}:${tag}"

    # push to internal registry
    # necessary because some cyberark teams/networks can't pull from dockerhub
    docker tag "${full_image_name}" "${INTERNAL_REGISTRY}/${image_name}:${tag}"
    docker push "${INTERNAL_REGISTRY}/${image_name}:${tag}"

  done

  # push to legacy `conjurinc/cli5` tag
  docker tag "${full_image_name}" conjurinc/cli5:latest
  docker push conjurinc/cli5:latest
fi

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
conjur-cli-6.2.6 push-image
conjur-cli-6.2.5 push-image
conjur-cli-6.2.4 push-image
conjur-cli-6.2.3 push-image