-
Notifications
You must be signed in to change notification settings - Fork 3
/
y-skaffold
executable file
·26 lines (21 loc) · 1.03 KB
/
y-skaffold
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
[ -z "$DEBUG" ] || set -x
set -e
YBIN="$(dirname $0)"
[ "$1" = "dev" ] && echo "y-skaffold dev requires -n [namespace] as initial args" && exit 1
version=$(y-bin-download $YBIN/y-bin.runner.yaml skaffold)
# https://skaffold.dev/docs/concepts/#local-development
[ -z "$KUBECONFIG" ] && KUBECONFIG=$HOME/.kube/config
grep 'current-context: minikube' $KUBECONFIG && {
echo "Dev context is local (according to skaffold conventions); sourcing $YBIN/y-devcluster-docker.env"
source $YBIN/y-devcluster-docker.env
}
[ ! -z "$SKAFFOLD_CACHE_ARTIFACTS" ] || docker version > /dev/null 2>&1 || SKAFFOLD_CACHE_ARTIFACTS=false
[ ! -z "$SKAFFOLD_INSECURE_REGISTRY" ] || SKAFFOLD_INSECURE_REGISTRY='builds-registry.ystack.svc.cluster.local,prod-registry.ystack.svc.cluster.local'
# Y-stack opinions, where do we put them?
SKAFFOLD_NO_PRUNE=true \
SKAFFOLD_UPDATE_CHECK=false \
SKAFFOLD_CACHE_ARTIFACTS="$SKAFFOLD_CACHE_ARTIFACTS" \
SKAFFOLD_INSECURE_REGISTRY="$SKAFFOLD_INSECURE_REGISTRY" \
\
$YBIN/y-skaffold-v${version}-bin "$@" || exit $?