Azure xray 3.8.5 (#42)

* ARM templates - Xray config script, added value to support Azure Postgres service

* ARM templates - Xray 3.8.5

* ARM templates - Xray, fixed bug in MP submission, removed Postgres workaround from README.md
This commit is contained in:
Daniel Miakotkin
2020-09-21 13:26:57 -07:00
committed by GitHub
parent e9ae5345e4
commit b2d8fe15d7
7 changed files with 23 additions and 21 deletions

View File

@@ -123,7 +123,7 @@
"name": "xrayVersion", "name": "xrayVersion",
"type": "Microsoft.Common.DropDown", "type": "Microsoft.Common.DropDown",
"label": "Xray-vm image version to deploy.", "label": "Xray-vm image version to deploy.",
"defaultValue": "3.8.2", "defaultValue": "3.8.5",
"toolTip": "Version of Xray to deploy", "toolTip": "Version of Xray to deploy",
"constraints": { "constraints": {
"allowedValues": [ "allowedValues": [
@@ -134,6 +134,10 @@
{ {
"label": "3.8.2", "label": "3.8.2",
"value": "0.0.4" "value": "0.0.4"
},
{
"label": "3.8.5",
"value": "0.0.5"
} }
], ],
"required": true "required": true

View File

@@ -19,10 +19,11 @@
}, },
"xrayVersion": { "xrayVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.4", "defaultValue": "0.0.5",
"allowedValues": [ "allowedValues": [
"0.0.3", "0.0.3",
"0.0.4" "0.0.4",
"0.0.5"
], ],
"metadata": { "metadata": {
"description": "Xray-vm image version to deploy." "description": "Xray-vm image version to deploy."
@@ -182,6 +183,7 @@
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"db_server": "[parameters('db_server')]", "db_server": "[parameters('db_server')]",
"db_user": "[concat(parameters('db_user'), '@', parameters('db_server'))]", "db_user": "[concat(parameters('db_user'), '@', parameters('db_server'))]",
"actual_db_user": "[parameters('db_user')]",
"db_password": "[parameters('db_password')]", "db_password": "[parameters('db_password')]",
"db_location": "[parameters('location')]", "db_location": "[parameters('location')]",
"db_name": "[parameters('databases').properties[0].name]", "db_name": "[parameters('databases').properties[0].name]",
@@ -351,7 +353,7 @@
"computerNamePrefix": "[variables('namingInfix')]", "computerNamePrefix": "[variables('namingInfix')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nXRAY_VERSION=', parameters('xrayVersion'),'\nARTIFACTORY_URL=',variables('artifactoryURL'),'\nDB_SERVER=',variables('db_server'),'\nDB_NAME=',variables('db_name'),'\nDB_ADMIN_USER=',variables('db_user'),'\nDB_ADMIN_PASSWD=',variables('db_password'),'\nMASTER_KEY=',variables('masterKey'),'\nJOIN_KEY=',variables('joinKey'),'\n'))]" "customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nXRAY_VERSION=', parameters('xrayVersion'),'\nARTIFACTORY_URL=',variables('artifactoryURL'),'\nDB_SERVER=',variables('db_server'),'\nDB_NAME=',variables('db_name'),'\nDB_ADMIN_USER=',variables('db_user'),'\nACTUAL_DB_ADMIN_USER=',variables('actual_db_user'),'\nDB_ADMIN_PASSWD=',variables('db_password'),'\nMASTER_KEY=',variables('masterKey'),'\nJOIN_KEY=',variables('joinKey'),'\n'))]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaceConfigurations": [ "networkInterfaceConfigurations": [

View File

@@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
DB_NAME=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_NAME=" | sed "s/DB_NAME=//") DB_NAME=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_NAME=" | sed "s/DB_NAME=//")
DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_USER=" | sed "s/DB_ADMIN_USER=//") DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_USER=" | sed "s/DB_ADMIN_USER=//")
ACTUAL_DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ACTUAL_DB_ADMIN_USER=" | sed "s/ACTUAL_DB_ADMIN_USER=//")
DB_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//") DB_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//")
DB_SERVER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_SERVER=" | sed "s/DB_SERVER=//") DB_SERVER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_SERVER=" | sed "s/DB_SERVER=//")
MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//") MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//")
@@ -25,6 +26,7 @@ EOF
HOSTNAME=$(hostname -i) HOSTNAME=$(hostname -i)
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.url postgres://${DB_SERVER}.postgres.database.azure.com:5432/${DB_NAME}?sslmode=disable yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.url postgres://${DB_SERVER}.postgres.database.azure.com:5432/${DB_NAME}?sslmode=disable
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.username ${DB_USER} yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.username ${DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.actualUsername ${ACTUAL_DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.password ${DB_PASSWORD} yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.password ${DB_PASSWORD}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.rabbitMq.password JFXR_RABBITMQ_COOKIE yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.rabbitMq.password JFXR_RABBITMQ_COOKIE
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.jfrogUrl ${ARTIFACTORY_URL} yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.jfrogUrl ${ARTIFACTORY_URL}

View File

@@ -14,7 +14,7 @@ This template can help you setup [JFrog Xray](https://jfrog.com/xray/) on Azure
2. Deployed Postgresql instance (if "existing DB" is selected as a parameter). 2. Deployed Postgresql instance (if "existing DB" is selected as a parameter).
## Postgresql deployment ## Postgresql deployment
Xray could fail to connect to "out of the box" Azure Postgresql. You can deploy a compatible Postgresql instance using this link: You can deploy a compatible Postgresql instance using this link:
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fjfrog%2FJFrog-Cloud-Installers%2Farm-xray%2FAzureResourceManager%2FPostgresql%2FazurePostgresDBDeploy.json" target="_blank"> <a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fjfrog%2FJFrog-Cloud-Installers%2Farm-xray%2FAzureResourceManager%2FPostgresql%2FazurePostgresDBDeploy.json" target="_blank">
<img src="https://aka.ms/deploytoazurebutton"/> <img src="https://aka.ms/deploytoazurebutton"/>
@@ -33,16 +33,6 @@ In the Databases field, use the object:
] ]
} }
``` ```
Before deploying Xray, please do following steps:
1. Use the admin role given by Azure that you initially connected with to PSDB (for example xray) - Remember the password of this role to connect when setting up with Xray.
2. Create a new role named xray@{hostname}, where {hostname} is a DB server name.
3. Add xray@{hostname} membership to the base Azure user. In the client tab (PgAdmin for example) right click on properties of role "azure_pg_admin" and under Membership tab, add the relevant "xray@{hostname}", click on the checkbox on the tag, save.
4. Change ownership of Xray database. Right click On the name of the database and change owner to "xray@{hostname}"
After these steps are done, run Xray deployment.
## Installation ## Installation
1. Click "Deploy to Azure" button. If you don't have an Azure subscription, it will guide you on how to signup for a free trial. 1. Click "Deploy to Azure" button. If you don't have an Azure subscription, it will guide you on how to signup for a free trial.

View File

@@ -19,10 +19,11 @@
}, },
"xrayVersion": { "xrayVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.4", "defaultValue": "0.0.5",
"allowedValues": [ "allowedValues": [
"0.0.3", "0.0.3",
"0.0.4" "0.0.4",
"0.0.5"
], ],
"metadata": { "metadata": {
"description": "Xray-vm image version to deploy." "description": "Xray-vm image version to deploy."
@@ -182,6 +183,7 @@
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"db_server": "[parameters('db_server')]", "db_server": "[parameters('db_server')]",
"db_user": "[concat(parameters('db_user'), '@', parameters('db_server'))]", "db_user": "[concat(parameters('db_user'), '@', parameters('db_server'))]",
"actual_db_user": "[parameters('db_user')]",
"db_password": "[parameters('db_password')]", "db_password": "[parameters('db_password')]",
"db_location": "[parameters('location')]", "db_location": "[parameters('location')]",
"db_name": "[parameters('databases').properties[0].name]", "db_name": "[parameters('databases').properties[0].name]",
@@ -189,7 +191,7 @@
"joinKey": "[parameters('joinKey')]", "joinKey": "[parameters('joinKey')]",
"osType": { "osType": {
"publisher": "jfrog", "publisher": "jfrog",
"offer": "x-ray-vm-preview", "offer": "x-ray-vm",
"sku": "x-ray-vm", "sku": "x-ray-vm",
"version": "[parameters('xrayVersion')]" "version": "[parameters('xrayVersion')]"
}, },
@@ -325,7 +327,7 @@
"plan": { "plan": {
"name": "x-ray-vm", "name": "x-ray-vm",
"publisher": "jfrog", "publisher": "jfrog",
"product": "x-ray-vm-preview" "product": "x-ray-vm"
}, },
"sku": { "sku": {
"name": "[parameters('virtualMachineSize')]", "name": "[parameters('virtualMachineSize')]",
@@ -351,7 +353,7 @@
"computerNamePrefix": "[variables('namingInfix')]", "computerNamePrefix": "[variables('namingInfix')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nXRAY_VERSION=', parameters('xrayVersion'),'\nARTIFACTORY_URL=',variables('artifactoryURL'),'\nDB_SERVER=',variables('db_server'),'\nDB_NAME=',variables('db_name'),'\nDB_ADMIN_USER=',variables('db_user'),'\nDB_ADMIN_PASSWD=',variables('db_password'),'\nMASTER_KEY=',variables('masterKey'),'\nJOIN_KEY=',variables('joinKey'),'\n'))]" "customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nXRAY_VERSION=', parameters('xrayVersion'),'\nARTIFACTORY_URL=',variables('artifactoryURL'),'\nDB_SERVER=',variables('db_server'),'\nDB_NAME=',variables('db_name'),'\nDB_ADMIN_USER=',variables('db_user'),'\nACTUAL_DB_ADMIN_USER=',variables('actual_db_user'),'\nDB_ADMIN_PASSWD=',variables('db_password'),'\nMASTER_KEY=',variables('masterKey'),'\nJOIN_KEY=',variables('joinKey'),'\n'))]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaceConfigurations": [ "networkInterfaceConfigurations": [

View File

@@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
DB_NAME=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_NAME=" | sed "s/DB_NAME=//") DB_NAME=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_NAME=" | sed "s/DB_NAME=//")
DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_USER=" | sed "s/DB_ADMIN_USER=//") DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_USER=" | sed "s/DB_ADMIN_USER=//")
ACTUAL_DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ACTUAL_DB_ADMIN_USER=" | sed "s/ACTUAL_DB_ADMIN_USER=//")
DB_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//") DB_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//")
DB_SERVER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_SERVER=" | sed "s/DB_SERVER=//") DB_SERVER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_SERVER=" | sed "s/DB_SERVER=//")
MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//") MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//")
@@ -25,6 +26,7 @@ EOF
HOSTNAME=$(hostname -i) HOSTNAME=$(hostname -i)
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.url postgres://${DB_SERVER}.postgres.database.azure.com:5432/${DB_NAME}?sslmode=disable yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.url postgres://${DB_SERVER}.postgres.database.azure.com:5432/${DB_NAME}?sslmode=disable
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.username ${DB_USER} yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.username ${DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.actualUsername ${ACTUAL_DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.password ${DB_PASSWORD} yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.password ${DB_PASSWORD}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.rabbitMq.password JFXR_RABBITMQ_COOKIE yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.rabbitMq.password JFXR_RABBITMQ_COOKIE
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.jfrogUrl ${ARTIFACTORY_URL} yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.jfrogUrl ${ARTIFACTORY_URL}

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Upgrade version for every release # Upgrade version for every release
XRAY_VERSION=3.8.2 XRAY_VERSION=3.8.5
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive