From 3de77b958d6c7457682f48aac7274f5aad0dba8d Mon Sep 17 00:00:00 2001 From: Craig Walls Date: Tue, 30 Apr 2019 11:04:56 -0600 Subject: [PATCH 1/2] Powershell deployment script --- scripts/deploy.psl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/deploy.psl diff --git a/scripts/deploy.psl b/scripts/deploy.psl new file mode 100644 index 0000000..7e047a9 --- /dev/null +++ b/scripts/deploy.psl @@ -0,0 +1,28 @@ +if (!$args) { + Write-Output "Please provide the path to the application archive." + exit 1 +} + +$cfmOutput=(cf m) | Out-String + +if ($cfmOutput -like "*p.config-server*") { + $serviceName = "p.config-server" +} elseif ($cfmOutput -like "*p-config-server*") { + $serviceName = "p-config-server" +} else { + Write-Output "Can't find SCS Config Server in marketplace. Have you installed the SCS Tile?" + exit 1 +} + +$configJson = "`"{\`"git\`":{\`"uri\`":\`"https://github.com/spring-cloud-services-samples/cook-config\`",\`"label\`":\`"master\`"}}`"" +cf create-service $serviceName standard cook-config-server -c $configJson + +do { + $createStatus=(cf service cook-config-server) | Out-String -stream | Select-String -Pattern "Status" -CaseSensitive -SimpleMatch + Write-Progress -Activity "Creating Config Server..." -Status $createStatus +} +until($createStatus -like "*succeeded*") + +Write-Output "Config Server created. Pushing application." +cf push -p $args[0] +Write-Output "Done!" From e59844a6c854f1ab538c0df78d355806eb742752 Mon Sep 17 00:00:00 2001 From: Craig Walls Date: Tue, 30 Apr 2019 11:09:10 -0600 Subject: [PATCH 2/2] Renamed script to conventional ps1 extension --- scripts/{deploy.psl => deploy.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{deploy.psl => deploy.ps1} (100%) diff --git a/scripts/deploy.psl b/scripts/deploy.ps1 similarity index 100% rename from scripts/deploy.psl rename to scripts/deploy.ps1