Skip to content

Commit

Permalink
Shell cleanup. Fix shellcheck warnings. Remove unused environment var…
Browse files Browse the repository at this point in the history
…iable from environment.sh.
  • Loading branch information
ggreer committed Dec 11, 2017
1 parent e2be616 commit a9ae566
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions contrib/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
# bridge command line arguments - in fact. to get more information
# about any of them, you can run ./bin/bridge --help

export BRIDGE_HOST="http://127.0.0.1:9000"
export BRIDGE_USER_AUTH="disabled"
export BRIDGE_K8S_MODE="off-cluster"
export BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT=$(kubectl config view -o json | jq '{myctx: .["current-context"], ctxs: .contexts[], clusters: .clusters[]}' | jq 'select(.myctx == .ctxs.name)' | jq 'select(.ctxs.context.cluster == .clusters.name)' | jq '.clusters.cluster.server' -r)
BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT=$(kubectl config view -o json | jq '{myctx: .["current-context"], ctxs: .contexts[], clusters: .clusters[]}' | jq 'select(.myctx == .ctxs.name)' | jq 'select(.ctxs.context.cluster == .clusters.name)' | jq '.clusters.cluster.server' -r)
export BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT
export BRIDGE_K8S_MODE_OFF_CLUSTER_SKIP_VERIFY_TLS=true
export BRIDGE_K8S_AUTH="bearer-token"

secretname=$(kubectl get serviceaccount default --namespace=kube-system -o jsonpath='{.secrets[0].name}')
export BRIDGE_K8S_AUTH_BEARER_TOKEN=$(kubectl get secret "$secretname" --namespace=kube-system -o template --template='{{.data.token}}' | base64 --decode)
BRIDGE_K8S_AUTH_BEARER_TOKEN=$(kubectl get secret "$secretname" --namespace=kube-system -o template --template='{{.data.token}}' | base64 --decode)
export BRIDGE_K8S_AUTH_BEARER_TOKEN

echo "Using $BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT"
6 changes: 3 additions & 3 deletions jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ echo "Cleaning up old Docker images..."

set +e
# delete stopped containers
docker rm $(docker ps -a -q)
docker ps -a -q | xargs docker rm
# docker rm $(docker ps -a -q)

# delete images except for console builder (fails on images currently used)
TO_DELETE=$(docker images | grep -F -v quay.io/coreos/tectonic-console-builder | awk '{print $3}' | grep -v IMAGE)
docker rmi $TO_DELETE
docker images | grep -F -v quay.io/coreos/tectonic-console-builder | awk '{print $3}' | grep -v IMAGE | xargs docker rmi

# delete orphaned volumes
docker volume ls -qf dangling=true | xargs -r docker volume rm
Expand Down

0 comments on commit a9ae566

Please sign in to comment.