1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-15 17:51:03 +00:00
kube-arangodb/scripts/kube_create_license_key_secret.sh

34 lines
488 B
Bash
Raw Normal View History

#!/bin/bash
NS=$1
2018-12-04 09:38:48 +00:00
if [ -z "$NS" ]; then
echo "Specify a namespace argument"
exit 1
fi
2018-12-04 09:38:48 +00:00
if [ -z "$2" ]; then
2018-12-04 09:25:48 +00:00
echo "No enterprise license set"
exit 0
fi
case $(uname) in
Darwin)
LICENSE=$(echo -n "$2" | base64 -b 0)
;;
*)
LICENSE=$(echo -n "$2" | base64 -w 0)
;;
esac
2018-12-04 09:25:48 +00:00
kubectl apply -f - <<EOF
apiVersion: v1
data:
token: ${LICENSE}
kind: Secret
metadata:
name: arangodb-jenkins-license-key
namespace: ${NS}
type: Opaque
EOF