Skip to content

Commit

Permalink
Debug - Caching
Browse files Browse the repository at this point in the history
  • Loading branch information
steelhead31 committed Mar 8, 2024
1 parent ab92857 commit 42294e4
Showing 1 changed file with 49 additions and 41 deletions.
90 changes: 49 additions & 41 deletions .github/workflows/build_vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,56 @@ jobs:
run: |
sudo apt-get install vagrant
- name: Cache Solaris10.box.gz
id: solaris-10-cache
uses: actions/cache@v4
with:
path: Solaris10.box.gz
key: sol10box

- name: Install Solaris 10 Box If Not Already Present
run: |
if [ `vagrant box list|grep ^solaris10|wc -l` -gt 0 ]
then
echo "Box Exists - Do Nothing"
else
echo "No Box - Download From Jenkins And Import"
wget https://ci.adoptium.net/userContent/vagrant/Solaris10.box.gz
CKSUM=`shasum -a 256 ./Solaris10.box.gz|cut -d" " -f1`
if [ "$CKSUM" = "0879215f4bf03f5e125addb139d0b5a49a4f8a258297b765cf1f22a8a7ee3309" ]
then
echo "Checksum OK"
gunzip Solaris10.box.gz
vagrant box add --name="solaris10" ./Solaris10.box
rm Solaris10.box
else
echo "Sum Bad"
exit 99;
fi
fi
- name: Download Solaris 10 Box If Cache Misses
if: steps.cache.outputs.cache-hit != 'true'
run: | wget https://ci.adoptium.net/userContent/vagrant/Solaris10.box.gz
- name: Setup Vagrant VM
- name: Verify Checksum & Add Solaris 10 Box To Vagrant
run: |
cd ansible
ln -sf vagrant/Vagrantfile.Solaris10 Vagrantfile
rm -f id_rsa.pub id_rsa
# Copy the machine's ssh key for the VMs to use, after removing prior files
ssh-keygen -q -f $PWD/id_rsa -t rsa -N ''
vagrant plugin install vagrant-vbguest
vagrant up
vagrantPORT=$(vagrant port | grep host | awk '{ print $4 }')
rm -f playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
echo "[127.0.0.1]:${vagrantPORT}" >> playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
[ ! -d $HOME/.ssh ] && mkdir $HOME/.ssh && chmod 700 $HOME/.ssh
[ ! -r $HOME/.ssh/known_hosts ] && touch $HOME/.ssh/known_hosts && chmod 644 $HOME/.ssh/known_hosts
[ ! -d $HOME/.ansible ] && mkdir $HOME/.ansible
ssh-keygen -R $(cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx)
sed -i -e "s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
awk '{print}/^\[defaults\]$/{print "private_key_file = id_rsa"; print "timeout = 60"; print "remote_tmp = $HOME/.ansible/tmp"}' < ansible.cfg > ansible.cfg.tmp && mv ansible.cfg.tmp ansible.cfg
echo "1"
pwd
echo "2"
ls -ltr
# CKSUM=`shasum -a 256 ./Solaris10.box.gz|cut -d" " -f1`
# if [ "$CKSUM" = "0879215f4bf03f5e125addb139d0b5a49a4f8a258297b765cf1f22a8a7ee3309" ]
# then
# echo "Checksum OK"
# gunzip Solaris10.box.gz
# vagrant box add --name="solaris10" ./Solaris10.box
# rm Solaris10.box
# else
# echo "Sum Bad"
# exit 99;
# fi
# fi
- name: Run Ansible Playbook
run: |
cd ansible
ansible-playbook -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx --ssh-common-args='-o HostKeyAlgorithms=ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 -o PubKeyAcceptedKeyTypes=ssh-rsa' -u vagrant -b --skip-tags adoptopenjdk,cups playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
# - name: Setup Vagrant VM
# run: |
# cd ansible
# ln -sf vagrant/Vagrantfile.Solaris10 Vagrantfile
# rm -f id_rsa.pub id_rsa
# # Copy the machine's ssh key for the VMs to use, after removing prior files
# ssh-keygen -q -f $PWD/id_rsa -t rsa -N ''
# vagrant plugin install vagrant-vbguest
# vagrant up
# vagrantPORT=$(vagrant port | grep host | awk '{ print $4 }')
# rm -f playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
# echo "[127.0.0.1]:${vagrantPORT}" >> playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
# [ ! -d $HOME/.ssh ] && mkdir $HOME/.ssh && chmod 700 $HOME/.ssh
# [ ! -r $HOME/.ssh/known_hosts ] && touch $HOME/.ssh/known_hosts && chmod 644 $HOME/.ssh/known_hosts
# [ ! -d $HOME/.ansible ] && mkdir $HOME/.ansible
# ssh-keygen -R $(cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx)
# sed -i -e "s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
# awk '{print}/^\[defaults\]$/{print "private_key_file = id_rsa"; print "timeout = 60"; print "remote_tmp = $HOME/.ansible/tmp"}' < ansible.cfg > ansible.cfg.tmp && mv ansible.cfg.tmp ansible.cfg
#
# - name: Run Ansible Playbook
# run: |
# cd ansible
# ansible-playbook -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx --ssh-common-args='-o HostKeyAlgorithms=ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 -o PubKeyAcceptedKeyTypes=ssh-rsa' -u vagrant -b --skip-tags adoptopenjdk,cups playbooks/AdoptOpenJDK_Unix_Playbook/main.yml

0 comments on commit 42294e4

Please sign in to comment.