-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelocate-tap-images.sh
executable file
·40 lines (31 loc) · 1.84 KB
/
relocate-tap-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# Relocate Tanzu Application Platform images from Tanzu Network to private container image registry repository
# @see https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/install.html#relocate-images-to-a-registry-0
if [ -z "$1" ] && [ -z "$2" ] && [ -z "$3" ] && [ -z "$4" ] && [ -z "$5" ] && [ -z "$6" ]; then
echo "Usage: relocate-tap-imsages.sh {tanzu-network-username} {tanzu-network-password} {container-registry-url} {container-registry-username} {container-registry-password} {target-repository}"
exit 1
fi
TANZUNET_USERNAME="${1}"
TANZUNET_PASSWORD="${2}"
REGISTRY_URL="${3}"
REGISTRY_USERNAME="${4}"
REGISTRY_PASSWORD="${5}"
TARGET_REPOSITORY="${6}"
# Set up environment variables for installation use by running:
export TAP_VERSION=1.9.0
export IMGPKG_REGISTRY_HOSTNAME_0=registry.tanzu.vmware.com
export IMGPKG_REGISTRY_USERNAME_0="${TANZUNET_USERNAME}"
export IMGPKG_REGISTRY_PASSWORD_0="${TANZUNET_PASSWORD}"
export IMGPKG_REGISTRY_HOSTNAME_1="${REGISTRY_URL}"
export IMGPKG_REGISTRY_USERNAME_1="${REGISTRY_USERNAME}"
export IMGPKG_REGISTRY_PASSWORD_1="${REGISTRY_PASSWORD}"
export INSTALL_REGISTRY_USERNAME="${REGISTRY_USERNAME}"
export INSTALL_REGISTRY_PASSWORD="${REGISTRY_PASSWORD}"
export INSTALL_REGISTRY_HOSTNAME="${REGISTRY_URL}"
export INSTALL_REPO="${TARGET_REPOSITORY}"
# Relocate the images with the imgpkg CLI by running:
imgpkg copy -b registry.tanzu.vmware.com/tanzu-application-platform/tap-packages:${TAP_VERSION} \
--to-repo ${INSTALL_REGISTRY_HOSTNAME}/${INSTALL_REPO}/tap-packages
# @see https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/install.html#install-the-full-dependencies-package-6
imgpkg copy -b registry.tanzu.vmware.com/tanzu-application-platform/full-tbs-deps-package-repo:${TAP_VERSION} \
--to-repo ${INSTALL_REGISTRY_HOSTNAME}/${INSTALL_REPO}/tbs-full-deps-package-repo