Skip to content

Instantly share code, notes, and snippets.

@jasonkeene
Last active January 16, 2018 11:35
Show Gist options
  • Save jasonkeene/77e8d44a557fb5733e5fad5bb9db85cd to your computer and use it in GitHub Desktop.
Save jasonkeene/77e8d44a557fb5733e5fad5bb9db85cd to your computer and use it in GitHub Desktop.
Download a product from GCS and upload it to OpsMan
#!/bin/bash
set -e
tile=pivotal-container-service-0.7.1-build.6.pivotal
om_username=some-username
om_password=some-password
om_target=https://1.2.3.4
mkdir -p $HOME/tile-dl
cd $HOME/tile-dl
function aws {
if ! docker inspect aws-config > /dev/null 2>&1; then
docker run -it --name aws-config -v "$PWD:/pwd" mesosphere/aws-cli configure
fi
docker run -it --rm --volumes-from aws-config -v "$PWD:/pwd" mesosphere/aws-cli $@
}
gsutil cp "gs://pks-tile-archive/$tile" ./
if [ ! -f ./om ]; then
wget -q -O om https://github.com/pivotal-cf/om/releases/download/0.28.0/om-linux
chmod +x om
fi
./om --skip-ssl-validation -t "$om_target" -u "$om_username" -p "$om_password" upload-product -p "$tile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment