Skip to content

Instantly share code, notes, and snippets.

@lodotek
Last active January 7, 2022 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lodotek/054417c34780b3e747432981681ee10a to your computer and use it in GitHub Desktop.
Save lodotek/054417c34780b3e747432981681ee10a to your computer and use it in GitHub Desktop.
aws eks task script (WIP) for concourse
if [ -n "${CLUSTER_NAME}" ]; then
set -- "$@" --name "${CLUSTER_NAME}"
fi
if [ -n "${AWS_REGION}" ]; then
set -- "$@" --region "${AWS_REGION}"
fi
if [ -n "${AWS_PROFILE}" ]; then
set -- "$@" --profile "${AWS_PROFILE}"
fi
if [ -n "${KUBECONFIG_FILE_PATH}" ]; then
set -- "$@" --kubeconfig "${KUBECONFIG_FILE_PATH}"
fi
if [ -n "${ROLE_ARN}" ]; then
set -- "$@" --role-arn "${ROLE_ARN}"
fi
if [ -n "${CLUSTER_CONTEXT_ALIAS}" ]; then
set -- "$@" --alias "${CLUSTER_CONTEXT_ALIAS}"
fi
if [ "${DRY_RUN}" == "true" ]; then
set -- "$@" --dry-run
fi
if [ "${VERBOSE}" == "true" ]; then
set -- "$@" --verbose
fi
aws eks update-kubeconfig "$@"
---
platform: linux
params:
AWS_PROFILE:
AWS_REGION:
CLUSTER_CONTEXT_ALIAS:
CLUSTER_NAME:
DRY_RUN:
KUBECONFIG_FILE_PATH:
ROLE_ARN:
VERBOSE:
caches:
- path: /root/.cache
inputs:
- name: master-pipeline
run:
path: master-pipeline/tasks/eks/task.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment