k3s/scripts/dev-agent.sh

21 lines
446 B
Bash
Raw Normal View History

2019-01-01 08:23:01 +00:00
#!/bin/bash
set -e
. setup-rancher-path.sh
2019-01-09 16:54:15 +00:00
cd $(dirname $0)/..
2019-01-01 08:23:01 +00:00
# Prime sudo
2019-01-09 16:54:15 +00:00
sudo echo Compiling
2019-01-01 08:23:01 +00:00
2019-01-09 16:54:15 +00:00
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
2019-01-01 08:23:01 +00:00
2019-01-09 16:54:15 +00:00
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) "$@"