Last active
June 11, 2022 11:32
-
-
Save day0hero/8be0013040d773fcf03173c9888e9ebc to your computer and use it in GitHub Desktop.
Example Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPADDR=$(shell ip a | grep -Eo 'inet ([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | awk '{print $$2}') | |
deploy: prereqs | |
echo "Let's get this party started" | |
make bootstrap | |
images: prereqs | |
echo "Unpacking images onto machine" | |
"sudo tar xvf sparta-utility.tar.gz -C /root/utility" | |
"sudo mv ocp-images.tar /root/utility" | |
echo "Creating ssh keys" | |
"bash /root/utility/sparta2/ssh-keys.sh" | |
echo "image load up" | |
"sudo podman load -i /root/utility/tar-bundles/utility.tar" | |
prereqs: | |
echo "Configuring prerequisites" | |
sudo dnf install -y podman | |
sudo mkdir -p /root/utility | |
bootstrap: | |
sed -i 's/IPADDR/$(IPADDR)/' /tmp/inventory | |
grep -A2 remote /tmp/inventory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment