k3s/scripts/dev-agent.sh

23 lines
474 B
Bash
Raw Normal View History

2019-01-01 03:23:01 -05:00
#!/bin/bash
set -e
2019-01-09 11:54:15 -05:00
cd $(dirname $0)/..
2019-01-01 03:23:01 -05:00
2019-03-07 11:32:33 -05:00
. ./scripts/setup-rancher-path.sh
GO=${GO-go}
2019-01-01 03:23:01 -05:00
# Prime sudo
2019-01-09 11:54:15 -05:00
sudo echo Compiling
2019-01-01 03:23:01 -05:00
2019-01-09 11:54:15 -05: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
2019-01-09 11:54:15 -05:00
fi
2019-01-01 03:23:01 -05:00
2019-01-09 11:54:15 -05: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) "$@"