#!/bin/bash

set -e

# login to IBM Bluemix via credentials provided via (encrypted) environment
# variables
bluemix login \
  --apikey "${BLUEMIX_API_KEY}" \
  -a "${BLUEMIX_API_ENDPOINT}" \
  -o "${BLUEMIX_ORGANIZATION}" \
  -s "${BLUEMIX_SPACE}"

bluemix cs init \
  --host "${BLUEMIX_CONTAINER_SERVICE_HOST}"

# Get the required configuration for `kubectl` from Bluemix and load it
bluemix cs cluster-config \
  --export "${BLUEMIX_CONTAINER_SERVICE_CLUSTER_NAME}" \
  > .kubectl_config
source .kubectl_config && rm -rf .kubectl_config

# run the commands required to deploy the application via `kubectl`
kubectl version
kubectl cluster-info

#!/bin/bash

set -e

# login to IBM Bluemix via credentials provided via (encrypted) environment
# variables
bluemix login \
  --apikey "${BLUEMIX_API_KEY}" \
  -a "${BLUEMIX_API_ENDPOINT}"

bluemix cs init \
  --host "${BLUEMIX_CONTAINER_SERVICE_HOST}"

# Get the required configuration for `kubectl` from Bluemix and load it
bluemix cs cluster-config \
  --export "${BLUEMIX_CONTAINER_SERVICE_CLUSTER_NAME}" \
  > .kubectl_config
source .kubectl_config && rm -rf .kubectl_config

# run the commands required to deploy the application via `kubectl`
kubectl version
kubectl cluster-info

Remove the ORG and SPACE env variables for `kubectl`
Remove the ORG and SPACE env variables for `kubectl`
