@@ -19,39 +19,53 @@ permissions:
1919jobs :
2020 build-solaris :
2121 name : Solaris
22- runs-on : macos-12
22+ runs-on : ubuntu-latest
2323 steps :
2424
25- - uses : actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3 .1.0
25+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 .1.1
2626
27- - name : Install dependencies
28- run : |
29- brew install ansible
27+ - name : Install Ansible
28+ run : sudo apt-get install ansible
29+
30+ - name : Install VirtualBox
31+ run : sudo apt-get install virtualbox
32+
33+ - name : Install Vagrant
34+ run : sudo apt-get install vagrant
35+
36+ - name : Cache Solaris10.box
37+ id : solaris-10-cache
38+ uses : actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
39+ with :
40+ path : Solaris10.box
41+ key : sol10boxcache
3042
31- - name : Install Solaris 10 Box If Not Already Present
43+ - name : Download Solaris 10 Box If Cache Misses
44+ if : steps.solaris-10-cache.outputs.cache-hit != 'true'
45+ run : wget https://ci.adoptium.net/userContent/vagrant/Solaris10.box.gz
46+
47+ - name : Verify Checksum If Cache Misses
48+ if : steps.solaris-10-cache.outputs.cache-hit != 'true'
3249 run : |
33- if [ `vagrant box list|grep ^solaris10|wc -l` -gt 0 ]
50+ CKSUM=`shasum -a 256 ./Solaris10.box.gz|cut -d" " -f1`
51+ if [ "$CKSUM" = "0879215f4bf03f5e125addb139d0b5a49a4f8a258297b765cf1f22a8a7ee3309" ]
3452 then
35- echo "Box Exists - Do Nothing "
53+ echo "Checksum OK "
3654 else
37- echo "No Box - Download From Jenkins And Import"
38- wget https://ci.adoptium.net/userContent/vagrant/Solaris10.box.gz
39- CKSUM=`shasum -a 256 ./Solaris10.box.gz|cut -d" " -f1`
40- if [ "$CKSUM" = "0879215f4bf03f5e125addb139d0b5a49a4f8a258297b765cf1f22a8a7ee3309" ]
41- then
42- echo "Checksum OK"
43- gunzip Solaris10.box.gz
44- vagrant box add --name="solaris10" ./Solaris10.box
45- rm Solaris10.box
46- else
47- echo "Sum Bad"
48- exit 99;
49- fi
55+ echo "Sum Bad"
56+ exit 99;
5057 fi
5158
59+ - name : Extract Solaris10.box.gz If Cache Misses
60+ if : steps.solaris-10-cache.outputs.cache-hit != 'true'
61+ run : gunzip Solaris10.box.gz
62+
63+ - name : Add Solaris 10 Box To Vagrant
64+ run : vagrant box add --name="solaris10" ./Solaris10.box
65+
5266 - name : Setup Vagrant VM
67+ working-directory : ansible
5368 run : |
54- cd ansible
5569 ln -sf vagrant/Vagrantfile.Solaris10 Vagrantfile
5670 rm -f id_rsa.pub id_rsa
5771 # Copy the machine's ssh key for the VMs to use, after removing prior files
@@ -61,12 +75,13 @@ jobs:
6175 vagrantPORT=$(vagrant port | grep host | awk '{ print $4 }')
6276 rm -f playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
6377 echo "[127.0.0.1]:${vagrantPORT}" >> playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
78+ [ ! -d $HOME/.ssh ] && mkdir $HOME/.ssh && chmod 700 $HOME/.ssh
6479 [ ! -r $HOME/.ssh/known_hosts ] && touch $HOME/.ssh/known_hosts && chmod 644 $HOME/.ssh/known_hosts
80+ [ ! -d $HOME/.ansible ] && mkdir $HOME/.ansible
6581 ssh-keygen -R $(cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx)
6682 sed -i -e "s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
6783 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
6884
6985 - name : Run Ansible Playbook
70- run : |
71- cd ansible
72- ansible-playbook -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx --ssh-common-args='-o StrictHostKeyChecking=no -o HostKeyAlgorithms=ssh-rsa' -u vagrant -b --skip-tags adoptopenjdk,cups playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
86+ working-directory : ansible
87+ run : 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 commit comments