Skip to content

Commit

Permalink
Merge pull request #76 from gyohuangxin/end_at
Browse files Browse the repository at this point in the history
Add termination time when creating servers.
  • Loading branch information
leecalcote authored May 16, 2023
2 parents 862c528 + 712dcc1 commit 7e95e5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/scripts/start-cil-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ user_data_scripts="#cloud-config\nusers:\n - default\n - name: smp\n

# TODO: the options "operating_system", "facility", "plan" are hardcoded now, we should make them configurable
# https://metal.equinix.com/developers/api/devices/#devices-createdevice
termination_time=`date --utc -d "110 minute" +"%FT%TZ"`
device_id=$(curl -X POST -H "X-Auth-Token: $token" -s -H "Content-Type: application/json" \
-d '{"operating_system": "ubuntu_20_04", "facility": "da11", "plan": "c3.small.x86", "hostname": "'"${hostname}"'", "userdata": "'"${user_data_scripts}"'"}' \
-d '{"operating_system": "ubuntu_20_04", "facility": "da11", "plan": "c3.small.x86", "hostname": "'"${hostname}"'", "userdata": "'"${user_data_scripts}"'", "termination_time": "'"${termination_time}"'"}' \
https://api.equinix.com/metal/v1/projects/96a9d336-541b-42f7-9827-d845010da550/devices | jq -r .id)
if [[ -z $device_id ]]; then
echo "ERROR: Failed to create CNCF CIL machine: $hostname..."
Expand Down

0 comments on commit 7e95e5a

Please sign in to comment.