diff --git a/support/openshift/init-openshift.ps1 b/support/openshift/init-openshift.ps1 deleted file mode 100755 index 1a0d28f..0000000 --- a/support/openshift/init-openshift.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -. .\init-properties.ps1 - -if ((Get-Command "oc" -ErrorAction SilentlyContinue) -eq $null) -{ - Write-Output "The oc client tools need to be installed to connect to OpenShift." - Write-Output "Download it from https://www.openshift.org/download.html and confirm that ""oc version"" runs.`n" - exit -} - -Function Write-Host-Header($echo) { - Write-Output "" - Write-Output "########################################################################" - Write-Output "$echo" - Write-Output "########################################################################" -} - -$PRJ_DEMO="rhpam7-install" -$PRJ_DEMO_NAME=((./support/openshift/provision.ps1 info $PRJ_DEMO 2>&1 | Select-String -Pattern "Project name") -split "\s+")[2] - -# Check if the project exists -#oc get project $PRJ_DEMO_NAME > $null 2>&1 -oc get project $PRJ_DEMO_NAME > $null 2>&1 -$PRJ_EXISTS=$? - -if ($PRJ_EXISTS) { - Write-Output "$PRJ_DEMO_NAME already exists. Deleting project." - ./support/openshift/provision.ps1 -command delete -demo $PRJ_DEMO - - # Wait until the project has been removed. - Write-Output "Waiting for OpenShift to clean deleted project." - Start-Sleep -s 20 -} - -Write-Output "Provisioning $PRJ_DEMO_NAME." -./support/openshift/provision.ps1 -command setup -demo $PRJ_DEMO -with-imagestreams -Write-Output "Setup completed." diff --git a/support/openshift/init-openshift.sh b/support/openshift/init-openshift.sh deleted file mode 100755 index a92411e..0000000 --- a/support/openshift/init-openshift.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -. ./init-properties.sh - -command -v oc >/dev/null 2>&1 || { - echo >&2 "The oc client tools need to be installed to connect to OpenShift."; - echo >&2 "Download it from https://www.openshift.org/download.html and confirm that \"oc version\" runs."; - exit 1; -} - -function echo_header() { - echo - echo "########################################################################" - echo $1 - echo "########################################################################" -} - -PRJ_DEMO="rhpam7-install" -PRJ_DEMO_NAME=$(./support/openshift/provision.sh info $PRJ_DEMO | awk '/Project name/{print $3}') - -# Check if the project exists -oc get project $PRJ_DEMO_NAME > /dev/null 2>&1 -PRJ_EXISTS=$? - -if [ $PRJ_EXISTS -eq 0 ]; then - echo_header "$PRJ_DEMO_NAME project already exists. Deleting project." - ./support/openshift/provision.sh delete $PRJ_DEMO - # Wait until the project has been removed - echo_header "Waiting for OpenShift to clean deleted project." - sleep 20 -else if [ ! $PRJ_EXISTS -eq 1 ]; then - echo "An error occurred communicating with your OpenShift instance." - echo "Please make sure that your logged in to your OpenShift instance with your 'oc' client." - exit 1 - fi -fi - -echo_header "Provisioning $PRJ_DEMO_NAME." -./support/openshift/provision.sh setup $PRJ_DEMO --with-imagestreams -echo_header "Setup completed."