k3s/scripts/dev-agent.sh
Darren Shepherd c7b2548f66 Fixup pr165
2019-03-07 09:32:33 -07:00

21 lines
456 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)/..
. ./scripts/setup-rancher-path.sh
# Prime sudo
sudo echo Compiling
if [ ! -e bin/containerd ]; then
./scripts/build
./scripts/package
else
rm -f ./bin/k3s-agent
go build -tags "apparmor seccomp" -o ./bin/k3s-agent ./cmd/agent/main.go
fi
echo Starting agent
sudo env "PATH=$(pwd)/bin:$PATH" ./bin/k3s-agent --debug agent -s https://localhost:6443 -t $(<${RANCHER_PATH}/k3s/server/node-token) "$@"