veilid/scripts/cicd/build-orchestration/build-machine-ctrl.sh
TC Johnson 06f344ebb4
Migrating CICD scripts to Veilid repo
Copied CICD scripts into the repository so that the community can make
contributions to the build system. Wrote a brief description of the
build and distribute process. Modified the CICD config to use the repo
hosted scripts. [ci skip]
2024-04-21 13:37:45 -05:00

68 lines
2.5 KiB
Bash

#!/bin/bash
if [ "$1" = "create" ] && [ "$2" = "amd64-deb" ]
then
## Create amd64-deb build machine
echo "Creating amd64-deb build machine"
doctl compute droplet create build-server-amd64-deb-tmp --image 154584863 \
--size c2-8vcpu-16gb-intel --region nyc1 --enable-private-networking \
--ssh-keys 38852180,38632397,41187560 --tag-names build-machines,build-orchestration --wait
echo "Done"
elif [ "$1" = "create" ] && [ "$2" = "arm64-deb" ]
then
## Create arm64-deb build machine
echo "Creating arm64-deb build machine"
doctl compute droplet create build-server-arm64-deb-tmp --image 154584861 \
--size c2-8vcpu-16gb-intel --region nyc1 --enable-private-networking \
--ssh-keys 38852180,38632397,41187560 --tag-names build-machines,build-orchestration --wait
echo "Done"
elif [ "$1" = "create" ] && [ "$2" = "amd64-rpm" ]
then
## Create amd64-rpm build machine
echo "Creating amd64-rpm build machine"
doctl compute droplet create build-server-amd64-rpm-tmp --image 154584864 \
--size c2-8vcpu-16gb-intel --region nyc1 --enable-private-networking \
--ssh-keys 38852180,38632397,41187560 --tag-names build-machines,build-orchestration --wait
echo "Done"
elif [ "$1" = "create" ] && [ "$2" = "arm64-rpm" ] ## This snapshot does not yet exist
then
## Create arm64-rpm build machine
echo "Creating arm64-rpm build machine"
doctl compute droplet create build-server-arm64-rpm-tmp --image 154584864 \
--size c2-8vcpu-16gb-intel --region nyc1 --enable-private-networking \
--ssh-keys 38852180,38632397,41187560 --tag-names build-machines,build-orchestration --wait
echo "Done"
elif [ "$1" = "delete" ] && [ "$2" = "amd64-deb" ]
then
## Delete amd64-deb build machine
echo "Deleting amd64-deb build machine"
doctl compute droplet delete build-server-amd64-deb-tmp --force
echo "Done"
elif [ "$1" = "delete" ] && [ "$2" = "arm64-deb" ]
then
## Delete arm64-deb build machine
echo "Deleting arm64-deb build machine"
doctl compute droplet delete build-server-arm64-deb-tmp --force
echo "Done"
elif [ "$1" = "delete" ] && [ "$2" = "amd64-rpm" ]
then
## Delete amd64-rpm build machine
echo "Deleting amd64-rpm build machine"
doctl compute droplet delete build-server-amd64-rpm-tmp --force
echo "Done"
elif [ "$1" = "delete" ] && [ "$2" = "arm64-rpm" ] ## This snapshot does not exist yet
then
## Delete arm64-rpm build machine
echo "Deleting arm64-rpm build machine"
doctl compute droplet delete build-server-arm64-rpm-tmp --force
echo "Done"
else
echo $1 "is not a valid command to execute for "$2
fi