Fixing CircleCI Build Steps

This commit is contained in:
Chris Long
2020-10-29 23:28:51 -07:00
parent 892978fd2e
commit fce294c7b0
3 changed files with 26 additions and 1 deletions

3
Vagrant/Vagrantfile vendored
View File

@@ -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: "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: 'Write-Host "DC Provisioning Complete!"', privileged: false
cfg.vm.provider "vmware_desktop" do |v, override|
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", 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: 'Write-Host "WEF Provisioning Complete!"', privileged: false
cfg.vm.provider "vmware_desktop" do |v, override|
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-autorunstowineventlog.ps1", 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|
v.vmx["displayname"] = "win10.windomain.local"

View File

@@ -550,6 +550,7 @@ main() {
install_zeek
install_guacamole
postinstall_tasks
echo "Logger Provisioning Complete!"
}
main

View File

@@ -113,4 +113,25 @@ fi
# Start the build in a tmux session
sn=tmuxsession
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