Skip to content

Instantly share code, notes, and snippets.

@keirbadger
keirbadger / k8sdash.sh
Created April 11, 2019 08:01
Script to automatically login to EKS Kubernetes dashboard using aws-iam-authenticator (from Mac)
kubectl config use-context new-prod;aws-iam-authenticator token -i [CLUSTER NAME] -r [AWS IAM ACCOUNT WITH ACCESS TO EKS] | jq -r .status.token |pbcopy
kill -9 $(ps -ef | grep "kubectl proxy" | grep -v grep | cut -c6-13)
kubectl proxy &
python k8sdash_login.py
@keirbadger
keirbadger / jenkins.sh
Last active April 11, 2019 07:33
jenkins docker container entrypoint script with debug enabled
#! /bin/bash -e
: "${JENKINS_WAR:="/usr/share/jenkins/jenkins.war"}"
: "${JENKINS_HOME:="/var/jenkins_home"}"
touch "${COPY_REFERENCE_FILE_LOG}" || { echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?"; exit 1; }
echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG"
find /usr/share/jenkins/ref/ \( -type f -o -type l \) -exec bash -c '. /usr/local/bin/jenkins-support; for arg; do copy_reference_file "$arg"; done' _ {} +
# if `docker run` first argument start with `--` the user is passing jenkins launcher arguments
if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then