Fixing CircleCI Build Steps
This commit is contained in:
3
Vagrant/Vagrantfile
vendored
3
Vagrant/Vagrantfile
vendored
@@ -79,6 +79,7 @@ Vagrant.configure("2") do |config|
|
|||||||
cfg.vm.provision "shell", inline: 'wevtutil el | Select-String -notmatch "Microsoft-Windows-LiveId" | Foreach-Object {wevtutil cl "$_"}', privileged: false
|
cfg.vm.provision "shell", inline: 'wevtutil el | Select-String -notmatch "Microsoft-Windows-LiveId" | Foreach-Object {wevtutil cl "$_"}', privileged: false
|
||||||
cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false
|
cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false
|
||||||
cfg.vm.provision "shell", inline: 'cscript c:\windows\system32\slmgr.vbs /dlv', privileged: false
|
cfg.vm.provision "shell", inline: 'cscript c:\windows\system32\slmgr.vbs /dlv', privileged: false
|
||||||
|
cfg.vm.provision "shell", inline: 'Write-Host "DC Provisioning Complete!"', privileged: false
|
||||||
|
|
||||||
cfg.vm.provider "vmware_desktop" do |v, override|
|
cfg.vm.provider "vmware_desktop" do |v, override|
|
||||||
v.vmx["displayname"] = "dc.windomain.local"
|
v.vmx["displayname"] = "dc.windomain.local"
|
||||||
@@ -146,6 +147,7 @@ Vagrant.configure("2") do |config|
|
|||||||
cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false
|
cfg.vm.provision "shell", inline: "Set-SmbServerConfiguration -AuditSmb1Access $true -Force", privileged: false
|
||||||
cfg.vm.provision "shell", path: "scripts/install-microsoft-ata.ps1", privileged: false
|
cfg.vm.provision "shell", path: "scripts/install-microsoft-ata.ps1", privileged: false
|
||||||
cfg.vm.provision "shell", inline: 'cscript c:\windows\system32\slmgr.vbs /dlv', privileged: false
|
cfg.vm.provision "shell", inline: 'cscript c:\windows\system32\slmgr.vbs /dlv', privileged: false
|
||||||
|
cfg.vm.provision "shell", inline: 'Write-Host "WEF Provisioning Complete!"', privileged: false
|
||||||
|
|
||||||
cfg.vm.provider "vmware_desktop" do |v, override|
|
cfg.vm.provider "vmware_desktop" do |v, override|
|
||||||
v.vmx["displayname"] = "wef.windomain.local"
|
v.vmx["displayname"] = "wef.windomain.local"
|
||||||
@@ -204,6 +206,7 @@ Vagrant.configure("2") do |config|
|
|||||||
cfg.vm.provision "shell", path: "scripts/install-velociraptor.ps1", privileged: false
|
cfg.vm.provision "shell", path: "scripts/install-velociraptor.ps1", privileged: false
|
||||||
cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false
|
cfg.vm.provision "shell", path: "scripts/install-autorunstowineventlog.ps1", privileged: false
|
||||||
cfg.vm.provision "shell", inline: 'cscript c:\windows\system32\slmgr.vbs /dlv', privileged: false
|
cfg.vm.provision "shell", inline: 'cscript c:\windows\system32\slmgr.vbs /dlv', privileged: false
|
||||||
|
cfg.vm.provision "shell", inline: 'Write-Host "WIN10 Provisioning Complete!"', privileged: false
|
||||||
|
|
||||||
cfg.vm.provider "vmware_desktop" do |v, override|
|
cfg.vm.provider "vmware_desktop" do |v, override|
|
||||||
v.vmx["displayname"] = "win10.windomain.local"
|
v.vmx["displayname"] = "win10.windomain.local"
|
||||||
|
|||||||
@@ -550,6 +550,7 @@ main() {
|
|||||||
install_zeek
|
install_zeek
|
||||||
install_guacamole
|
install_guacamole
|
||||||
postinstall_tasks
|
postinstall_tasks
|
||||||
|
echo "Logger Provisioning Complete!"
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
@@ -113,4 +113,25 @@ fi
|
|||||||
# Start the build in a tmux session
|
# Start the build in a tmux session
|
||||||
sn=tmuxsession
|
sn=tmuxsession
|
||||||
tmux new-session -s "$sn" -d
|
tmux new-session -s "$sn" -d
|
||||||
tmux send-keys -t "$sn:0" 'cd /opt/DetectionLab/Vagrant && vagrant up | tee -a vagrant_up_all.log && echo "success" > /var/www/html/index.html || echo "failed" > /var/www/html/index.html; umount /mnt && /usr/local/bin/packet-block-storage-detach' Enter
|
tmux send-keys -t "$sn:0" 'for host in logger dc wef win10; do vagrant up $host | tee -a vagrant_up_$host.log; COMPLETE="$(grep -ci "$host Provisioning Complete" vagrant_up_$host.log)"; echo "Complete is $COMPLETE for $host" ; if [ "$COMPLETE" -lt 1 ]; then echo "failed" > /var/www/html/index.html; break; fi; done; ALL_SUCCESS="$(grep -ci "Provisioning Complete" vagrant_up_*.log | cut -d : -f 2 | awk '"'"'{ sum += $1 } END { print sum }'"'"')"; echo "All success is $ALL_SUCCESS"; if [ "$ALL_SUCCESS" -eq 4 ]; then echo "success" > /var/www/html/index.html; else echo "failed" > /var/www/html/index.html; fi' Enter
|
||||||
|
|
||||||
|
|
||||||
|
# Expanding the send-keys command
|
||||||
|
# Vagrant isn't great about return codes, so we'll hack this up for now
|
||||||
|
# for host in logger dc wef win10;
|
||||||
|
# do
|
||||||
|
# vagrant up $host | tee -a vagrant_up_$host.log
|
||||||
|
# COMPLETE="$(grep -ci "$host Provisioning Complete" vagrant_up_$host.log)"
|
||||||
|
# echo "Complete is $COMPLETE for $host"
|
||||||
|
# if [ "$COMPLETE" -lt 1 ]; then
|
||||||
|
# echo "failed" > /var/www/html/index.html
|
||||||
|
# break
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
# ALL_SUCCESS="$(grep -ci "Provisioning Complete" vagrant_up_*.log | cut -d : -f 2 | awk '"'"'{ sum += $1 } END { print sum }'"'"')"
|
||||||
|
# echo "All success is $ALL_SUCCESS"
|
||||||
|
# if [ "$ALL_SUCCESS" -eq 4 ]; then
|
||||||
|
# echo "success" > /var/www/html/index.html
|
||||||
|
# else
|
||||||
|
# echo "failed" > /var/www/html/index.html
|
||||||
|
# fi
|
||||||
Reference in New Issue
Block a user