ClickHouse/tests/ci/worker/init_builder.sh

21 lines
760 B
Bash
Raw Normal View History

2021-10-21 11:09:15 +00:00
#!/usr/bin/env bash
2021-09-28 13:28:25 +00:00
set -euo pipefail
echo "Running init script"
export DEBIAN_FRONTEND=noninteractive
export RUNNER_HOME=/home/ubuntu/actions-runner
echo "Receiving token"
export RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
export RUNNER_URL="https://github.com/ClickHouse"
2021-09-29 11:40:20 +00:00
# Funny fact, but metadata service has fixed IP
export INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
2021-09-28 13:28:25 +00:00
cd $RUNNER_HOME
echo "Going to configure runner"
2021-10-21 11:09:15 +00:00
sudo -u ubuntu ./config.sh --url $RUNNER_URL --token $RUNNER_TOKEN --name $INSTANCE_ID --runnergroup Default --labels 'self-hosted,Linux,X64,builder' --work _work
2021-09-28 13:28:25 +00:00
echo "Run"
sudo -u ubuntu ./run.sh