From abd6430b4e5cc5a684f19f4b0e9fd65c0815d135 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 24 Jan 2019 10:58:30 +0100 Subject: [PATCH 01/31] added msba --- env/masb/1.11.0/masb.env | 4 + scripts/deploy_masb.sh | 201 +++++++++++++++++++++++++++++++++++++++ templates/masb.yaml | 37 +++++++ 3 files changed, 242 insertions(+) create mode 100644 env/masb/1.11.0/masb.env create mode 100644 scripts/deploy_masb.sh create mode 100644 templates/masb.yaml diff --git a/env/masb/1.11.0/masb.env b/env/masb/1.11.0/masb.env new file mode 100644 index 0000000..fd5cf67 --- /dev/null +++ b/env/masb/1.11.0/masb.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_OSBA_VERSION="1.11.0" +RELEASE_ID="282392" +PRODUCT_SLUG="azure-service-broker" \ No newline at end of file diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh new file mode 100644 index 0000000..23ade58 --- /dev/null +++ b/scripts/deploy_masb.sh @@ -0,0 +1,201 @@ +#!/usr/bin/env bash +source ~/.env.sh +cd ${HOME_DIR} +MYSELF=$(basename $0) +mkdir -p ${HOME_DIR}/logs +exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +exec 2>&1 +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" +case $key in + -n|--NO_DOWNLOAD) + NO_DOWNLOAD=TRUE + echo "No download is ${NO_DOWNLOAD}" + # shift # past value if arg value + ;; + -d|--DO_NOT_APPLY_CHANGES) + NO_APPLY=TRUE + echo "No APPLY is ${NO_APPLY}" + # shift # past value ia arg value + ;; + -nodb|--DO_NOT_CREATE_SQLDB_INSTANCE) + NO_SQLDB=TRUE + echo "No SQL DB CREATION is ${NO_SQLDB}" + # shift # past value ia arg value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +shift +done +set -- "${POSITIONAL[@]}" # restore positional parameters + + +export OM_TARGET=${PCF_OPSMAN_FQDN} +export OM_USERNAME=${PCF_OPSMAN_USERNAME} +export OM_PASSWORD="${PCF_PIVNET_UAA_TOKEN}" +START_OSBA_DEPLOY_TIME=$(date) +$(cat <<-EOF >> ${HOME_DIR}/.env.sh +START_OSBA_DEPLOY_TIME="${START_OSBA_DEPLOY_TIME}" +EOF +) + +source ~/masb.env + +PIVNET_ACCESS_TOKEN=$(curl \ + --fail \ + --header "Content-Type: application/json" \ + --data "{\"refresh_token\": \"${PCF_PIVNET_UAA_TOKEN}\"}" \ + https://network.pivotal.io/api/v2/authentication/access_tokens |\ + jq -r '.access_token') + +RELEASE_JSON=$(curl \ + --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ + --fail \ + "https://network.pivotal.io/api/v2/products/${PRODUCT_SLUG}/releases/${RELEASE_ID}") +# eula acceptance link +EULA_ACCEPTANCE_URL=$(echo ${RELEASE_JSON} |\ + jq -r '._links.eula_acceptance.href') + +DOWNLOAD_DIR_FULL=${DOWNLOAD_DIR}/${PRODUCT_SLUG}/${PCF_OSBA_VERSION} +mkdir -p ${DOWNLOAD_DIR_FULL} + +curl \ + --fail \ + --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ + --request POST \ + ${EULA_ACCEPTANCE_URL} + + +# download product using om cli +if [ -z ${NO_DOWNLOAD} ] ; then +echo "$(date) start downloading ${PRODUCT_SLUG}" + +om --skip-ssl-validation \ + download-product \ + --pivnet-api-token ${PCF_PIVNET_UAA_TOKEN} \ + --pivnet-file-glob "*.pivotal" \ + --pivnet-product-slug ${PRODUCT_SLUG} \ + --product-version ${PCF_OSBA_VERSION} \ + --stemcell-iaas azure \ + --download-stemcell \ + --output-directory ${DOWNLOAD_DIR_FULL} +echo "$(date) end downloading ${PRODUCT_SLUG}" +else +echo "ignoring download by user " +fi + +TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') +STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') + +# Import the tile to Ops Manager. +echo "$(date) start uploading ${PRODUCT_SLUG}" +om --skip-ssl-validation \ + --request-timeout 3600 \ + upload-product \ + --product ${TARGET_FILENAME} + +echo "$(date) end uploading ${PRODUCT_SLUG}" + + # 1. Find the version of the product that was imported. +PRODUCTS=$(om --skip-ssl-validation \ + available-products \ + --format json) + +VERSION=$(echo ${PRODUCTS} |\ + jq --arg product_name ${PRODUCT_SLUG} -r 'map(select(.name==$product_name)) | first | .version') + + +# 2. Stage using om cli +echo "$(date) start staging ${PRODUCT_SLUG}" +om --skip-ssl-validation \ + stage-product \ + --product-name ${PRODUCT_SLUG} \ + --product-version ${VERSION} +echo "$(date) end staging ${PRODUCT_SLUG}" + + +echo "$(date) start creating ${ENV_SHORT_NAME}sql" + +az login --service-principal \ + --username ${AZURE_CLIENT_ID} \ + --password ${AZURE_CLIENT_SECRET} \ + --tenant ${AZURE_TENANT_ID} + +if [ -z ${NO_SQLDB} ] ; then + MY_SQLDB_SERVER=$(az sql server create \ + --admin-password $PCF_PIVNET_UAA_TOKEN \ + --admin-user sqladmin \ + --location ${LOCATION} \ + --name ${ENV_SHORT_NAME}sql \ + --resource-group ${ENV_NAME}) + + + while [[ $(az sql server show \ + --name ${ENV_SHORT_NAME}sql \ + --resource-group ${ENV_NAME} \ + --out tsv \ + --query state) != 'Ready' ]]; do + echo "SQL still not finished provisioning. Trying again in 20 seconds." + sleep 20 + if [[ $(az sql server show \ + --name ${ENV_SHORT_NAME}sql \ + --resource-group ${ENV_NAME} \ + --out tsv \ + --query provisioningState) == 'failed' ]]; then + echo "SQL Provisioning failed." + exit 1 + fi + done + echo "sql provisioned." + echo "$(date) end creating ${ENV_SHORT_NAME}sql" + echo "$(date) creating Dadabase masb${ENV_SHORT_NAME}sql" + az sql db create \ + --resource-group ${ENV_NAME} \ + --server ${ENV_SHORT_NAME}sql \ + --resource-group ${ENV_NAME} \ + --name masb${ENV_SHORT_NAME}sql + echo "$(date) end creating Dadabase masb${ENV_SHORT_NAME}sql" +else +MY_SQLDB_SERVER=$(az sql server show \ + --name ${ENV_SHORT_NAME}sql \ + --resource-group ${ENV_NAME}) +fi + + +cat << EOF > ~/masb_vars.yaml +product_name: ${PRODUCT_SLUG} +pcf_pas_network: pcf-pas-subnet +pcf_service_network: pcf-services-subnet +azure_subscription_id: ${AZURE_SUBSCRIPTION_ID} +azure_tenant_id: ${AZURE_TENANT_ID} +azure_client_id: ${AZURE_CLIENT_ID} +azure_client_secret: ${AZURE_CLIENT_SECRET} +azure_broker_database_server: ${ENV_SHORT_NAME}sql.database.windows.net +azure_broker_database_name: masb${ENV_SHORT_NAME}sql +azure_broker_database_password: ${PCF_PIVNET_UAA_TOKEN} +azure_broker_database_encryption_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) +EOF + +om --skip-ssl-validation \ + configure-product \ + -c ${HOME_DIR}/masb.yaml -l ${HOME_DIR}/masb_vars.yaml + +om --skip-ssl-validation \ +upload-stemcell \ +--stemcell ${STEMCELL_FILENAME} + +echo "$(date) start apply ${PRODUCT_SLUG}" + +if [ -z ${NO_APPLY} ] ; then +om --skip-ssl-validation \ + apply-changes \ + --product-name ${PRODUCT_SLUG} +else +echo "No Product Apply" +fi +echo "$(date) end apply ${PRODUCT_SLUG}" \ No newline at end of file diff --git a/templates/masb.yaml b/templates/masb.yaml new file mode 100644 index 0000000..2d8b0d1 --- /dev/null +++ b/templates/masb.yaml @@ -0,0 +1,37 @@ +product-name: ((product_name)) +network-properties: + network: + name: ((pcf_pas_network)) + other_availability_zones: + - name: "null" + singleton_availability_zone: + name: "null" +product-properties: + .properties.environment: + value: AzureCloud + .properties.subscription_id: + value: ((azure_subscription_id)) + .properties.tenant_id: + value: ((azure_tenant_id)) + .properties.client_id: + value: ((azure_client_id)) + .properties.client_secret: + value: + secret: ((azure_client_secret)) + .properties.azure_broker_database_provider: + value: sqlserver + .properties.azure_broker_database_server: + value: ((azure_broker_database_server)) + .properties.azure_broker_database_user: + value: sqladmin + .properties.azure_broker_database_name: + value: ((azure_broker_database_name)) + .properties.azure_broker_database_password: + value: + secret: ((azure_broker_database_password)) + .properties.azure_broker_database_name: + value: ((azure_broker_database_name)) + .properties.azure_broker_database_encryption_key: + value: + secret: ((azure_broker_database_encryption_key)) + From e9b56dc0c18bd1814b8d428bb3827ca39856482f Mon Sep 17 00:00:00 2001 From: bottkars Date: Sun, 27 Jan 2019 18:26:53 +0100 Subject: [PATCH 02/31] bumped to om 0.51 --- scripts/deploy_base.sh | 2 +- templates/director_config.yaml | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index 52f667e..deee98f 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -139,7 +139,7 @@ wget -O terraform.zip https://releases.hashicorp.com/terraform/0.11.8/terraform_ unzip terraform.zip && \ sudo mv terraform /usr/local/bin -wget -O om https://github.com/pivotal-cf/om/releases/download/0.48.0/om-linux && \ +wget -O om https://github.com/pivotal-cf/om/releases/download/0.51.0/om-linux && \ chmod +x om && \ sudo mv om /usr/local/bin/ diff --git a/templates/director_config.yaml b/templates/director_config.yaml index b534426..44cc006 100644 --- a/templates/director_config.yaml +++ b/templates/director_config.yaml @@ -1,17 +1,18 @@ --- -director-configuration: - max_threads: 8 - ntp_servers_string: ((ntp_servers_string)) -iaas-configuration: - subscription_id: ((subscription_id)) - tenant_id: ((tenant_id)) - client_id: ((client_id)) - client_secret: ((client_secret)) - resource_group_name: ((resource_group_name)) - bosh_storage_account_name: ((bosh_storage_account_name)) - default_security_group: ((default_security_group)) - ssh_public_key: ((ssh_public_key)) - ssh_private_key: ((ssh_private_key)) +properties-configuration: + director_configuration: + max_threads: 8 + ntp_servers_string: ((ntp_servers_string)) + iaas_configuration: + subscription_id: ((subscription_id)) + tenant_id: ((tenant_id)) + client_id: ((client_id)) + client_secret: ((client_secret)) + resource_group_name: ((resource_group_name)) + bosh_storage_account_name: ((bosh_storage_account_name)) + default_security_group: ((default_security_group)) + ssh_public_key: ((ssh_public_key)) + ssh_private_key: ((ssh_private_key)) networks-configuration: icmp_checks_enabled: false networks: From 519215d6c3f17568c8dea3d3017b921029ad8e84 Mon Sep 17 00:00:00 2001 From: bottkars Date: Tue, 29 Jan 2019 13:13:00 +0100 Subject: [PATCH 03/31] forced eula acceptance for 170 mand 97 stemcells --- scripts/deploy_pas.sh | 44 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index a8be6c5..d24907c 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -81,6 +81,42 @@ PIVNET_ACCESS_TOKEN=$(curl \ https://network.pivotal.io/api/v2/authentication/access_tokens |\ jq -r '.access_token') + +## accept 170er stemcells +RELEASE_JSON=$(curl \ + --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ + --fail \ + "https://network.pivotal.io/api/v2/products/233/releases/286469") +# eula acceptance link +EULA_ACCEPTANCE_URL=$(echo ${RELEASE_JSON} |\ + jq -r '._links.eula_acceptance.href') + +# eula acceptance +curl \ + --fail \ + --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ + --request POST \ + ${EULA_ACCEPTANCE_URL} + + +## accept 97er stemcells +RELEASE_JSON=$(curl \ + --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ + --fail \ + "https://network.pivotal.io/api/v2/products/233/releases/162133") +# eula acceptance link +EULA_ACCEPTANCE_URL=$(echo ${RELEASE_JSON} |\ + jq -r '._links.eula_acceptance.href') + +# eula acceptance +curl \ + --fail \ + --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ + --request POST \ + ${EULA_ACCEPTANCE_URL} + + + # release by slug RELEASE_JSON=$(curl \ --header "Authorization: Bearer ${PIVNET_ACCESS_TOKEN}" \ @@ -90,9 +126,6 @@ RELEASE_JSON=$(curl \ EULA_ACCEPTANCE_URL=$(echo ${RELEASE_JSON} |\ jq -r '._links.eula_acceptance.href') - -DOWNLOAD_DIR_FULL=${DOWNLOAD_DIR}/$PRODUCT_SLUG/${PCF_PAS_VERSION}-${PAS_EDITION} -mkdir -p ${DOWNLOAD_DIR_FULL} # eula acceptance curl \ --fail \ @@ -100,6 +133,11 @@ curl \ --request POST \ ${EULA_ACCEPTANCE_URL} + +DOWNLOAD_DIR_FULL=${DOWNLOAD_DIR}/$PRODUCT_SLUG/${PCF_PAS_VERSION}-${PAS_EDITION} +mkdir -p ${DOWNLOAD_DIR_FULL} + + # download product using om cli if [ -z ${NO_DOWNLOAD} ] ; then echo $(date) start downloading ${PRODUCT_SLUG} From 56a51d75488333424405cce89911e767e198af74 Mon Sep 17 00:00:00 2001 From: bottkars Date: Wed, 30 Jan 2019 11:33:24 +0100 Subject: [PATCH 04/31] testing to 10.20 --- azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azuredeploy.json b/azuredeploy.json index 8bfd650..1afae95 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -98,7 +98,7 @@ "net16bitmask": { "type": "string", "minLength": "3", - "defaultValue": "10.10", + "defaultValue": "10.20", "metadata": { "description": "first 16 bit of ip range in format xxx.xxx" } From 509c60aa328af2d257706427270b4dbc9424c69f Mon Sep 17 00:00:00 2001 From: bottkars Date: Wed, 30 Jan 2019 11:49:39 +0100 Subject: [PATCH 05/31] readme --- .env.testing.example | 32 ++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 .env.testing.example diff --git a/.env.testing.example b/.env.testing.example new file mode 100644 index 0000000..75bf49f --- /dev/null +++ b/.env.testing.example @@ -0,0 +1,32 @@ +IAAS=azure +JUMPBOX_RG=testPCFJUMPBOX +JUMPBOX_NAME=testpcfjumpbox +ADMIN_USERNAME=ubuntu +AZURE_CLIENT_ID=redacted +AZURE_CLIENT_SECRET=redacted +AZURE_REGION=westeurope +AZURE_SUBSCRIPTION_ID=redacted +AZURE_TENANT_ID=redacted +PCF_PIVNET_UAA_TOKEN=redacted +ENV_NAME=testpcf +ENV_SHORT_NAME=testpcfname +OPS_MANAGER_IMAGE="ops-manager-2.4-build.142.vhd" +PCF_DOMAIN_NAME="xxx.com" +PCF_SUBDOMAIN_NAME="pcfazuretest" +PCF_PAS_VERSION=2.4.1 +PCF_OPSMAN_USERNAME=opsman +PCF_NOTIFICATIONS_EMAIL="xxx@example.com" +PAS_AUTOPILOT="FALSE" +NET_16_BIT_MASK="10.20" +SMTP_ADDRESS="" +SMTP_IDENTITY="a" +SMTP_PASSWORD="" +SMTP_FROM="" +SMTP_PORT="" +SMTP_STARTTLS="" +USE_SELF_CERTS="TRUE" +BRANCH=testing +ARTIFACTS_LOCATION="https://raw.githubusercontent.com/bottkars/pcf-jump-azure/${BRANCH}" +VMSIZE="Standard_DS2_v2" +PAS_EDITION="srt" +OPS_MANAGER_IMAGE_REGION="westeurope" \ No newline at end of file diff --git a/README.md b/README.md index 73a737d..9490084 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ the full parameter set´s optiional Values like smtp config +example parameter file for testing branch is [here](/.env.testing.example) +example parameter file for master branch is [here](/.env.example) ### validate full ```bash From 05e5c3d45bfd57c7f4063410bf2d8e4f06d46f96 Mon Sep 17 00:00:00 2001 From: bottkars Date: Wed, 30 Jan 2019 12:04:15 +0100 Subject: [PATCH 06/31] zap --- .gitignore | 2 ++ README.md | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9b670ba..9679725 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,7 @@ om_init.1.sh .env scratch.sh .env.dev +.env.testing + azuredeploy.parameters.json azuredeploy.parameters.json diff --git a/README.md b/README.md index 9490084..5c3b67a 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,9 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ the full parameter set´s optiional Values like smtp config -example parameter file for testing branch is [here](/.env.testing.example) +example parameter file for testing branch is [here](/.env.testing.example) example parameter file for master branch is [here](/.env.example) + ### validate full ```bash @@ -151,6 +152,12 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ ### deploy full +:zap: **do not forget to create ssh key for every environment !** + +```bash +ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} +``` + ```bash az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment create --resource-group ${JUMPBOX_RG} \ From aa57a1b54d8c7580baf7cbb370e554824aa5091d Mon Sep 17 00:00:00 2001 From: bottkars Date: Wed, 30 Jan 2019 12:07:03 +0100 Subject: [PATCH 07/31] testing --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5c3b67a..03680f5 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ example parameter file for master branch is [here](/.env.example) ### validate full ```bash +source ~/.env.testing az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment validate --resource-group ${JUMPBOX_RG} \ --template-uri "https://raw.githubusercontent.com/bottkars/pcf-jump-azure/${BRANCH}/azuredeploy.json" \ @@ -155,6 +156,7 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ :zap: **do not forget to create ssh key for every environment !** ```bash +source ~/.env.testing ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} ``` From 9e790226138186b38c01e9a67d774a992bf85cfe Mon Sep 17 00:00:00 2001 From: bottkars Date: Wed, 30 Jan 2019 12:07:51 +0100 Subject: [PATCH 08/31] testing --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 03680f5..6cdfbd4 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ the minimum parameter set uses defaults where possible ### validate minimum ```bash +source ~/.env.testing az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment validate --resource-group ${JUMPBOX_RG} \ --template-uri https://raw.githubusercontent.com/bottkars/pcf-jump-azure/${BRANCH}/azuredeploy.json \ @@ -85,6 +86,13 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ ### deploy minimum +:zap: **do not forget to create ssh key for every environment !** + +```bash +source ~/.env.testing +ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} +``` + ```bash az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment create --resource-group ${JUMPBOX_RG} \ From 74fb177d741013b351a1e87f96caaeb7d513b20e Mon Sep 17 00:00:00 2001 From: bottkars Date: Wed, 30 Jan 2019 13:41:38 +0100 Subject: [PATCH 09/31] added code for tmate --- scripts/deploy_base.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index deee98f..b1619e2 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -131,9 +131,11 @@ sudo apt-key --keyring /etc/apt/trusted.gpg.d/Microsoft.gpg adv \ --keyserver packages.microsoft.com \ --recv-keys BC528686B50D79E339D3721CEB3E94ADBE1229CF -sudo apt-get update +sudo apt install software-properties-common +sudo add-apt-repository ppa:tmate.io/archive --yes +sudo apt update -sudo apt-get install azure-cli && sudo apt --yes install unzip +sudo apt-get install azure-cli unzip tmate --yes wget -O terraform.zip https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip && \ unzip terraform.zip && \ From ffa41ebdcffb0747d165b22b8498f689fe8416e3 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 31 Jan 2019 05:46:36 +0100 Subject: [PATCH 10/31] floating for stemcells --- scripts/deploy_masb.sh | 2 +- scripts/deploy_mysql.sh | 1 + scripts/deploy_osba.sh | 1 + scripts/deploy_pas.sh | 5 +++-- scripts/deploy_rabbit.sh | 1 + scripts/deploy_spring.sh | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 23ade58..80ff046 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -170,7 +170,6 @@ fi cat << EOF > ~/masb_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet -pcf_service_network: pcf-services-subnet azure_subscription_id: ${AZURE_SUBSCRIPTION_ID} azure_tenant_id: ${AZURE_TENANT_ID} azure_client_id: ${AZURE_CLIENT_ID} @@ -187,6 +186,7 @@ om --skip-ssl-validation \ om --skip-ssl-validation \ upload-stemcell \ +--floating=false \ --stemcell ${STEMCELL_FILENAME} echo "$(date) start apply ${PRODUCT_SLUG}" diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index d5db437..b280ec3 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -152,6 +152,7 @@ om --skip-ssl-validation \ om --skip-ssl-validation \ upload-stemcell \ +--floating=false \ --stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index a8cefe0..c03144a 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -185,6 +185,7 @@ om --skip-ssl-validation \ om --skip-ssl-validation \ upload-stemcell \ +--floating=false \ --stemcell ${STEMCELL_FILENAME} echo "$(date) start apply ${PRODUCT_SLUG}" diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index d24907c..3833729 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -208,8 +208,9 @@ om --skip-ssl-validation \ ### om --skip-ssl-validation \ - upload-stemcell \ - --stemcell ${STEMCELL_FILENAME} +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index 6a121ee..68cea2a 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -125,6 +125,7 @@ om --skip-ssl-validation \ om --skip-ssl-validation \ upload-stemcell \ +--floating=false \ --stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index 4201845..319d803 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -125,6 +125,7 @@ om --skip-ssl-validation \ om --skip-ssl-validation \ upload-stemcell \ +--floating=false \ --stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} From ea0b3eef03f277673295eb8fac6a01010b8d5759 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 31 Jan 2019 06:38:55 +0100 Subject: [PATCH 11/31] bumped to cli 5.4.0 --- scripts/deploy_base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index b1619e2..f080e90 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -145,7 +145,7 @@ wget -O om https://github.com/pivotal-cf/om/releases/download/0.51.0/om-linux && chmod +x om && \ sudo mv om /usr/local/bin/ -wget -O bosh https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-5.3.1-linux-amd64 && \ +wget -O bosh https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-5.4.0-linux-amd64 && \ chmod +x bosh && \ sudo mv bosh /usr/local/bin/ From bfe20efd636d4c8bca5545602a4024327b504379 Mon Sep 17 00:00:00 2001 From: bottkars Date: Sat, 2 Feb 2019 00:37:12 +0100 Subject: [PATCH 12/31] bumped to opsman 2.4.3 and pas 2.4.2 --- azuredeploy.json | 9 +++++---- env/pas/2.4.2/pas.env | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 env/pas/2.4.2/pas.env diff --git a/azuredeploy.json b/azuredeploy.json index 1afae95..09ae65e 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -72,11 +72,12 @@ "opsmanImage": { "type": "string", "allowedValues": [ + "ops-manager-2.4-build.145.vhd", "ops-manager-2.4-build.142.vhd", "ops-manager-2.4-build.131.vhd", "ops-manager-2.4-build.117.vhd" ], - "defaultValue": "ops-manager-2.4-build.142.vhd", + "defaultValue": "ops-manager-2.4-build.145.vhd", "metadata": { "description": "latest osmanager image" } @@ -292,17 +293,17 @@ "[concat(variables('baseUri'), '/scripts/deploy_mysql.sh')]", "[concat(variables('baseUri'), '/scripts/deploy_rabbit.sh')]", "[concat(variables('baseUri'), '/scripts/deploy_spring.sh')]", - "[concat(variables('baseUri'), '/scripts/deploy_osba.sh')]", + "[concat(variables('baseUri'), '/scripts/deploy_masb.sh')]", "[concat(variables('baseUri'), '/scripts/cf_startstop.sh')]", "[concat(variables('baseUri'), '/scripts/om_init.sh')]", "[concat(variables('baseUri'), '/templates/pas-',parameters('pasEdition'),'.yaml')]", "[concat(variables('baseUri'), '/templates/mysql.yaml')]", "[concat(variables('baseUri'), '/templates/rabbit.yaml')]", "[concat(variables('baseUri'), '/templates/spring.yaml')]", - "[concat(variables('baseUri'), '/templates/osba.yaml')]", + "[concat(variables('baseUri'), '/templates/masb.yaml')]", "[concat(variables('baseUri'), '/env/mysql.env')]", "[concat(variables('baseUri'), '/env/pas/',parameters('pasVersion'),'/pas.env')]", - "[concat(variables('baseUri'), '/env/osba/0.12.0/osba.env')]", + "[concat(variables('baseUri'), '/env/masb/1.11.0/masb.env')]", "[concat(variables('baseUri'), '/env/rabbit.env')]", "[concat(variables('baseUri'), '/env/spring.env')]", "[concat(variables('baseUri'), '/templates/director_config.yaml')]", diff --git a/env/pas/2.4.2/pas.env b/env/pas/2.4.2/pas.env new file mode 100644 index 0000000..cee94c0 --- /dev/null +++ b/env/pas/2.4.2/pas.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_PAS_VERSION="2.4.2" +RELEASE_ID="281703" +PRODUCT_SLUG="elastic-runtime" \ No newline at end of file From 2ec1400c6f66ab75aa757a628e9c8178d9ac93e0 Mon Sep 17 00:00:00 2001 From: bottkars Date: Sat, 2 Feb 2019 08:53:21 +0100 Subject: [PATCH 13/31] stemcell assign --- scripts/deploy_masb.sh | 20 ++++++++++++++------ scripts/deploy_mysql.sh | 20 +++++++++++++++----- scripts/deploy_osba.sh | 20 +++++++++++++++----- scripts/deploy_pas.sh | 22 +++++++++++++++++----- scripts/deploy_rabbit.sh | 20 +++++++++++++++----- scripts/deploy_spring.sh | 21 +++++++++++++++------ 6 files changed, 91 insertions(+), 32 deletions(-) diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 80ff046..1f5f5a6 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -91,7 +91,7 @@ fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') - +STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo "$(date) start uploading ${PRODUCT_SLUG}" om --skip-ssl-validation \ @@ -118,6 +118,19 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo "$(date) end staging ${PRODUCT_SLUG}" +echo $(date) start uploading ${STEMCELL_FILENAME} +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} +echo $(date) end uploading ${STEMCELL_FILENAME} + +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +om --skip-ssl-validation \ +assign-stemcell \ +--product ${PRODUCT_NAME} \ +--stemcell ${STEMCELL_VERSION} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} echo "$(date) start creating ${ENV_SHORT_NAME}sql" @@ -184,11 +197,6 @@ om --skip-ssl-validation \ configure-product \ -c ${HOME_DIR}/masb.yaml -l ${HOME_DIR}/masb_vars.yaml -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} - echo "$(date) start apply ${PRODUCT_SLUG}" if [ -z ${NO_APPLY} ] ; then diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index b280ec3..b3de2b3 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -86,7 +86,7 @@ fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') - +STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ @@ -113,6 +113,20 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} +echo $(date) start uploading ${STEMCELL_FILENAME} +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} +echo $(date) end uploading ${STEMCELL_FILENAME} + +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +om --skip-ssl-validation \ +assign-stemcell \ +--product ${PRODUCT_NAME} \ +--stemcell ${STEMCELL_VERSION} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} + echo "creating storage account ${ENV_SHORT_NAME}mysqlbackup" az login --service-principal \ @@ -150,10 +164,6 @@ om --skip-ssl-validation \ configure-product \ -c ${HOME_DIR}/mysql.yaml -l ${HOME_DIR}/mysql_vars.yaml -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index c03144a..426b6b2 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -91,7 +91,7 @@ fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') - +STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo "$(date) start uploading ${PRODUCT_SLUG}" om --skip-ssl-validation \ @@ -118,6 +118,19 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo "$(date) end staging ${PRODUCT_SLUG}" +echo $(date) start uploading ${STEMCELL_FILENAME} +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} +echo $(date) end uploading ${STEMCELL_FILENAME} + +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +om --skip-ssl-validation \ +assign-stemcell \ +--product ${PRODUCT_NAME} \ +--stemcell ${STEMCELL_VERSION} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} echo "$(date) start creating ${ENV_SHORT_NAME}redis" @@ -183,10 +196,7 @@ om --skip-ssl-validation \ configure-product \ -c ${HOME_DIR}/osba.yaml -l ${HOME_DIR}/osba_vars.yaml -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} + echo "$(date) start apply ${PRODUCT_SLUG}" diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index 3833729..a88da94 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -157,7 +157,7 @@ fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') - +STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ @@ -183,6 +183,21 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} +echo $(date) start uploading ${STEMCELL_FILENAME} +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} +echo $(date) end uploading ${STEMCELL_FILENAME} + +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +om --skip-ssl-validation \ +assign-stemcell \ +--product ${PRODUCT_NAME} \ +--stemcell ${STEMCELL_VERSION} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} + +echo $(date) start configure ${PRODUCT_NAME} cat << EOF > vars.yaml pcf_pas_network: pcf-pas-subnet pcf_system_domain: ${PCF_SYSTEM_DOMAIN} @@ -206,11 +221,8 @@ om --skip-ssl-validation \ configure-product \ -c ${HOME_DIR}/pas-${PAS_EDITION}.yaml -l vars.yaml ### +echo $(date) end configure ${PRODUCT_NAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index 68cea2a..f8fb410 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -84,7 +84,7 @@ fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') - +STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ @@ -111,6 +111,20 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} +echo $(date) start uploading ${STEMCELL_FILENAME} +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} +echo $(date) end uploading ${STEMCELL_FILENAME} + +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +om --skip-ssl-validation \ +assign-stemcell \ +--product ${PRODUCT_NAME} \ +--stemcell ${STEMCELL_VERSION} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} + cat << EOF > ${HOME_DIR}/rabbit_vars.yaml product_name: ${PRODUCT_SLUG} @@ -123,10 +137,6 @@ om --skip-ssl-validation \ configure-product \ -c ${HOME_DIR}/rabbit.yaml -l ${HOME_DIR}/rabbit_vars.yaml -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index 319d803..ef57642 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -87,8 +87,7 @@ fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') - -# Import the tile to Ops Manager. +STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version')# Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ --request-timeout 3600 \ @@ -114,6 +113,20 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} +echo $(date) start uploading ${STEMCELL_FILENAME} +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell ${STEMCELL_FILENAME} +echo $(date) end uploading ${STEMCELL_FILENAME} + +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +om --skip-ssl-validation \ +assign-stemcell \ +--product ${PRODUCT_NAME} \ +--stemcell ${STEMCELL_VERSION} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} + cat << EOF > ${HOME_DIR}/spring_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet @@ -123,10 +136,6 @@ om --skip-ssl-validation \ configure-product \ -c ${HOME_DIR}/spring.yaml -l ${HOME_DIR}/spring_vars.yaml -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} echo $(date) start apply ${PRODUCT_SLUG} From b0bd84586dddca5a60a396d06b09ebdc092c31c1 Mon Sep 17 00:00:00 2001 From: bottkars Date: Sat, 2 Feb 2019 18:22:46 +0100 Subject: [PATCH 14/31] changed methods --- scripts/deploy_masb.sh | 6 +++--- scripts/deploy_mysql.sh | 6 +++--- scripts/deploy_osba.sh | 6 +++--- scripts/deploy_rabbit.sh | 2 +- scripts/deploy_spring.sh | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 1f5f5a6..126cc6c 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -125,12 +125,12 @@ upload-stemcell \ --stemcell ${STEMCELL_FILENAME} echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ ---product ${PRODUCT_NAME} \ +--product ${PRODUCT_SLUG} \ --stemcell ${STEMCELL_VERSION} -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "$(date) start creating ${ENV_SHORT_NAME}sql" diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index b3de2b3..6e60aeb 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -120,12 +120,12 @@ upload-stemcell \ --stemcell ${STEMCELL_FILENAME} echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ ---product ${PRODUCT_NAME} \ +--product ${PRODUCT_SLUG} \ --stemcell ${STEMCELL_VERSION} -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "creating storage account ${ENV_SHORT_NAME}mysqlbackup" diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index 426b6b2..8e026be 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -125,12 +125,12 @@ upload-stemcell \ --stemcell ${STEMCELL_FILENAME} echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ ---product ${PRODUCT_NAME} \ +--product ${PRODUCT_SLUG} \ --stemcell ${STEMCELL_VERSION} -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "$(date) start creating ${ENV_SHORT_NAME}redis" diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index f8fb410..ec83dc2 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -121,7 +121,7 @@ echo $(date) end uploading ${STEMCELL_FILENAME} echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} om --skip-ssl-validation \ assign-stemcell \ ---product ${PRODUCT_NAME} \ +--product ${PRODUCT_SLUG} \ --stemcell ${STEMCELL_VERSION} echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index ef57642..c7c6ad2 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -120,12 +120,12 @@ upload-stemcell \ --stemcell ${STEMCELL_FILENAME} echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ ---product ${PRODUCT_NAME} \ +--product ${PRODUCT_SLUG} \ --stemcell ${STEMCELL_VERSION} -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} +echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} cat << EOF > ${HOME_DIR}/spring_vars.yaml product_name: ${PRODUCT_SLUG} From 06dbc79ff397434a5342f0ec0c3758364e997e17 Mon Sep 17 00:00:00 2001 From: bottkars Date: Mon, 4 Feb 2019 18:50:04 +0100 Subject: [PATCH 15/31] basic new of latest stemcell --- scripts/deploy_masb.sh | 2 +- scripts/deploy_mysql.sh | 2 +- scripts/deploy_osba.sh | 2 +- scripts/deploy_pas.sh | 2 +- scripts/deploy_rabbit.sh | 2 +- scripts/deploy_spring.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 126cc6c..9c2b2ba 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -129,7 +129,7 @@ echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ ---stemcell ${STEMCELL_VERSION} +--stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "$(date) start creating ${ENV_SHORT_NAME}sql" diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index 6e60aeb..c9945dc 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -124,7 +124,7 @@ echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ ---stemcell ${STEMCELL_VERSION} +--stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "creating storage account ${ENV_SHORT_NAME}mysqlbackup" diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index 8e026be..1a1c055 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -129,7 +129,7 @@ echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ ---stemcell ${STEMCELL_VERSION} +--stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "$(date) start creating ${ENV_SHORT_NAME}redis" diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index a88da94..7e87901 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -194,7 +194,7 @@ echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_NAME} \ ---stemcell ${STEMCELL_VERSION} +--stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} echo $(date) start configure ${PRODUCT_NAME} diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index ec83dc2..027c1a5 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -122,7 +122,7 @@ echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ ---stemcell ${STEMCELL_VERSION} +--stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index c7c6ad2..3a38a80 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -124,7 +124,7 @@ echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ ---stemcell ${STEMCELL_VERSION} +--stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} cat << EOF > ${HOME_DIR}/spring_vars.yaml From bc4a6d138e8d7c8983cf8fd5b6379705c8d182b9 Mon Sep 17 00:00:00 2001 From: bottkars Date: Fri, 15 Feb 2019 16:24:59 +0100 Subject: [PATCH 16/31] updated ones --- .env.example | 4 ++-- .env.testing.example | 2 +- azuredeploy.json | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 92b40cb..aa6c852 100644 --- a/.env.example +++ b/.env.example @@ -10,10 +10,10 @@ AZURE_TENANT_ID=fake your azure tenant PCF_PIVNET_UAA_TOKEN=fave your pivnet refresh token ENV_NAME=yourenv ENV_SHORT_NAME=yourenvshort -OPS_MANAGER_IMAGE="ops-manager-2.4-build.142.vhd" +OPS_MANAGER_IMAGE="ops-manager-2.4-build.152.vhd" PCF_DOMAIN_NAME=yourdomain.com PCF_SUBDOMAIN_NAME=yourpcf -PCF_PAS_VERSION=2.4.1 +PCF_PAS_VERSION=2.4.2 PCF_OPSMAN_USERNAME=opsman PCF_NOTIFICATIONS_EMAIL="example@example.io" PAS_AUTOPILOT="TRUE" diff --git a/.env.testing.example b/.env.testing.example index 75bf49f..d3715a3 100644 --- a/.env.testing.example +++ b/.env.testing.example @@ -19,7 +19,7 @@ PCF_NOTIFICATIONS_EMAIL="xxx@example.com" PAS_AUTOPILOT="FALSE" NET_16_BIT_MASK="10.20" SMTP_ADDRESS="" -SMTP_IDENTITY="a" +SMTP_IDENTITY="" SMTP_PASSWORD="" SMTP_FROM="" SMTP_PORT="" diff --git a/azuredeploy.json b/azuredeploy.json index 09ae65e..ac7b429 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -72,12 +72,13 @@ "opsmanImage": { "type": "string", "allowedValues": [ + "ops-manager-2.4-build.152.vhd", "ops-manager-2.4-build.145.vhd", "ops-manager-2.4-build.142.vhd", "ops-manager-2.4-build.131.vhd", "ops-manager-2.4-build.117.vhd" - ], - "defaultValue": "ops-manager-2.4-build.145.vhd", + ], + "defaultValue": "ops-manager-2.4-build.152.vhd", "metadata": { "description": "latest osmanager image" } From f664016ecffe5212ab1d3eb6dea266fef4e5fc9c Mon Sep 17 00:00:00 2001 From: bottkars Date: Fri, 15 Feb 2019 17:39:19 +0100 Subject: [PATCH 17/31] testing --- azuredeploy.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azuredeploy.json b/azuredeploy.json index ac7b429..ba2e1ca 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -204,8 +204,9 @@ }, "pasVersion": { "type": "string", - "defaultValue": "2.4.1", + "defaultValue": "2.4.2", "allowedValues": [ + "2.4.2", "2.4.1", "2.4.0" ] From 47cf32e3c4224c1ed123a4105b9e1a9d9013f755 Mon Sep 17 00:00:00 2001 From: bottkars Date: Fri, 15 Feb 2019 18:34:13 +0100 Subject: [PATCH 18/31] forcing self certs --- scripts/deploy_pas.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index 7e87901..5790e05 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -38,8 +38,8 @@ declare -a FILES=("${HOME_DIR}/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}.key" \ "${HOME_DIR}/fullchain.cer") for FILE in "${FILES[@]}"; do if [ ! -f $FILE ]; then - echo "$FILE not found. Please run create_self_certs.sh " - exit + echo "$FILE not found. running Create Self Certs " + ${HOME_DIR}/create_self_certs.sh fi done @@ -52,15 +52,6 @@ EOF ) source ~/pas.env PCF_OPSMAN_ADMIN_PASSWD=${PCF_PIVNET_UAA_TOKEN} -#PCF_KEY_PEM=$(cat ${HOME_DIR}/.acme.sh/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}.key | awk '{printf "%s\\r\\n", $0}') -#PCF_CERT_PEM=$(cat ${HOME_DIR}/.acme.sh/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}/fullchain.cer | awk '{printf "%s\\r\\n", $0}') - - - - - - - PCF_KEY_PEM=$(cat ${HOME_DIR}/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}.key | awk '{printf "%s\\r\\n", $0}') PCF_CERT_PEM=$(cat ${HOME_DIR}/fullchain.cer | awk '{printf "%s\\r\\n", $0}') PCF_CREDHUB_KEY="01234567890123456789" From f569aa8bbc582533e4935145a689e44343b64dc5 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 11:15:18 +0100 Subject: [PATCH 19/31] monster update. new conditional apply, om 0.53, bbr 1.4.0, latest PAS --- azuredeploy.json | 99 +++++++++++++++++++++----- env/apm/1.6.0/healthwatch.env | 4 ++ env/healthwatch/1.4.5/healthwatch.env | 4 ++ env/pas/2.4.3/pas.env | 4 ++ env/{ => rabbit/1.15.3}/rabbit.env | 0 env/rabbit/1.15.4/rabbit.env | 4 ++ env/{ => spring/2.0.5}/spring.env | 0 env/spring/2.0.6/spring.env | 4 ++ env/{ => spring/mysql/2.5.3}/mysql.env | 0 scripts/deploy_base.sh | 10 +-- scripts/deploy_masb.sh | 16 ++++- scripts/deploy_mysql.sh | 18 +++-- scripts/deploy_osba.sh | 16 ++++- scripts/deploy_pas.sh | 20 ++++-- scripts/deploy_rabbit.sh | 18 +++-- scripts/deploy_spring.sh | 19 +++-- scripts/om_init.sh | 6 +- templates/apm.yaml | 8 +++ templates/healthwatch.yaml | 17 +++++ 19 files changed, 220 insertions(+), 47 deletions(-) create mode 100644 env/apm/1.6.0/healthwatch.env create mode 100644 env/healthwatch/1.4.5/healthwatch.env create mode 100644 env/pas/2.4.3/pas.env rename env/{ => rabbit/1.15.3}/rabbit.env (100%) create mode 100644 env/rabbit/1.15.4/rabbit.env rename env/{ => spring/2.0.5}/spring.env (100%) create mode 100644 env/spring/2.0.6/spring.env rename env/{ => spring/mysql/2.5.3}/mysql.env (100%) create mode 100644 templates/apm.yaml create mode 100644 templates/healthwatch.yaml diff --git a/azuredeploy.json b/azuredeploy.json index ba2e1ca..a2955fe 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -202,15 +202,6 @@ "description": "for testing, use self signed certs, otherwise Let´s Encrypt" } }, - "pasVersion": { - "type": "string", - "defaultValue": "2.4.2", - "allowedValues": [ - "2.4.2", - "2.4.1", - "2.4.0" - ] - }, "dnsLabelPrefix": { "minLength": "3", "type": "string", @@ -269,7 +260,79 @@ "metadata": { "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." } - } + }, + "pcfSpringVer": { + "type": "string", + "defaultValue": "2.0.6", + "allowedValues": [ + "2.0.5", + "2.0.6" + ], + "metadata": { + "description": "The Version of the Spring Tile" + } + }, + "pcfMysqlVer": { + "type": "string", + "defaultValue": "2.5.3", + "allowedValues": [ + "2.5.3" + ], + "metadata": { + "description": "The Version of the mysql Tile" + } + }, + "pcfRabbitVer": { + "type": "string", + "defaultValue": "1.15.4", + "allowedValues": [ + "1.15.4", + "1.15.3" + ], + "metadata": { + "description": "The Version of the rabbit Tile" + } + }, + "pcfPasVer": { + "type": "string", + "defaultValue": "2.4.3", + "allowedValues": [ + "2.4.3", + "2.4.2", + "2.4.1", + "2.4.0" + ] + }, + "pcfMasbVer": { + "type": "string", + "defaultValue": "1.11.0", + "allowedValues": [ + "1.11.0" + ], + "metadata": { + "description": "The Version of the Azure Service Broker Tile" + } + }, + "pcfApmVer": { + "type": "string", + "defaultValue": "1.11.0", + "allowedValues": [ + "1.11.0" + ], + "metadata": { + "description": "The Version of the Azure Service Broker Tile" + } + }, + "pcfHealthwatchVer": { + "type": "string", + "defaultValue": "1.11.0", + "allowedValues": [ + "1.11.0" + ], + "metadata": { + "description": "The Version of the Azure Service Broker Tile" + } + } }, "variables": { "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", @@ -302,12 +365,16 @@ "[concat(variables('baseUri'), '/templates/mysql.yaml')]", "[concat(variables('baseUri'), '/templates/rabbit.yaml')]", "[concat(variables('baseUri'), '/templates/spring.yaml')]", + "[concat(variables('baseUri'), '/templates/apm.yaml')]", + "[concat(variables('baseUri'), '/templates/healthwatch.yaml')]", "[concat(variables('baseUri'), '/templates/masb.yaml')]", - "[concat(variables('baseUri'), '/env/mysql.env')]", - "[concat(variables('baseUri'), '/env/pas/',parameters('pasVersion'),'/pas.env')]", - "[concat(variables('baseUri'), '/env/masb/1.11.0/masb.env')]", - "[concat(variables('baseUri'), '/env/rabbit.env')]", - "[concat(variables('baseUri'), '/env/spring.env')]", + "[concat(variables('baseUri'), '/env/mysql/',parameters('pcfMysqlVer'),'/mysql.env')]", + "[concat(variables('baseUri'), '/env/pas/',parameters('pcfPasVer'),'/pas.env')]", + "[concat(variables('baseUri'), '/env/masb/',parameters('pcfMasbVer'),'/masb.env')]", + "[concat(variables('baseUri'), '/env/rabbit/',parameters('pcfRabbitVer'),'/rabbit.env')]", + "[concat(variables('baseUri'), '/env/spring/',parameters('pcfSpringVer'),'/spring.env')]", + "[concat(variables('baseUri'), '/env/spring/',parameters('pcfApmVer'),'/Apm.env')]", + "[concat(variables('baseUri'), '/env/spring/',parameters('pcfHealthwatchVer'),'/healthwatch.env')]", "[concat(variables('baseUri'), '/templates/director_config.yaml')]", "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/shared_scripts/ubuntu/vm-disk-utils-0.1.sh" ] @@ -491,7 +558,7 @@ "PCF_NOTIFICATIONS_EMAIL": "[parameters('notificationsEmail')]", "NET_16_BIT_MASK": "[parameters('net16bitmask')]", "PAS_AUTOPILOT": "[parameters('pasAutopilot')]", - "PCF_PAS_VERSION": "[parameters('pasVersion')]", + "PCF_PAS_VERSION": "[parameters('pcfPasVer')]", "SMTP_ADDRESS": "[parameters('smtpAddress')]", "SMTP_IDENTITY": "[parameters('smtpIdentity')]", "SMTP_PASSWORD": "[parameters('smtpPassword')]", diff --git a/env/apm/1.6.0/healthwatch.env b/env/apm/1.6.0/healthwatch.env new file mode 100644 index 0000000..6ee165d --- /dev/null +++ b/env/apm/1.6.0/healthwatch.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_OSBA_VERSION="1.6.0" +RELEASE_ID="258338" +PRODUCT_SLUG="apm" \ No newline at end of file diff --git a/env/healthwatch/1.4.5/healthwatch.env b/env/healthwatch/1.4.5/healthwatch.env new file mode 100644 index 0000000..fd5cf67 --- /dev/null +++ b/env/healthwatch/1.4.5/healthwatch.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_OSBA_VERSION="1.11.0" +RELEASE_ID="282392" +PRODUCT_SLUG="azure-service-broker" \ No newline at end of file diff --git a/env/pas/2.4.3/pas.env b/env/pas/2.4.3/pas.env new file mode 100644 index 0000000..fb807d8 --- /dev/null +++ b/env/pas/2.4.3/pas.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_PAS_VERSION="2.4.3" +RELEASE_ID="297394" +PRODUCT_SLUG="elastic-runtime" \ No newline at end of file diff --git a/env/rabbit.env b/env/rabbit/1.15.3/rabbit.env similarity index 100% rename from env/rabbit.env rename to env/rabbit/1.15.3/rabbit.env diff --git a/env/rabbit/1.15.4/rabbit.env b/env/rabbit/1.15.4/rabbit.env new file mode 100644 index 0000000..2481602 --- /dev/null +++ b/env/rabbit/1.15.4/rabbit.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_RABBIT_VERSION="1.15.4" +RELEASE_ID="301765" +PRODUCT_SLUG="p-rabbitmq" \ No newline at end of file diff --git a/env/spring.env b/env/spring/2.0.5/spring.env similarity index 100% rename from env/spring.env rename to env/spring/2.0.5/spring.env diff --git a/env/spring/2.0.6/spring.env b/env/spring/2.0.6/spring.env new file mode 100644 index 0000000..d09b935 --- /dev/null +++ b/env/spring/2.0.6/spring.env @@ -0,0 +1,4 @@ +#!/bin/bash +PCF_SPRING_VERSION="2.0.6" +RELEASE_ID="297181" +PRODUCT_SLUG="p-spring-cloud-services" \ No newline at end of file diff --git a/env/mysql.env b/env/spring/mysql/2.5.3/mysql.env similarity index 100% rename from env/mysql.env rename to env/spring/mysql/2.5.3/mysql.env diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index f080e90..afe4dc6 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -137,11 +137,11 @@ sudo apt update sudo apt-get install azure-cli unzip tmate --yes -wget -O terraform.zip https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip && \ +wget -O terraform.zip https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.11_linux_amd64.zip && \ unzip terraform.zip && \ sudo mv terraform /usr/local/bin -wget -O om https://github.com/pivotal-cf/om/releases/download/0.51.0/om-linux && \ +wget -O om https://github.com/pivotal-cf/om/releases/download/0.53.0/om-linux && \ chmod +x om && \ sudo mv om /usr/local/bin/ @@ -149,9 +149,9 @@ wget -O bosh https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-5.4.0-linux-am chmod +x bosh && \ sudo mv bosh /usr/local/bin/ -wget -O /tmp/bbr.tar https://github.com/cloudfoundry-incubator/bosh-backup-and-restore/releases/download/v1.2.8/bbr-1.2.8.tar && \ - tar xvC /tmp/ -f /tmp/bbr.tar && \ - sudo mv /tmp/releases/bbr /usr/local/bin/ +wget -O /tmp/bbr https://github.com/cloudfoundry-incubator/bosh-backup-and-restore/releases/download/v1.4.0/bbr-1.4.0-linux-amd64 && \ + chmod +x bbr && \ + sudo mv /tmp/bbr /usr/local/bin/ # get pivnet UAA TOKEN cd ${HOME_DIR} diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 9c2b2ba..817ecec 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -20,6 +20,11 @@ case $key in echo "No APPLY is ${NO_APPLY}" # shift # past value ia arg value ;; + -a|--APPLY_ALL) + APPLY_ALL=TRUE + echo "APPLY ALL is ${NO_APPLY}" + # shift # past value ia arg value + ;; -nodb|--DO_NOT_CREATE_SQLDB_INSTANCE) NO_SQLDB=TRUE echo "No SQL DB CREATION is ${NO_SQLDB}" @@ -199,11 +204,16 @@ om --skip-ssl-validation \ echo "$(date) start apply ${PRODUCT_SLUG}" -if [ -z ${NO_APPLY} ] ; then +if [ ! -z ${NO_APPLY} ] ; then +echo "No Product Apply" +elif [ ! -z ${APPLY_ALL} ] ; then +echo "APPLY_ALL" +om --skip-ssl-validation \ + apply-changes +else +echo "APPLY Product" om --skip-ssl-validation \ apply-changes \ --product-name ${PRODUCT_SLUG} -else -echo "No Product Apply" fi echo "$(date) end apply ${PRODUCT_SLUG}" \ No newline at end of file diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index c9945dc..19f1055 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -19,7 +19,12 @@ case $key in NO_APPLY=TRUE echo "No APPLY is ${NO_APPLY}" # shift # past value ia arg value - ;; + ;; + -a|--APPLY_ALL) + APPLY_ALL=TRUE + echo "APPLY ALL is ${NO_APPLY}" + # shift # past value ia arg value + ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument @@ -167,11 +172,16 @@ om --skip-ssl-validation \ echo $(date) start apply ${PRODUCT_SLUG} -if [ -z ${NO_APPLY} ] ; then +if [ ! -z ${NO_APPLY} ] ; then +echo "No Product Apply" +elif [ ! -z ${APPLY_ALL} ] ; then +echo "APPLY_ALL" +om --skip-ssl-validation \ + apply-changes +else +echo "APPLY Product" om --skip-ssl-validation \ apply-changes \ --product-name ${PRODUCT_SLUG} -else -echo "No Product Apply" fi echo $(date) end apply ${PRODUCT_SLUG} \ No newline at end of file diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index 1a1c055..9da5cda 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -20,6 +20,11 @@ case $key in echo "No APPLY is ${NO_APPLY}" # shift # past value ia arg value ;; + -a|--APPLY_ALL) + APPLY_ALL=TRUE + echo "APPLY ALL is ${NO_APPLY}" + # shift # past value ia arg value + ;; -r|--DO_NOT_CREATE_REDIS_INSTANCE) NO_REDIS=TRUE echo "No APPLY is ${NO_APPLY}" @@ -200,11 +205,16 @@ om --skip-ssl-validation \ echo "$(date) start apply ${PRODUCT_SLUG}" -if [ -z ${NO_APPLY} ] ; then +if [ ! -z ${NO_APPLY} ] ; then +echo "No Product Apply" +elif [ ! -z ${APPLY_ALL} ] ; then +echo "APPLY_ALL" +om --skip-ssl-validation \ + apply-changes +else +echo "APPLY Product" om --skip-ssl-validation \ apply-changes \ --product-name ${PRODUCT_SLUG} -else -echo "No Product Apply" fi echo "$(date) end apply ${PRODUCT_SLUG}" \ No newline at end of file diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index 5790e05..7fefb4a 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -20,7 +20,12 @@ case $key in NO_APPLY=TRUE echo "No APPLY is ${NO_APPLY}" # shift # past value ia arg value - ;; + ;; + -a|--APPLY_ALL) + APPLY_ALL=TRUE + echo "APPLY ALL is ${NO_APPLY}" + # shift # past value ia arg value + ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument @@ -217,12 +222,17 @@ echo $(date) end configure ${PRODUCT_NAME} echo $(date) start apply ${PRODUCT_SLUG} -if [ -z ${NO_APPLY} ] ; then +if [ ! -z ${NO_APPLY} ] ; then +echo "No Product Apply" +elif [ ! -z ${APPLY_ALL} ] ; then +echo "APPLY_ALL" +om --skip-ssl-validation \ + apply-changes +else +echo "APPLY Product" om --skip-ssl-validation \ apply-changes \ - --product-name ${PRODUCT_NAME} -else -echo "No Product Apply" + --product-name ${PRODUCT_SLUG} fi echo $(date) end apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index 027c1a5..781e3b6 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -20,7 +20,12 @@ case $key in NO_APPLY=TRUE echo "No APPLY is ${NO_APPLY}" # shift # past value ia arg value - ;; + ;; + -a|--APPLY_ALL) + APPLY_ALL=TRUE + echo "APPLY ALL is ${NO_APPLY}" + # shift # past value ia arg value + ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument @@ -140,11 +145,16 @@ om --skip-ssl-validation \ echo $(date) start apply ${PRODUCT_SLUG} -if [ -z ${NO_APPLY} ] ; then +if [ ! -z ${NO_APPLY} ] ; then +echo "No Product Apply" +elif [ ! -z ${APPLY_ALL} ] ; then +echo "APPLY_ALL" +om --skip-ssl-validation \ + apply-changes +else +echo "APPLY Product" om --skip-ssl-validation \ apply-changes \ --product-name ${PRODUCT_SLUG} -else -echo "No Product Apply" fi echo $(date) end apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index 3a38a80..2251b6d 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -20,7 +20,12 @@ case $key in NO_APPLY=TRUE echo "No APPLY is ${NO_APPLY}" # shift # past value ia arg value - ;; + ;; + -a|--APPLY_ALL) + APPLY_ALL=TRUE + echo "APPLY ALL is ${NO_APPLY}" + # shift # past value ia arg value + ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument @@ -139,13 +144,19 @@ om --skip-ssl-validation \ echo $(date) start apply ${PRODUCT_SLUG} -if [ -z ${NO_APPLY} ] ; then +if [ ! -z ${NO_APPLY} ] ; then +echo "No Product Apply" +elif [ ! -z ${APPLY_ALL} ] ; then +echo "APPLY_ALL" +om --skip-ssl-validation \ + apply-changes +else +echo "APPLY Product" om --skip-ssl-validation \ apply-changes \ --product-name ${PRODUCT_SLUG} -else -echo "No Product Apply" fi + echo $(date) end apply ${PRODUCT_SLUG} END_SPRING_DEPLOY_TIME=$(date) $(cat <<-EOF >> ${HOME_DIR}/.env.sh diff --git a/scripts/om_init.sh b/scripts/om_init.sh index 073b9d2..0a1db33 100644 --- a/scripts/om_init.sh +++ b/scripts/om_init.sh @@ -135,8 +135,8 @@ if [ "${PAS_AUTOPILOT}" = "TRUE" ]; then else ${HOME_DIR}/create_certs.sh fi - ${HOME_DIR}/deploy_pas.sh - ${HOME_DIR}/deploy_mysql.sh - ${HOME_DIR}/deploy_rabbit.sh + ${HOME_DIR}/deploy_pas.sh --DO_NOT_APPLY_CHANGES + ${HOME_DIR}/deploy_mysql.sh --DO_NOT_APPLY_CHANGES + ${HOME_DIR}/deploy_rabbit.sh --DO_NOT_APPLY_CHANGES ${HOME_DIR}/deploy_spring.sh fi \ No newline at end of file diff --git a/templates/apm.yaml b/templates/apm.yaml new file mode 100644 index 0000000..41b9fe6 --- /dev/null +++ b/templates/apm.yaml @@ -0,0 +1,8 @@ +product-name: ((product_name)) +network-properties: + network: + name: ((pcf_pas_network)) + other_availability_zones: + - name: 'null' + singleton_availability_zone: + name: 'null' \ No newline at end of file diff --git a/templates/healthwatch.yaml b/templates/healthwatch.yaml new file mode 100644 index 0000000..c9803bf --- /dev/null +++ b/templates/healthwatch.yaml @@ -0,0 +1,17 @@ +product-name: ((product_name)) +network-properties: + network: + name: ((pcf_pas_network)) + service_network: + name: ((pcf_service_network)) + other_availability_zones: + - name: 'null' + singleton_availability_zone: + name: 'null' +product-properties: + .properties.opsman.enable.url: + value: ((opsman_enable_url)) + .properties.boshtasks: + value: disable + .healthwatch-forwarder.health_check_az: + value: 'null' \ No newline at end of file From 50d47a6a7b6646484709b347110c5631f4889ec1 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 11:24:41 +0100 Subject: [PATCH 20/31] chaneget versions --- azuredeploy.json | 12 ++++++------ env/apm/1.6.0/{healthwatch.env => apm.env} | 2 +- env/healthwatch/1.4.5/healthwatch.env | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) rename env/apm/1.6.0/{healthwatch.env => apm.env} (66%) diff --git a/azuredeploy.json b/azuredeploy.json index a2955fe..67c0c49 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -315,9 +315,9 @@ }, "pcfApmVer": { "type": "string", - "defaultValue": "1.11.0", + "defaultValue": "1.6.0", "allowedValues": [ - "1.11.0" + "1.6.0" ], "metadata": { "description": "The Version of the Azure Service Broker Tile" @@ -325,9 +325,9 @@ }, "pcfHealthwatchVer": { "type": "string", - "defaultValue": "1.11.0", + "defaultValue": "1.4.5", "allowedValues": [ - "1.11.0" + "1.4.5" ], "metadata": { "description": "The Version of the Azure Service Broker Tile" @@ -373,8 +373,8 @@ "[concat(variables('baseUri'), '/env/masb/',parameters('pcfMasbVer'),'/masb.env')]", "[concat(variables('baseUri'), '/env/rabbit/',parameters('pcfRabbitVer'),'/rabbit.env')]", "[concat(variables('baseUri'), '/env/spring/',parameters('pcfSpringVer'),'/spring.env')]", - "[concat(variables('baseUri'), '/env/spring/',parameters('pcfApmVer'),'/Apm.env')]", - "[concat(variables('baseUri'), '/env/spring/',parameters('pcfHealthwatchVer'),'/healthwatch.env')]", + "[concat(variables('baseUri'), '/env/apm/',parameters('pcfApmVer'),'/Apm.env')]", + "[concat(variables('baseUri'), '/env/healthwatch/',parameters('pcfHealthwatchVer'),'/healthwatch.env')]", "[concat(variables('baseUri'), '/templates/director_config.yaml')]", "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/shared_scripts/ubuntu/vm-disk-utils-0.1.sh" ] diff --git a/env/apm/1.6.0/healthwatch.env b/env/apm/1.6.0/apm.env similarity index 66% rename from env/apm/1.6.0/healthwatch.env rename to env/apm/1.6.0/apm.env index 6ee165d..b118fe7 100644 --- a/env/apm/1.6.0/healthwatch.env +++ b/env/apm/1.6.0/apm.env @@ -1,4 +1,4 @@ #!/bin/bash -PCF_OSBA_VERSION="1.6.0" +PCF_VERSION="1.6.0" RELEASE_ID="258338" PRODUCT_SLUG="apm" \ No newline at end of file diff --git a/env/healthwatch/1.4.5/healthwatch.env b/env/healthwatch/1.4.5/healthwatch.env index fd5cf67..902f9c8 100644 --- a/env/healthwatch/1.4.5/healthwatch.env +++ b/env/healthwatch/1.4.5/healthwatch.env @@ -1,4 +1,4 @@ #!/bin/bash -PCF_OSBA_VERSION="1.11.0" +PCF_VERSION="1.11.0" RELEASE_ID="282392" -PRODUCT_SLUG="azure-service-broker" \ No newline at end of file +PRODUCT_SLUG="p-healthwatch" \ No newline at end of file From 9909c8ea4ef3051e3994bfcd4703185ebc7c3f50 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 11:25:38 +0100 Subject: [PATCH 21/31] filecopy for apm --- azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azuredeploy.json b/azuredeploy.json index 67c0c49..57948d1 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -373,7 +373,7 @@ "[concat(variables('baseUri'), '/env/masb/',parameters('pcfMasbVer'),'/masb.env')]", "[concat(variables('baseUri'), '/env/rabbit/',parameters('pcfRabbitVer'),'/rabbit.env')]", "[concat(variables('baseUri'), '/env/spring/',parameters('pcfSpringVer'),'/spring.env')]", - "[concat(variables('baseUri'), '/env/apm/',parameters('pcfApmVer'),'/Apm.env')]", + "[concat(variables('baseUri'), '/env/apm/',parameters('pcfApmVer'),'/apm.env')]", "[concat(variables('baseUri'), '/env/healthwatch/',parameters('pcfHealthwatchVer'),'/healthwatch.env')]", "[concat(variables('baseUri'), '/templates/director_config.yaml')]", "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/shared_scripts/ubuntu/vm-disk-utils-0.1.sh" From 92140a9fb89c0665ee295fa375a1031e8a16d12f Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 11:48:27 +0100 Subject: [PATCH 22/31] mysql --- env/{spring => }/mysql/2.5.3/mysql.env | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename env/{spring => }/mysql/2.5.3/mysql.env (100%) diff --git a/env/spring/mysql/2.5.3/mysql.env b/env/mysql/2.5.3/mysql.env similarity index 100% rename from env/spring/mysql/2.5.3/mysql.env rename to env/mysql/2.5.3/mysql.env From d2e3dcbfbd3546405d635775309f3ec73c2063b7 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 13:46:27 +0100 Subject: [PATCH 23/31] latest healthwatch --- README.md | 15 ++-- azuredeploy.json | 221 ++++++++++++++++++++++++----------------------- 2 files changed, 120 insertions(+), 116 deletions(-) diff --git a/README.md b/README.md index 6cdfbd4..ea43dca 100644 --- a/README.md +++ b/README.md @@ -57,17 +57,17 @@ also, note that AUTOPILOT is disabled by default now. you can set the Environment for PAS_AUTOPILOT or use -pasAutopilot=TRUE during deployment. if not using autopilot, see [Post Deployment Steps](#post-deploy) for more Details -## deployment with minimum param set +## deployment with default parameter set -the minimum parameter set uses defaults where possible +the default parameter set uses defaults where possible, it is the most convenient way to get started -### validate minimum +### validate default ```bash source ~/.env.testing az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment validate --resource-group ${JUMPBOX_RG} \ - --template-uri https://raw.githubusercontent.com/bottkars/pcf-jump-azure/${BRANCH}/azuredeploy.json \ + --template-uri https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH/azuredeploy.json \ --parameters \ adminUsername=${ADMIN_USERNAME} \ sshKeyData="$(cat ~/${JUMPBOX_NAME}.pub)" \ @@ -79,7 +79,6 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ pivnetToken=${PCF_PIVNET_UAA_TOKEN} \ envName=${ENV_NAME} \ envShortName=${ENV_SHORT_NAME} \ - opsmanImageUri=${OPS_MANAGER_IMAGE_URI} \ pcfDomainName=${PCF_DOMAIN_NAME} \ pcfSubdomainName=${PCF_SUBDOMAIN_NAME} ``` @@ -96,7 +95,7 @@ ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} ```bash az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment create --resource-group ${JUMPBOX_RG} \ - --template-uri "https://raw.githubusercontent.com/bottkars/pcf-jump-azure/${BRANCH}/azuredeploy.json" \ + --template-uri "https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH/azuredeploy.json" \ --parameters \ adminUsername=${ADMIN_USERNAME} \ sshKeyData="$(cat ~/${JUMPBOX_NAME}.pub)" \ @@ -108,7 +107,6 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ pivnetToken=${PCF_PIVNET_UAA_TOKEN} \ envName=${ENV_NAME} \ envShortName=${ENV_SHORT_NAME} \ - opsmanImageUri=${OPS_MANAGER_IMAGE_URI} \ pcfDomainName=${PCF_DOMAIN_NAME} \ pcfSubdomainName=${PCF_SUBDOMAIN_NAME} ``` @@ -122,6 +120,9 @@ example parameter file for master branch is [here](/.env.example) ### validate full + + (.properties.validatedResources[] | select(.name=="generate-customdata")) + ```bash source ~/.env.testing az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} diff --git a/azuredeploy.json b/azuredeploy.json index 57948d1..9d1c58f 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -59,44 +59,126 @@ "type": "string", "defaultValue": "pcf", "metadata": { - "description": "environment name for azure ( will be ops host name )" + "description": "the Environment name for azure, will be a Prefix for PCF Resources" } }, "envShortName": { "type": "string", "minLength": "3", "metadata": { - "description": "will be prefix for pcf terraform resources" + "description": "will be prefix for PCF Storage Account " } }, - "opsmanImage": { + "PCFDomainName": { + "type": "string", + "minLength": "7", + "metadata": { + "description": "dns suffix for PCF" + } + }, + "PCFSubdomainName": { "type": "string", + "minLength": "3", + "metadata": { + "description": "subdomain for PCF" + } + }, + "dnsLabelPrefix": { + "minLength": "3", + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." + } + }, + "PCFSpringVersion": { + "type": "string", + "defaultValue": "2.0.6", "allowedValues": [ - "ops-manager-2.4-build.152.vhd", - "ops-manager-2.4-build.145.vhd", - "ops-manager-2.4-build.142.vhd", - "ops-manager-2.4-build.131.vhd", - "ops-manager-2.4-build.117.vhd" - ], - "defaultValue": "ops-manager-2.4-build.152.vhd", + "2.0.5", + "2.0.6" + ], "metadata": { - "description": "latest osmanager image" + "description": "The Version of the Spring Tile" } }, - "pcfDomainName": { + "PCFMysqlVersion": { "type": "string", - "minLength": "7", + "defaultValue": "2.5.3", + "allowedValues": [ + "2.5.3" + ], "metadata": { - "description": "dns suffix for pcf" + "description": "The Version of the mysql Tile" } }, - "pcfSubdomainName": { + "PCFRabbitVersion": { "type": "string", - "minLength": "3", + "defaultValue": "1.15.4", + "allowedValues": [ + "1.15.4", + "1.15.3" + ], "metadata": { - "description": "subdomain for pcf" + "description": "The Version of the Rabbit Tile" + } + }, + "PCFPasVersion": { + "type": "string", + "defaultValue": "2.4.3", + "allowedValues": [ + "2.4.3", + "2.4.2", + "2.4.1", + "2.4.0" + ], + "metadata": { + "description": "The Version of the Pivotal Application Service" + } + }, + "PCFMasbVersion": { + "type": "string", + "defaultValue": "1.11.0", + "allowedValues": [ + "1.11.0" + ], + "metadata": { + "description": "The Version of the Azure Service Broker Tile" } }, + "PCFApmVersion": { + "type": "string", + "defaultValue": "1.6.0", + "allowedValues": [ + "1.6.0" + ], + "metadata": { + "description": "The Version of the Azure Service Broker Tile" + } + }, + "PCFHealthwatchVersion": { + "type": "string", + "defaultValue": "1.4.5", + "allowedValues": [ + "1.4.5" + ], + "metadata": { + "description": "The Version of the Azure Service Broker Tile" + } + }, + "opsmanImage": { + "type": "string", + "allowedValues": [ + "ops-manager-2.4-build.152.vhd", + "ops-manager-2.4-build.145.vhd", + "ops-manager-2.4-build.142.vhd", + "ops-manager-2.4-build.131.vhd", + "ops-manager-2.4-build.117.vhd" + ], + "defaultValue": "ops-manager-2.4-build.152.vhd", + "metadata": { + "description": "The Version of the Operations Manager Image" + } + }, "net16bitmask": { "type": "string", "minLength": "3", @@ -110,7 +192,7 @@ "minLength": "5", "defaultValue": "user@example.com", "metadata": { - "description": "subdomain for pcf" + "description": "subdomain for PCF" } }, "smtpAddress": { @@ -164,7 +246,7 @@ "minLength": "5", "defaultValue": "opsman", "metadata": { - "description": "subdomain for pcf" + "description": "subdomain for PCF" } }, "pasEdition": { @@ -188,7 +270,7 @@ "TRUE" ], "metadata": { - "description": "autodeploy pcf pas" + "description": "autodeploy PCF pas" } }, "useSelfCerts": { @@ -202,13 +284,6 @@ "description": "for testing, use self signed certs, otherwise Let´s Encrypt" } }, - "dnsLabelPrefix": { - "minLength": "3", - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, "ubuntuOSVersion": { "type": "string", "defaultValue": "18.04-LTS", @@ -260,78 +335,6 @@ "metadata": { "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." } - }, - "pcfSpringVer": { - "type": "string", - "defaultValue": "2.0.6", - "allowedValues": [ - "2.0.5", - "2.0.6" - ], - "metadata": { - "description": "The Version of the Spring Tile" - } - }, - "pcfMysqlVer": { - "type": "string", - "defaultValue": "2.5.3", - "allowedValues": [ - "2.5.3" - ], - "metadata": { - "description": "The Version of the mysql Tile" - } - }, - "pcfRabbitVer": { - "type": "string", - "defaultValue": "1.15.4", - "allowedValues": [ - "1.15.4", - "1.15.3" - ], - "metadata": { - "description": "The Version of the rabbit Tile" - } - }, - "pcfPasVer": { - "type": "string", - "defaultValue": "2.4.3", - "allowedValues": [ - "2.4.3", - "2.4.2", - "2.4.1", - "2.4.0" - ] - }, - "pcfMasbVer": { - "type": "string", - "defaultValue": "1.11.0", - "allowedValues": [ - "1.11.0" - ], - "metadata": { - "description": "The Version of the Azure Service Broker Tile" - } - }, - "pcfApmVer": { - "type": "string", - "defaultValue": "1.6.0", - "allowedValues": [ - "1.6.0" - ], - "metadata": { - "description": "The Version of the Azure Service Broker Tile" - } - }, - "pcfHealthwatchVer": { - "type": "string", - "defaultValue": "1.4.5", - "allowedValues": [ - "1.4.5" - ], - "metadata": { - "description": "The Version of the Azure Service Broker Tile" - } } }, "variables": { @@ -368,13 +371,13 @@ "[concat(variables('baseUri'), '/templates/apm.yaml')]", "[concat(variables('baseUri'), '/templates/healthwatch.yaml')]", "[concat(variables('baseUri'), '/templates/masb.yaml')]", - "[concat(variables('baseUri'), '/env/mysql/',parameters('pcfMysqlVer'),'/mysql.env')]", - "[concat(variables('baseUri'), '/env/pas/',parameters('pcfPasVer'),'/pas.env')]", - "[concat(variables('baseUri'), '/env/masb/',parameters('pcfMasbVer'),'/masb.env')]", - "[concat(variables('baseUri'), '/env/rabbit/',parameters('pcfRabbitVer'),'/rabbit.env')]", - "[concat(variables('baseUri'), '/env/spring/',parameters('pcfSpringVer'),'/spring.env')]", - "[concat(variables('baseUri'), '/env/apm/',parameters('pcfApmVer'),'/apm.env')]", - "[concat(variables('baseUri'), '/env/healthwatch/',parameters('pcfHealthwatchVer'),'/healthwatch.env')]", + "[concat(variables('baseUri'), '/env/mysql/',parameters('PCFMysqlVersion'),'/mysql.env')]", + "[concat(variables('baseUri'), '/env/pas/',parameters('PCFPasVersion'),'/pas.env')]", + "[concat(variables('baseUri'), '/env/masb/',parameters('PCFMasbVersion'),'/masb.env')]", + "[concat(variables('baseUri'), '/env/rabbit/',parameters('PCFRabbitVersion'),'/rabbit.env')]", + "[concat(variables('baseUri'), '/env/spring/',parameters('PCFSpringVersion'),'/spring.env')]", + "[concat(variables('baseUri'), '/env/apm/',parameters('PCFApmVersion'),'/apm.env')]", + "[concat(variables('baseUri'), '/env/healthwatch/',parameters('PCFHealthwatchVersion'),'/healthwatch.env')]", "[concat(variables('baseUri'), '/templates/director_config.yaml')]", "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/shared_scripts/ubuntu/vm-disk-utils-0.1.sh" ] @@ -551,14 +554,14 @@ "ENV_SHORT_NAME": "[parameters('envShortName')]", "OPS_MANAGER_IMAGE_URI": "[concat('https://opsmanager',parameters('opsmanImageregion'),'.blob.core.windows.net/images/',parameters('opsmanImage'))]", "LOCATION": "[parameters('location')]", - "PCF_DOMAIN_NAME": "[parameters('pcfDomainName')]", - "PCF_SUBDOMAIN_NAME": "[parameters('pcfSubdomainName')]", + "PCF_DOMAIN_NAME": "[parameters('PCFDomainName')]", + "PCF_SUBDOMAIN_NAME": "[parameters('PCFSubdomainName')]", "SSH_PUBLIC_KEY": "[parameters('sshkeyData')]", "PCF_OPSMAN_USERNAME": "[parameters('opsmanUsername')]", "PCF_NOTIFICATIONS_EMAIL": "[parameters('notificationsEmail')]", "NET_16_BIT_MASK": "[parameters('net16bitmask')]", "PAS_AUTOPILOT": "[parameters('pasAutopilot')]", - "PCF_PAS_VERSION": "[parameters('pcfPasVer')]", + "PCF_PAS_VERSION": "[parameters('PCFPasVersion')]", "SMTP_ADDRESS": "[parameters('smtpAddress')]", "SMTP_IDENTITY": "[parameters('smtpIdentity')]", "SMTP_PASSWORD": "[parameters('smtpPassword')]", From 6ce44711945b87e31c23b1cf0ccfc023ec3317e4 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 13:55:09 +0100 Subject: [PATCH 24/31] moving to capitals for PCF --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ea43dca..bb60311 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,9 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ pivnetToken=${PCF_PIVNET_UAA_TOKEN} \ envName=${ENV_NAME} \ envShortName=${ENV_SHORT_NAME} \ - pcfDomainName=${PCF_DOMAIN_NAME} \ - pcfSubdomainName=${PCF_SUBDOMAIN_NAME} + PCFDomainName=${PCF_DOMAIN_NAME} \ + PCFSubdomainName=${PCF_SUBDOMAIN_NAME} \ + _artifactsLocation="https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH" ``` ### deploy minimum @@ -108,7 +109,8 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ envName=${ENV_NAME} \ envShortName=${ENV_SHORT_NAME} \ pcfDomainName=${PCF_DOMAIN_NAME} \ - pcfSubdomainName=${PCF_SUBDOMAIN_NAME} + pcfSubdomainName=${PCF_SUBDOMAIN_NAME} \ + _artifactsLocation="https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH" ``` ## deployment with full param set @@ -127,7 +129,7 @@ example parameter file for master branch is [here](/.env.example) source ~/.env.testing az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment validate --resource-group ${JUMPBOX_RG} \ - --template-uri "https://raw.githubusercontent.com/bottkars/pcf-jump-azure/${BRANCH}/azuredeploy.json" \ + --template-uri "https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH/azuredeploy.json" \ --parameters \ sshKeyData="$(cat ~/${JUMPBOX_NAME}.pub)" \ adminUsername=${ADMIN_USERNAME} \ From 31cc6d09b538139b88f010e88589afeb3cd4ba93 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 14:32:55 +0100 Subject: [PATCH 25/31] changed terrafortm version on testing --- README.md | 2 +- scripts/deploy_base.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb60311..800b866 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ example parameter file for master branch is [here](/.env.example) ### validate full - (.properties.validatedResources[] | select(.name=="generate-customdata")) +// (.properties.validatedResources[] | select(.name=="generate-customdata")) ```bash source ~/.env.testing diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index afe4dc6..1eb9a05 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -137,7 +137,7 @@ sudo apt update sudo apt-get install azure-cli unzip tmate --yes -wget -O terraform.zip https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.11_linux_amd64.zip && \ +wget -O terraform.zip https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip && \ unzip terraform.zip && \ sudo mv terraform /usr/local/bin From 8610adb559295a8fe5c1ab20e657477ef7965c85 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 15:11:56 +0100 Subject: [PATCH 26/31] mass change script structure --- scripts/create_certs.sh | 4 +-- scripts/create_self_certs.sh | 4 +-- scripts/deploy_base.sh | 52 +++++++++++++++++++++++------------- scripts/deploy_masb.sh | 10 +++---- scripts/deploy_mysql.sh | 10 +++---- scripts/deploy_osba.sh | 10 +++---- scripts/deploy_pas.sh | 12 ++++----- scripts/deploy_rabbit.sh | 10 +++---- scripts/deploy_spring.sh | 10 +++---- scripts/om_init.sh | 16 +++++------ scripts/skeleton.sh | 4 +-- 11 files changed, 79 insertions(+), 63 deletions(-) diff --git a/scripts/create_certs.sh b/scripts/create_certs.sh index 1d0a8af..2f9c266 100644 --- a/scripts/create_certs.sh +++ b/scripts/create_certs.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 git clone https://github.com/Neilpang/acme.sh.git ./acme.sh diff --git a/scripts/create_self_certs.sh b/scripts/create_self_certs.sh index 9e4731a..311b58f 100644 --- a/scripts/create_self_certs.sh +++ b/scripts/create_self_certs.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 DOMAIN="${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}" diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index 1eb9a05..2e37b43 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -68,21 +68,36 @@ PAS_EDITION=$(get_setting PAS_EDITION) HOME_DIR="/home/${ADMIN_USERNAME}" -cp *.sh ${HOME_DIR} -chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${HOME_DIR}/*.sh -chmod 755 ${HOME_DIR}/*.sh -chmod +X ${HOME_DIR}/*.sh -cp *.yaml ${HOME_DIR} -chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${HOME_DIR}/*.yaml -chmod 755 ${HOME_DIR}/*.yaml - -cp *.env ${HOME_DIR} -chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${HOME_DIR}/*.env -chmod 755 ${HOME_DIR}/*.yaml +LOG_DIR="${HOME_DIR}/conductor/logs" +SCRIPT_DIR="${HOME_DIR}/conductor/scripts" +LOG_DIR="${HOME_DIR}/conductor/logs" +ENV_DIR="${HOME_DIR}/conductor/env" +TEMPLATE_DIR="${HOME_DIR}/conductor/temmplates" + + +sudo -S -u ${ADMIN_USERNAME} mkdir -p ${TEMPLATE_DIR} +sudo -S -u ${ADMIN_USERNAME} mkdir -p ${SCRIPTS_DIR} +sudo -S -u ${ADMIN_USERNAME} mkdir -p ${ENV_DIR} +sudo -S -u ${ADMIN_USERNAME} mkdir -p ${LOGS_DIR} + + + +cp *.sh ${SCRIPTS_DIR} +chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${SCRIPTS_DIR}/*.sh +chmod 755 ${SCRIPTS_DIR}/*.sh +chmod +X ${SCRIPTS_DIR}/*.sh + +cp *.yaml ${TEMPLATE_DIR} +chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${TEMPLATE_DIR}/*.yaml +chmod 755 ${TEMPLATE_DIR}/*.yaml + +cp *.env ${HOME_DIR}/conductor/env +chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${ENV_DIR}/*.env +chmod 755 ${ENV_DIR}/*.env ${HOME_DIR}/vm-disk-utils-0.1.sh chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${DOWNLOAD_DIR} -chmod ${DOWNLOAD_DIR} +chmod -R 755 ${DOWNLOAD_DIR} $(cat <<-EOF > ${HOME_DIR}/.env.sh #!/usr/bin/env bash @@ -114,14 +129,15 @@ SMTP_PORT="${SMTP_PORT}" SMTP_STARTTLS="${SMTP_STARTTLS}" PAS_EDITION="${PAS_EDITION}" USE_SELF_CERTS="${USE_SELF_CERTS}" +LOG_DIR=${LOG_DIR} +ENV_DIR=${ENV_DIR} +SCRIPT_DIR=${SCRIPT_DIR} +TEMPLATE_DIR=${TEMPLATE_DIR} EOF ) - chmod 600 ${HOME_DIR}/.env.sh chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${HOME_DIR}/.env.sh -cp * ${HOME_DIR} - sudo apt-get install apt-transport-https lsb-release software-properties-common -y AZ_REPO=$(lsb_release -cs) echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \ @@ -155,7 +171,7 @@ wget -O /tmp/bbr https://github.com/cloudfoundry-incubator/bosh-backup-and-resto # get pivnet UAA TOKEN cd ${HOME_DIR} -source ${HOME_DIR}/pas.env +source ${ENV_DIR}/pas.env AUTHENTICATION_RESPONSE=$(curl \ --fail \ --data "{\"refresh_token\": \"${PCF_PIVNET_UAA_TOKEN}\"}" \ @@ -274,5 +290,5 @@ $(cat <<-EOF >> ${HOME_DIR}/.env.sh END_BASE_DEPLOY_TIME="${END_BASE_DEPLOY_TIME}" EOF ) -echo "Base install finished, now initializing opsman, see logfiles in ${HOME_DIR}/logs" -su ${ADMIN_USERNAME} -c "nohup ${HOME_DIR}/om_init.sh ${HOME_DIR} >/dev/null 2>&1 &" +echo "Base install finished, now initializing opsman, see logfiles in ${LOG_DIR}/logs" +su ${ADMIN_USERNAME} -c "nohup ${SCRIPT_DIR}/om_init.sh ${HOME_DIR} >/dev/null 2>&1 &" diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 817ecec..4c7b9be 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] @@ -49,7 +49,7 @@ START_OSBA_DEPLOY_TIME="${START_OSBA_DEPLOY_TIME}" EOF ) -source ~/masb.env +source ${ENV_DIR}/masb.env PIVNET_ACCESS_TOKEN=$(curl \ --fail \ @@ -185,7 +185,7 @@ MY_SQLDB_SERVER=$(az sql server show \ fi -cat << EOF > ~/masb_vars.yaml +cat << EOF > ${TEMPLATE_DIR}/masb_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet azure_subscription_id: ${AZURE_SUBSCRIPTION_ID} @@ -200,7 +200,7 @@ EOF om --skip-ssl-validation \ configure-product \ - -c ${HOME_DIR}/masb.yaml -l ${HOME_DIR}/masb_vars.yaml + -c ${TEMPLATE_DIR}/masb.yaml -l ${TEMPLATE_DIR}/masb_vars.yaml echo "$(date) start apply ${PRODUCT_SLUG}" diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index 19f1055..f9cf4a0 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] @@ -44,7 +44,7 @@ START_MYSQL_DEPLOY_TIME="${START_MYSQL_DEPLOY_TIME}" EOF ) -source ~/mysql.env +source ${ENV_DIR}/mysql.env PIVNET_ACCESS_TOKEN=$(curl \ --fail \ @@ -155,7 +155,7 @@ az storage container create --name backup \ --account-name ${ENV_SHORT_NAME}mysqlbackup \ --account-key ${MYSQL_STORAGE_KEY} -cat << EOF > ~/mysql_vars.yaml +cat << EOF > ${TEMPLATE_DIR}/mysql_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet pcf_service_network: pcf-services-subnet @@ -167,7 +167,7 @@ EOF om --skip-ssl-validation \ configure-product \ - -c ${HOME_DIR}/mysql.yaml -l ${HOME_DIR}/mysql_vars.yaml + -c ${TEMPLATE_DIR}/mysql.yaml -l ${TEMPLATE_DIR}/mysql_vars.yaml echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index 9da5cda..4829820 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] @@ -49,7 +49,7 @@ START_OSBA_DEPLOY_TIME="${START_OSBA_DEPLOY_TIME}" EOF ) -source ~/osba.env +source ${ENV_DIR}/osba.env PIVNET_ACCESS_TOKEN=$(curl \ --fail \ @@ -181,7 +181,7 @@ REDIS_KEY=$(az redis list-keys \ --resource-group ${ENV_NAME} \ --query primaryKey --out tsv) -cat << EOF > ~/osba_vars.yaml +cat << EOF > ${TEMPLATE_DIR}/osba_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet pcf_service_network: pcf-services-subnet @@ -199,7 +199,7 @@ EOF om --skip-ssl-validation \ configure-product \ - -c ${HOME_DIR}/osba.yaml -l ${HOME_DIR}/osba_vars.yaml + -c ${TEMPLATE_DIR}/osba.yaml -l ${TEMPLATE_DIR}/osba_vars.yaml diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index 7fefb4a..4a5f6c6 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] @@ -44,7 +44,7 @@ declare -a FILES=("${HOME_DIR}/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}.key" \ for FILE in "${FILES[@]}"; do if [ ! -f $FILE ]; then echo "$FILE not found. running Create Self Certs " - ${HOME_DIR}/create_self_certs.sh + ${SCRIPT_DIR}/create_self_certs.sh fi done @@ -55,7 +55,7 @@ $(cat <<-EOF >> ${HOME_DIR}/.env.sh START_PAS_DEPLOY_TIME="${START_PAS_DEPLOY_TIME}" EOF ) -source ~/pas.env +source ${ENV_DIR}/pas.env PCF_OPSMAN_ADMIN_PASSWD=${PCF_PIVNET_UAA_TOKEN} PCF_KEY_PEM=$(cat ${HOME_DIR}/${PCF_SUBDOMAIN_NAME}.${PCF_DOMAIN_NAME}.key | awk '{printf "%s\\r\\n", $0}') PCF_CERT_PEM=$(cat ${HOME_DIR}/fullchain.cer | awk '{printf "%s\\r\\n", $0}') @@ -194,7 +194,7 @@ assign-stemcell \ echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} echo $(date) start configure ${PRODUCT_NAME} -cat << EOF > vars.yaml +cat << EOF > ${TEMPLATE_DIR}/pas_vars.yaml pcf_pas_network: pcf-pas-subnet pcf_system_domain: ${PCF_SYSTEM_DOMAIN} pcf_apps_domain: ${PCF_APPS_DOMAIN} @@ -215,7 +215,7 @@ EOF om --skip-ssl-validation \ configure-product \ - -c ${HOME_DIR}/pas-${PAS_EDITION}.yaml -l vars.yaml + -c ${TEMPLATE_DIR}/pas-${PAS_EDITION}.yaml -l ${TEMPLATE_DIR}/pas_vars.yaml ### echo $(date) end configure ${PRODUCT_NAME} diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index 781e3b6..3985bff 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] @@ -44,7 +44,7 @@ START_RABBIT_DEPLOY_TIME="${START_RABBIT_DEPLOY_TIME}" EOF ) -source ~/rabbit.env +source ${ENV_DIR}/rabbit.env PIVNET_ACCESS_TOKEN=$(curl \ --fail \ @@ -131,7 +131,7 @@ assign-stemcell \ echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} -cat << EOF > ${HOME_DIR}/rabbit_vars.yaml +cat << EOF > ${TEMPLATE_DIR}/rabbit_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet pcf_service_network: pcf-services-subnet @@ -140,7 +140,7 @@ EOF om --skip-ssl-validation \ configure-product \ - -c ${HOME_DIR}/rabbit.yaml -l ${HOME_DIR}/rabbit_vars.yaml + -c ${TEMPLATE_DIR}/rabbit.yaml -l ${TEMPLATE_DIR}/rabbit_vars.yaml echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index 2251b6d..1af5785 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -2,8 +2,8 @@ source ~/.env.sh cd ${HOME_DIR} MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] @@ -44,7 +44,7 @@ START_SPRING_DEPLOY_TIME="${START_SPRING_DEPLOY_TIME}" EOF ) -source ~/spring.env +source ${ENV_DIR}/spring.env PIVNET_ACCESS_TOKEN=$(curl \ --fail \ @@ -132,14 +132,14 @@ assign-stemcell \ --stemcell latest echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} -cat << EOF > ${HOME_DIR}/spring_vars.yaml +cat << EOF > ${TEMPLATE_DIR}/spring_vars.yaml product_name: ${PRODUCT_SLUG} pcf_pas_network: pcf-pas-subnet EOF om --skip-ssl-validation \ configure-product \ - -c ${HOME_DIR}/spring.yaml -l ${HOME_DIR}/spring_vars.yaml + -c ${TEMPLATE_DIR}/spring.yaml -l ${TEMPLATE_DIR}/spring_vars.yaml echo $(date) start apply ${PRODUCT_SLUG} diff --git a/scripts/om_init.sh b/scripts/om_init.sh index 0a1db33..76f40ae 100644 --- a/scripts/om_init.sh +++ b/scripts/om_init.sh @@ -2,8 +2,8 @@ cd $1 source .env.sh MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 function retryop() { @@ -131,12 +131,12 @@ echo Finished OPSMAN Deployment at ${END_OPSMAN_DEPLOY_TIME} if [ "${PAS_AUTOPILOT}" = "TRUE" ]; then if [ "${USE_SELF_CERTS}" = "TRUE" ]; then - ${HOME_DIR}/create_self_certs.sh + ${SCRIPT_DIR}/create_self_certs.sh else - ${HOME_DIR}/create_certs.sh + ${SCRIPT_DIR}/create_certs.sh fi - ${HOME_DIR}/deploy_pas.sh --DO_NOT_APPLY_CHANGES - ${HOME_DIR}/deploy_mysql.sh --DO_NOT_APPLY_CHANGES - ${HOME_DIR}/deploy_rabbit.sh --DO_NOT_APPLY_CHANGES - ${HOME_DIR}/deploy_spring.sh + ${SCRIPT_DIR}/deploy_pas.sh --DO_NOT_APPLY_CHANGES + ${SCRIPT_DIR}/deploy_mysql.sh --DO_NOT_APPLY_CHANGES + ${SCRIPT_DIR}/deploy_rabbit.sh --DO_NOT_APPLY_CHANGES + ${SCRIPT_DIR}/deploy_spring.sh fi \ No newline at end of file diff --git a/scripts/skeleton.sh b/scripts/skeleton.sh index b8461de..550269c 100644 --- a/scripts/skeleton.sh +++ b/scripts/skeleton.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash MYSELF=$(basename $0) -mkdir -p ${HOME_DIR}/logs -exec &> >(tee -a "${HOME_DIR}/logs/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") exec 2>&1 POSITIONAL=() while [[ $# -gt 0 ]] From 7163b3eb09252bb54843e38aed462a9ed75c108f Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 16:12:48 +0100 Subject: [PATCH 27/31] fixed directories --- scripts/deploy_base.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index 2e37b43..3aff7bc 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -76,16 +76,16 @@ TEMPLATE_DIR="${HOME_DIR}/conductor/temmplates" sudo -S -u ${ADMIN_USERNAME} mkdir -p ${TEMPLATE_DIR} -sudo -S -u ${ADMIN_USERNAME} mkdir -p ${SCRIPTS_DIR} +sudo -S -u ${ADMIN_USERNAME} mkdir -p ${SCRIPT_DIR} sudo -S -u ${ADMIN_USERNAME} mkdir -p ${ENV_DIR} -sudo -S -u ${ADMIN_USERNAME} mkdir -p ${LOGS_DIR} +sudo -S -u ${ADMIN_USERNAME} mkdir -p ${LOG_DIR} -cp *.sh ${SCRIPTS_DIR} -chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${SCRIPTS_DIR}/*.sh -chmod 755 ${SCRIPTS_DIR}/*.sh -chmod +X ${SCRIPTS_DIR}/*.sh +cp *.sh ${SCRIPT_DIR} +chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${SCRIPT_DIR}/*.sh +chmod 755 ${SCRIPT_DIR}/*.sh +chmod +X ${SCRIPT_DIR}/*.sh cp *.yaml ${TEMPLATE_DIR} chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${TEMPLATE_DIR}/*.yaml From 4c90749d67ec70ebb746e30baba6bac904f3e4fe Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 19:25:53 +0100 Subject: [PATCH 28/31] added stemcell_loader --- azuredeploy.json | 1 + scripts/deploy_base.sh | 7 +++-- scripts/deploy_pas.sh | 12 ++------ scripts/om_init.sh | 4 +-- scripts/stemcell_loader.sh | 62 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 scripts/stemcell_loader.sh diff --git a/azuredeploy.json b/azuredeploy.json index 9d1c58f..216732d 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -364,6 +364,7 @@ "[concat(variables('baseUri'), '/scripts/deploy_masb.sh')]", "[concat(variables('baseUri'), '/scripts/cf_startstop.sh')]", "[concat(variables('baseUri'), '/scripts/om_init.sh')]", + "[concat(variables('baseUri'), '/scripts/stemcell_loader.sh')]", "[concat(variables('baseUri'), '/templates/pas-',parameters('pasEdition'),'.yaml')]", "[concat(variables('baseUri'), '/templates/mysql.yaml')]", "[concat(variables('baseUri'), '/templates/rabbit.yaml')]", diff --git a/scripts/deploy_base.sh b/scripts/deploy_base.sh index 3aff7bc..66d9824 100644 --- a/scripts/deploy_base.sh +++ b/scripts/deploy_base.sh @@ -95,7 +95,8 @@ cp *.env ${HOME_DIR}/conductor/env chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${ENV_DIR}/*.env chmod 755 ${ENV_DIR}/*.env -${HOME_DIR}/vm-disk-utils-0.1.sh +${SCRIPT_DIR}/vm-disk-utils-0.1.sh + chown ${ADMIN_USERNAME}.${ADMIN_USERNAME} ${DOWNLOAD_DIR} chmod -R 755 ${DOWNLOAD_DIR} @@ -245,7 +246,7 @@ sudo -S -u ${ADMIN_USERNAME} terraform plan -out=plan retryop "sudo -S -u ${ADMIN_USERNAME} terraform apply -auto-approve" 3 10 sudo -S -u ${ADMIN_USERNAME} terraform output ops_manager_ssh_private_key > ${HOME_DIR}/opsman -sudo -S -u ${ADMIN_USERNAME} chmod 600 ${HOME_DIR}/opsman +# sudo -S -u ${ADMIN_USERNAME} chmod 600 ${HOME_DIR}/opsman # PCF_NETWORK=$(terraform output network_name) @@ -290,5 +291,5 @@ $(cat <<-EOF >> ${HOME_DIR}/.env.sh END_BASE_DEPLOY_TIME="${END_BASE_DEPLOY_TIME}" EOF ) -echo "Base install finished, now initializing opsman, see logfiles in ${LOG_DIR}/logs" +echo "Base install finished, now initializing opsman, see logfiles in ${LOG_DIR}" su ${ADMIN_USERNAME} -c "nohup ${SCRIPT_DIR}/om_init.sh ${HOME_DIR} >/dev/null 2>&1 &" diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index 4a5f6c6..3a53bb4 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -143,8 +143,6 @@ om --skip-ssl-validation \ --pivnet-file-glob "${PAS_EDITION}*.pivotal" \ --pivnet-product-slug ${PRODUCT_SLUG} \ --product-version ${PCF_PAS_VERSION} \ - --stemcell-iaas azure \ - --download-stemcell \ --output-directory ${DOWNLOAD_DIR_FULL} echo $(date) end downloading ${PRODUCT_SLUG} else @@ -152,8 +150,6 @@ echo ignoring download by user fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') -STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') -STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ @@ -179,12 +175,8 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} -echo $(date) start uploading ${STEMCELL_FILENAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} -echo $(date) end uploading ${STEMCELL_FILENAME} + +$SCRIPT_DIR/stemcell_loader.sh echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} om --skip-ssl-validation \ diff --git a/scripts/om_init.sh b/scripts/om_init.sh index 76f40ae..d0ebd13 100644 --- a/scripts/om_init.sh +++ b/scripts/om_init.sh @@ -66,7 +66,7 @@ om --skip-ssl-validation \ deployed-products cd ${HOME_DIR} -cat << EOF > director_vars.yaml +cat << EOF > ${TEMPLATE_DIR}/director_vars.yaml subscription_id: ${AZURE_SUBSCRIPTION_ID} tenant_id: ${AZURE_TENANT_ID} client_id: ${AZURE_CLIENT_ID} @@ -93,7 +93,7 @@ services_gateway: "${NET_16_BIT_MASK}.4.1" EOF om --skip-ssl-validation \ - configure-director --config ${HOME_DIR}/director_config.yaml --vars-file ${HOME_DIR}/director_vars.yaml + configure-director --config ${TEMPLATE_DIR}/director_config.yaml --vars-file ${TEMPLATE_DIR}/director_vars.yaml retryop "om --skip-ssl-validation apply-changes" 2 10 diff --git a/scripts/stemcell_loader.sh b/scripts/stemcell_loader.sh new file mode 100644 index 0000000..0ab8e26 --- /dev/null +++ b/scripts/stemcell_loader.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +source ~/.env.sh +cd ${HOME_DIR} +MYSELF=$(basename $0) +mkdir -p ${LOG_DIR} +exec &> >(tee -a "${LOG_DIR}/${MYSELF}.$(date '+%Y-%m-%d-%H').log") +exec 2>&1 + +export OM_TARGET=${PCF_OPSMAN_FQDN} +export OM_USERNAME=${PCF_OPSMAN_USERNAME} +export OM_PASSWORD="${PCF_PIVNET_UAA_TOKEN}" + +function getstemcell() +{ +SLUG_ID=$1 +FAMILY=$2 +DOWNLOAD_DIR=$3 +PCF_PIVNET_UAA_TOKEN=$4 +echo "SLUG_ID $SLUG_ID" +echo "FAMILY $FAMILY" + +PRODUCT_FILES=$(curl https://network.pivotal.io/api/v2/products/$SLUG_ID/releases \ +| jq -r --arg family "$FAMILY" '[.releases[]| (select(.version | contains($family)))._links.product_files.href][0]') + +echo "query product files" +PRODUCT=$(curl $PRODUCT_FILES) +PRODUCT_ID=$(echo $PRODUCT \ + | jq -r '.product_files[] | (select(.aws_object_key | contains("hyper"))).id') +PRODUCT_VERSION=$(echo $PRODUCT \ + | jq -r '.product_files[] | (select(.aws_object_key | contains("hyper"))).file_version') +AWS_FILENAME=$(echo $PRODUCT \ + | jq -r '.product_files[] | (select(.aws_object_key | contains("hyper"))).aws_object_key') + +PRODUCT_FILENAME=$(basename $AWS_FILENAME) + +echo "PRODUCT VERSION $PRODUCT_VERSION" +STEMCELL_DIR=$DOWNLOAD_DIR/stemcells/${PRODUCT_VERSION} +mkdir -p $STEMCELL_DIR +echo $STEMCELL_DIR +om --skip-ssl-validation \ +download-product \ +--pivnet-api-token $PCF_PIVNET_UAA_TOKEN \ +--pivnet-file-glob "bosh-stemcell-${PRODUCT_VERSION}-azure-hyperv-*-go_agent.tgz" \ +--pivnet-product-slug $SLUG_ID \ +--product-version ${PRODUCT_VERSION} \ +--output-directory $STEMCELL_DIR + +STEMCELL_FILENAME=$(cat $STEMCELL_DIR/download-file.json | jq -r '.product_path') + +echo "renaming $STEMCELL_FILENAME to $DOWNLOAD_DIR/$PRODUCT_FILENAME" +cp -n $STEMCELL_FILENAME $DOWNLOAD_DIR/$PRODUCT_FILENAME + +om --skip-ssl-validation \ +upload-stemcell \ +--floating=false \ +--stemcell $DOWNLOAD_DIR/$PRODUCT_FILENAME + +} + +getstemcell 233 170 $DOWNLOAD_DIR $PCF_PIVNET_UAA_TOKEN +getstemcell 233 97 $DOWNLOAD_DIR $PCF_PIVNET_UAA_TOKEN +getstemcell 82 3586 $DOWNLOAD_DIR $PCF_PIVNET_UAA_TOKEN From 07aa6a44118a7233b6d9f1969ffcc840762b3e86 Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 21:18:26 +0100 Subject: [PATCH 29/31] latest changes for stemcell --- azuredeploy.json | 2 +- scripts/deploy_masb.sh | 12 ------------ scripts/deploy_mysql.sh | 12 ------------ scripts/deploy_osba.sh | 12 ------------ scripts/deploy_pas.sh | 2 -- scripts/deploy_rabbit.sh | 13 +------------ scripts/deploy_spring.sh | 10 ---------- 7 files changed, 2 insertions(+), 61 deletions(-) diff --git a/azuredeploy.json b/azuredeploy.json index 216732d..4b3cf08 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -264,7 +264,7 @@ }, "pasAutopilot": { "type": "string", - "defaultValue": "FALSE", + "defaultValue": "TRUE", "allowedValues": [ "FALSE", "TRUE" diff --git a/scripts/deploy_masb.sh b/scripts/deploy_masb.sh index 4c7b9be..6e10d81 100644 --- a/scripts/deploy_masb.sh +++ b/scripts/deploy_masb.sh @@ -86,8 +86,6 @@ om --skip-ssl-validation \ --pivnet-file-glob "*.pivotal" \ --pivnet-product-slug ${PRODUCT_SLUG} \ --product-version ${PCF_OSBA_VERSION} \ - --stemcell-iaas azure \ - --download-stemcell \ --output-directory ${DOWNLOAD_DIR_FULL} echo "$(date) end downloading ${PRODUCT_SLUG}" else @@ -95,8 +93,6 @@ echo "ignoring download by user " fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') -STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') -STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo "$(date) start uploading ${PRODUCT_SLUG}" om --skip-ssl-validation \ @@ -123,19 +119,11 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo "$(date) end staging ${PRODUCT_SLUG}" -echo $(date) start uploading ${STEMCELL_FILENAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} -echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ --stemcell latest -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "$(date) start creating ${ENV_SHORT_NAME}sql" diff --git a/scripts/deploy_mysql.sh b/scripts/deploy_mysql.sh index f9cf4a0..9439f55 100644 --- a/scripts/deploy_mysql.sh +++ b/scripts/deploy_mysql.sh @@ -81,8 +81,6 @@ om --skip-ssl-validation \ --pivnet-file-glob "*.pivotal" \ --pivnet-product-slug ${PRODUCT_SLUG} \ --product-version ${PCF_MYSQL_VERSION} \ - --stemcell-iaas azure \ - --download-stemcell \ --output-directory ${DOWNLOAD_DIR_FULL} echo $(date) end downloading ${PRODUCT_SLUG} else @@ -90,8 +88,6 @@ echo ignoring download by user fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') -STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') -STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ @@ -118,19 +114,11 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} -echo $(date) start uploading ${STEMCELL_FILENAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} -echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ --stemcell latest -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "creating storage account ${ENV_SHORT_NAME}mysqlbackup" diff --git a/scripts/deploy_osba.sh b/scripts/deploy_osba.sh index 4829820..3734995 100644 --- a/scripts/deploy_osba.sh +++ b/scripts/deploy_osba.sh @@ -86,8 +86,6 @@ om --skip-ssl-validation \ --pivnet-file-glob "*.pivotal" \ --pivnet-product-slug ${PRODUCT_SLUG} \ --product-version ${PCF_OSBA_VERSION} \ - --stemcell-iaas azure \ - --download-stemcell \ --output-directory ${DOWNLOAD_DIR_FULL} echo "$(date) end downloading ${PRODUCT_SLUG}" else @@ -95,8 +93,6 @@ echo "ignoring download by user " fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') -STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') -STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo "$(date) start uploading ${PRODUCT_SLUG}" om --skip-ssl-validation \ @@ -123,19 +119,11 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo "$(date) end staging ${PRODUCT_SLUG}" -echo $(date) start uploading ${STEMCELL_FILENAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} -echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ --stemcell latest -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} echo "$(date) start creating ${ENV_SHORT_NAME}redis" diff --git a/scripts/deploy_pas.sh b/scripts/deploy_pas.sh index 3a53bb4..c4c63f1 100644 --- a/scripts/deploy_pas.sh +++ b/scripts/deploy_pas.sh @@ -178,12 +178,10 @@ echo $(date) end staging ${PRODUCT_SLUG} $SCRIPT_DIR/stemcell_loader.sh -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_NAME} \ --stemcell latest -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} echo $(date) start configure ${PRODUCT_NAME} cat << EOF > ${TEMPLATE_DIR}/pas_vars.yaml diff --git a/scripts/deploy_rabbit.sh b/scripts/deploy_rabbit.sh index 3985bff..5e68611 100644 --- a/scripts/deploy_rabbit.sh +++ b/scripts/deploy_rabbit.sh @@ -79,17 +79,14 @@ om --skip-ssl-validation \ --pivnet-file-glob "*.pivotal" \ --pivnet-product-slug ${PRODUCT_SLUG} \ --product-version ${PCF_RABBIT_VERSION} \ - --stemcell-iaas azure \ - --download-stemcell \ --output-directory ${DOWNLOAD_DIR_FULL} + echo $(date) end downloading ${PRODUCT_SLUG} else echo ignoring download by user fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') -STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') -STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version') # Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ @@ -116,19 +113,11 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} -echo $(date) start uploading ${STEMCELL_FILENAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} -echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ --stemcell latest -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_NAME} cat << EOF > ${TEMPLATE_DIR}/rabbit_vars.yaml diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index 1af5785..071ea65 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -81,8 +81,6 @@ om --skip-ssl-validation \ --pivnet-file-glob "*.pivotal" \ --pivnet-product-slug ${PRODUCT_SLUG} \ --product-version ${PCF_SPRING_VERSION} \ - --stemcell-iaas azure \ - --download-stemcell \ --output-directory ${DOWNLOAD_DIR_FULL} echo $(date) end downloading ${PRODUCT_SLUG} @@ -118,19 +116,11 @@ om --skip-ssl-validation \ --product-version ${VERSION} echo $(date) end staging ${PRODUCT_SLUG} -echo $(date) start uploading ${STEMCELL_FILENAME} -om --skip-ssl-validation \ -upload-stemcell \ ---floating=false \ ---stemcell ${STEMCELL_FILENAME} -echo $(date) end uploading ${STEMCELL_FILENAME} -echo $(date) start assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} om --skip-ssl-validation \ assign-stemcell \ --product ${PRODUCT_SLUG} \ --stemcell latest -echo $(date) end assign stemcell ${STEMCELL_FILENAME} to ${PRODUCT_SLUG} cat << EOF > ${TEMPLATE_DIR}/spring_vars.yaml product_name: ${PRODUCT_SLUG} From 7705eab109efcce3e54ca5f559ea320e1c0ddfcb Mon Sep 17 00:00:00 2001 From: bottkars Date: Thu, 21 Feb 2019 23:16:47 +0100 Subject: [PATCH 30/31] apply all to get spring rocking --- scripts/deploy_spring.sh | 3 +-- scripts/om_init.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/deploy_spring.sh b/scripts/deploy_spring.sh index 071ea65..819842f 100644 --- a/scripts/deploy_spring.sh +++ b/scripts/deploy_spring.sh @@ -89,8 +89,7 @@ echo ignoring download by user fi TARGET_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.product_path') -STEMCELL_FILENAME=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_path') -STEMCELL_VERSION=$(cat ${DOWNLOAD_DIR_FULL}/download-file.json | jq -r '.stemcell_version')# Import the tile to Ops Manager. +# Import the tile to Ops Manager. echo $(date) start uploading ${PRODUCT_SLUG} om --skip-ssl-validation \ --request-timeout 3600 \ diff --git a/scripts/om_init.sh b/scripts/om_init.sh index d0ebd13..49683f4 100644 --- a/scripts/om_init.sh +++ b/scripts/om_init.sh @@ -138,5 +138,5 @@ if [ "${PAS_AUTOPILOT}" = "TRUE" ]; then ${SCRIPT_DIR}/deploy_pas.sh --DO_NOT_APPLY_CHANGES ${SCRIPT_DIR}/deploy_mysql.sh --DO_NOT_APPLY_CHANGES ${SCRIPT_DIR}/deploy_rabbit.sh --DO_NOT_APPLY_CHANGES - ${SCRIPT_DIR}/deploy_spring.sh + ${SCRIPT_DIR}/deploy_spring.sh --APPLY_ALL fi \ No newline at end of file From 11d1f4d7396f090ab91bf99409759faa16b88fe0 Mon Sep 17 00:00:00 2001 From: bottkars Date: Fri, 22 Feb 2019 08:02:16 +0100 Subject: [PATCH 31/31] final deployment for conductor release --- README.md | 104 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 800b866..4a24e37 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,48 @@ Optionally, PAS will be deployed using [om cli](https://github.com/pivotal-cf/om - :new: automated bosh tasks / setup - :new: specify download location for ops manager +### Initial supported Pivotal Cloudfoundry Tiles and Versions +- Pivotal Application Service 2.4.3 +- MySQL 2.5.3 +- RabbitMQ 1.15.4 +- Spring Cloud Services 2.0.6 +- Microsoft Azure Service Broker 1.11.0 ( MASB ) + +![image](https://user-images.githubusercontent.com/8255007/53223791-cc1af080-3672-11e9-85ba-c8a78c550101.png) + ## usage +there are are multiple ways to deploy the ARM template. we will describe Azure Portal Template based an az cli base Method + +## create a ssh keypair for the admin user ( if not already done ) + +both methods require an SSH Keypair + +```bash +ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} +``` + +### installation using New Template Deployment + +1. In the Azure Portal, click on Create Resource and enter Template Deployment +![image](https://user-images.githubusercontent.com/8255007/53224228-4bf58a80-3674-11e9-8bf1-090677009b7c.png) +2. Select the template Deployment and click on *create*. +3. Select *Build your own Template in the Editor* +![image](https://user-images.githubusercontent.com/8255007/53224314-9aa32480-3674-11e9-9997-7c430c0b31c8.png) +4. Replace the Content in the Editor Window with the Content of azuredeploy.json file +![image](https://user-images.githubusercontent.com/8255007/53224406-e2c24700-3674-11e9-9dee-5fc9b1d4aeda.png) +5. click *save*. +6. fill in all required Parameters ( marked with a red Star ) +![image](https://user-images.githubusercontent.com/8255007/53224565-80b61180-3675-11e9-861e-71a08552743b.png) +7. when done, click *Purchase*. + +### Installation using az cli + +for az cli install, we put all required Parameters into an env file + +1. create env file + create an .env file using the [.env.example](/.env.example) Parameter Explanation in this [table](#env-variables) if you need a full parameter set or a minimum depends on your customizations (e.g. [sendgrid](/sendgrid.md) and others ) @@ -37,13 +76,7 @@ source the env file source .env ``` -## create a ssh keypair for the admin user ( if not already done ) - -```bash -ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} -``` - -## check availability of storage account +2. check availability of storage account ```bash az storage account check-name --name ${ENV_SHORT_NAME}director @@ -57,14 +90,14 @@ also, note that AUTOPILOT is disabled by default now. you can set the Environment for PAS_AUTOPILOT or use -pasAutopilot=TRUE during deployment. if not using autopilot, see [Post Deployment Steps](#post-deploy) for more Details -## deployment with default parameter set +3. deployment with default parameter set the default parameter set uses defaults where possible, it is the most convenient way to get started ### validate default ```bash -source ~/.env.testing +source ~/.env az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment validate --resource-group ${JUMPBOX_RG} \ --template-uri https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH/azuredeploy.json \ @@ -84,12 +117,12 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ _artifactsLocation="https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH" ``` -### deploy minimum +4. deploy default :zap: **do not forget to create ssh key for every environment !** ```bash -source ~/.env.testing +source ~/.env ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} ``` @@ -108,25 +141,20 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ pivnetToken=${PCF_PIVNET_UAA_TOKEN} \ envName=${ENV_NAME} \ envShortName=${ENV_SHORT_NAME} \ - pcfDomainName=${PCF_DOMAIN_NAME} \ - pcfSubdomainName=${PCF_SUBDOMAIN_NAME} \ + PCFDomainName=${PCF_DOMAIN_NAME} \ + PCFSubdomainName=${PCF_SUBDOMAIN_NAME} \ _artifactsLocation="https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH" ``` -## deployment with full param set - -the full parameter set´s optiional Values like smtp config +5. deployment with full param set -example parameter file for testing branch is [here](/.env.testing.example) -example parameter file for master branch is [here](/.env.example) - -### validate full - - -// (.properties.validatedResources[] | select(.name=="generate-customdata")) +the full parameter set´s optional Values like smtp config +example parameter file for testing branch is [here](/.env.testing.example) +example parameter file for master branch is [here](/.env.example). +6. validate full ```bash -source ~/.env.testing +source ~/.env az group create --name ${JUMPBOX_RG} --location ${AZURE_REGION} az group deployment validate --resource-group ${JUMPBOX_RG} \ --template-uri "https://raw.githubusercontent.com/bottkars/pcf-jump-azure/$BRANCH/azuredeploy.json" \ @@ -143,8 +171,8 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ envShortName=${ENV_SHORT_NAME} \ opsmanImage=${OPS_MANAGER_IMAGE} \ opsmanImageRegion=${OPS_MANAGER_IMAGE_REGION} \ - pcfDomainName=${PCF_DOMAIN_NAME} \ - pcfSubdomainName=${PCF_SUBDOMAIN_NAME} \ + PCFDomainName=${PCF_DOMAIN_NAME} \ + PCFSubdomainName=${PCF_SUBDOMAIN_NAME} \ opsmanUsername=${PCF_OPSMAN_USERNAME} \ notificationsEmail=${PCF_NOTIFICATIONS_EMAIL} \ net16bitmask=${NET_16_BIT_MASK} \ @@ -162,12 +190,12 @@ az group deployment validate --resource-group ${JUMPBOX_RG} \ pasEdition=${PAS_EDITION} ``` -### deploy full +7. deploy full :zap: **do not forget to create ssh key for every environment !** ```bash -source ~/.env.testing +source ~/.env ssh-keygen -t rsa -f ~/${JUMPBOX_NAME} -C ${ADMIN_USERNAME} ``` @@ -188,8 +216,8 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ envShortName=${ENV_SHORT_NAME} \ opsmanImage=${OPS_MANAGER_IMAGE} \ opsmanImageRegion=${OPS_MANAGER_IMAGE_REGION} \ - pcfDomainName=${PCF_DOMAIN_NAME} \ - pcfSubdomainName=${PCF_SUBDOMAIN_NAME} \ + PCFDomainName=${PCF_DOMAIN_NAME} \ + PCFSubdomainName=${PCF_SUBDOMAIN_NAME} \ opsmanUsername=${PCF_OPSMAN_USERNAME} \ notificationsEmail=${PCF_NOTIFICATIONS_EMAIL} \ net16bitmask=${NET_16_BIT_MASK} \ @@ -207,12 +235,12 @@ az group deployment create --resource-group ${JUMPBOX_RG} \ pasEdition=${PAS_EDITION} ``` -## deployment using parameter file +### deployment using parameter file you also might want to deploy the template using an parameter file. simply create a local azuredeploy.parameter.json file from the [example](./azuredeploy.parameters.example.json) -then run +then run ```bash az group create --name --location @@ -323,8 +351,8 @@ variable | azure rm parameter | default value | mandatory **AZURE_SUBSCRIPTION_ID** | subscriptionID | | yes | Your Azure Subscription ID, **AZURE_TENANT_ID** | tenantID | | yes | Your AZURE tenant **PCF_PIVNET_UAA_TOKEN** | pivnetToken | | yes | Your Token from Pivotal Network -**PCF_DOMAIN_NAME** | pcfDomainName | | yes | the domain your pcf subdomain will be hosted in -**PCF_SUBDOMAIN_NAME** | pcfSubdomainName | | yes | the subdomain name that will be created in your resource group +**PCF_DOMAIN_NAME** | PCFDomainName | | yes | the domain your PCF subdomain will be hosted in +**PCF_SUBDOMAIN_NAME** | PCFSubdomainName | | yes | the subdomain name that will be created in your resource group **ENV_SHORT_NAME** | envShortName | | yes | *yourshortname* will be used as prefix for storage accounts and other azure resources. make sure you check storage account availability, see further down below **ENV_NAME** | envName | pcf | no, using default | *pcf* this name will be prefix for azure resources and you opsman hostname **OPS_MANAGER_IMAGE_URI** | opsmanImageUri | [opsurl](https://opsmanagerwesteurope.blob.core.windows.net/images/ops-manager-2.4-build.131.vhd) | no | a 2.4 opsman image url @@ -342,7 +370,13 @@ variable | azure rm parameter | default value | mandatory **USE_SELF_CERTS** | useSelfcerts | true | no | true or false **PAS_EDITION** | pasEdition|cf|no|cf or srt deployment **OPS_MANAGER_IMAGE_REGION**|opsmanImageRegion|westeurope|yes|the region where to download opsman from. Values are westeurope, westus, eastus, southeastasia -## required nameserver delegation + -|PCFspringVersion|2.0.6 |no|2.0.5,2.0.6 + -|PCFpasVersion|2.4.3|no|2.4.1,2.4.2,2.4.3 + -|PCFmysqlVersion|2.5.3|no|2.5.3 + -|PCFrabbitVersion|1.15.4|no|1.15.3,1.15.4 + -|PCFmasbVersion|1.11.0|no|1.11.0 + +### required nameserver delegation make sure that your domain has a ns resource record to your pcf domain. the following nameserver entries must be part of the resource record: