-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfleetctl
More file actions
executable file
·36 lines (29 loc) · 1014 Bytes
/
fleetctl
File metadata and controls
executable file
·36 lines (29 loc) · 1014 Bytes
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
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
dir=$(cd $(dirname "$0") && pwd)
source "$dir/variables.sh"
config_container="$GCLOUD_PROJECT""-gcloud-config"
fleet_image="$GCLOUD_PROJECT""-fleet"
if [ -z "`docker ps -a | grep $config_container`" ] ; then
echo "It seems you have not yet authenticated with google cloud"
echo "Please run ./gcloud reauth, and follow instructions to create credentials"
exit 1
fi
if [ -z "`docker images | grep $fleet_image`" ] ; then
echo "You have not build the fleet image for this project yet"
echo "Please do so (see the Makefile in this directory"
exit 1
fi
if [[ "$1" == "ssh" || "$1" == "journal" ]] ; then
PREPEND="$PREPEND -it"
fi
docker run --volumes-from $config_container \
-e FLEETCTL_TUNNEL=`cat $dir/.entry-node` \
-e FLEET_VERIFY_UNITS=true \
-e FLEETCTL="/root/fleet/bin/fleetctl" \
-e ENTRY_NODE=`cat $dir/.entry-node` \
-w / --entrypoint /ssh_and_do \
-v $dir/../services:/services \
-v $dir/scripts/ssh_and_do:/ssh_and_do \
-e HOME="/" \
$PREPEND \
$fleet_image $@