util: Create HOSTNAME variable
Change-Id: Ia68f1bef2bb9e4e5e18476b6100be80f8cf1c799
This commit is contained in:
5
util/github-runners-vagrant/Vagrantfile
vendored
5
util/github-runners-vagrant/Vagrantfile
vendored
@@ -3,12 +3,13 @@
|
|||||||
|
|
||||||
PERSONAL_ACCESS_TOKEN="<PERSONAL ACCESS TOKEN>"
|
PERSONAL_ACCESS_TOKEN="<PERSONAL ACCESS TOKEN>"
|
||||||
GITHUB_ORG="<GITHUB_ORG>"
|
GITHUB_ORG="<GITHUB_ORG>"
|
||||||
|
HOSTNAME="<VM NAME>"
|
||||||
|
|
||||||
Vagrant.configure("2") do |config|
|
Vagrant.configure("2") do |config|
|
||||||
config.vm.box = "generic/ubuntu2204"
|
config.vm.box = "generic/ubuntu2204"
|
||||||
config.vm.box_check_update = true
|
config.vm.box_check_update = true
|
||||||
config.vm.define "<VM NAME>"
|
config.vm.define "#{HOSTNAME}"
|
||||||
config.vm.hostname = "<VM NAME>"
|
config.vm.hostname = "#{HOSTNAME}"
|
||||||
config.ssh.username = "vagrant"
|
config.ssh.username = "vagrant"
|
||||||
config.ssh.password = "vagrant"
|
config.ssh.password = "vagrant"
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
for (( i=1; i<=NUM_RUNNERS; i++ )); do
|
for (( i=1; i<=NUM_RUNNERS; i++ )); do
|
||||||
sed -i "s/ config.vm.define.*/ config.vm.define \"${RUNNER_PREFIX}-${i}\"/g" Vagrantfile
|
sed -i "s/HOSTNAME=.*/HOTNAME=\"${RUNNER_PREFIX}-${i}\"/g" Vagrantfile
|
||||||
sed -i "s/ config.vm.hostname.*/ config.vm.hostname = \"${RUNNER_PREFIX}-${i}\"/g" Vagrantfile
|
|
||||||
if [[ "${param}" == "destroy" ]]; then
|
if [[ "${param}" == "destroy" ]]; then
|
||||||
VAGRANT_VAGRANTFILE=Vagrantfile vagrant destroy -f
|
VAGRANT_VAGRANTFILE=Vagrantfile vagrant destroy -f
|
||||||
elif [[ "${param}" == "shutdown" ]]; then
|
elif [[ "${param}" == "shutdown" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user