Merge pull request #51 from jfrog/vm-image-templates

ARM templates for VM images
This commit is contained in:
John Peterson
2020-10-19 15:31:35 -07:00
committed by GitHub
24 changed files with 1154 additions and 28 deletions

View File

@@ -132,7 +132,7 @@
"name": "artifactoryVersion", "name": "artifactoryVersion",
"type": "Microsoft.Common.DropDown", "type": "Microsoft.Common.DropDown",
"label": "Artifactory-vm image version to deploy.", "label": "Artifactory-vm image version to deploy.",
"defaultValue": "7.7.3", "defaultValue": "7.10.2",
"toolTip": "Version of Artifactory to deploy", "toolTip": "Version of Artifactory to deploy",
"constraints": { "constraints": {
"allowedValues": [ "allowedValues": [
@@ -167,6 +167,10 @@
{ {
"label": "7.7.3", "label": "7.7.3",
"value": "0.0.2" "value": "0.0.2"
},
{
"label": "7.10.2",
"value": "0.0.3"
} }
], ],
"required": true "required": true

View File

@@ -79,7 +79,7 @@
}, },
"artifactoryVersion": { "artifactoryVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.2", "defaultValue": "0.0.3",
"allowedValues": [ "allowedValues": [
"6.6.0", "6.6.0",
"6.6.1", "6.6.1",
@@ -95,7 +95,8 @@
"7.4.3", "7.4.3",
"7.4.30", "7.4.30",
"0.0.1", "0.0.1",
"0.0.2" "0.0.2",
"0.0.3"
], ],
"metadata": { "metadata": {
"description": "Artifactory-vm image version to deploy." "description": "Artifactory-vm image version to deploy."

View File

@@ -256,6 +256,17 @@ cat /tmp/temp.key | sed 's/KEY----- /&\n/' | sed 's/ -----END/\n-----END/' | awk
rm /tmp/temp.key rm /tmp/temp.key
fi fi
cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json
{
"productId": "ARM_artifactory-pro-template/1.0.0",
"features": [
{
"featureId": "Partner/ACC-007221"
}
]
}
EOF
chown artifactory:artifactory -R /var/opt/jfrog/artifactory/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/security && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/* chown artifactory:artifactory -R /var/opt/jfrog/artifactory/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/security && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/*
# start Artifactory # start Artifactory

View File

@@ -79,26 +79,21 @@
}, },
"artifactoryVersion": { "artifactoryVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.2", "defaultValue": "0.0.3",
"allowedValues": [ "allowedValues": [
"6.6.0",
"6.6.1",
"6.7.0",
"6.8.0",
"6.11.3", "6.11.3",
"6.15.0", "6.15.0",
"0.16.0", "0.16.0",
"0.17.0", "0.17.0",
"6.18.0", "6.18.0",
"7.0.0717",
"7.0.4001",
"7.2.1", "7.2.1",
"7.4.3", "7.4.3",
"7.4.30", "7.4.30",
"7.4.31", "7.4.31",
"7.5.7", "7.5.7",
"0.0.1", "0.0.1",
"0.0.2" "0.0.2",
"0.0.3"
], ],
"metadata": { "metadata": {
"description": "Artifactory-vm image version to deploy." "description": "Artifactory-vm image version to deploy."

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Upgrade version for every release # Upgrade version for every release
ARTIFACTORY_VERSION=7.7.3 ARTIFACTORY_VERSION=$1
UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//") UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//")
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive

View File

@@ -0,0 +1,262 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "String"
},
"networkInterfaceName": {
"type": "String"
},
"networkSecurityGroupName": {
"type": "String"
},
"networkSecurityGroupRules": {
"type": "Array"
},
"subnetName": {
"type": "String"
},
"virtualNetworkName": {
"type": "String"
},
"addressPrefixes": {
"type": "Array"
},
"subnets": {
"type": "Array"
},
"publicIpAddressName": {
"type": "String"
},
"publicIpAddressType": {
"type": "String"
},
"publicIpAddressSku": {
"type": "String"
},
"virtualMachineName": {
"type": "String"
},
"virtualMachineComputerName": {
"type": "String"
},
"storageAccountName": {
"type": "String"
},
"virtualMachineSize": {
"type": "String"
},
"adminUsername": {
"type": "String"
},
"adminPassword": {
"type": "SecureString"
},
"diagnosticsStorageAccountName": {
"type": "String"
},
"diagnosticsStorageAccountId": {
"type": "String"
},
"diagnosticsStorageAccountType": {
"type": "String"
},
"diagnosticsStorageAccountKind": {
"type": "String"
},
"_artifactsLocation": {
"type": "string",
"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."
},
"defaultValue": "https://raw.githubusercontent.com/jfrog/JFrog-Cloud-Installers/vm-image-templates/AzureResourceManager/Artifactory/"
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
},
"defaultValue": ""
},
"artifactoryVersion": {
"type": "String"
},
"scriptName": {
"type": "String"
},
"baseTime": {
"type": "string",
"defaultValue": "[utcNow()]"
}
},
"variables": {
"nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",
"vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]",
"storageContainerUri": "[concat(concat('https://', parameters('storageAccountName'), '.blob.core.windows.net/'), 'vhds/')]",
"scriptName": "[parameters('scriptName')]",
"commandToExecute": "[concat('bash ', variables('scriptName'), ' ', parameters('artifactoryVersion'))]",
"fileLocation": "[uri(parameters('_artifactsLocation'), concat('vm_install/', variables('scriptName'), parameters('_artifactsLocationSasToken')))]",
"diskNameSalt": "[concat(parameters('artifactoryVersion'), '-', parameters('baseTime'))]"
},
"resources": [
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2019-07-01",
"name": "[parameters('networkInterfaceName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
"[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
"[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
},
"privateIPAllocationMethod": "Dynamic",
"publicIpAddress": {
"id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
}
}
}
],
"networkSecurityGroup": {
"id": "[variables('nsgId')]"
}
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-02-01",
"name": "[parameters('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": "[parameters('networkSecurityGroupRules')]"
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-09-01",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": "[parameters('addressPrefixes')]"
},
"subnets": "[parameters('subnets')]"
}
},
{
"type": "Microsoft.Network/publicIpAddresses",
"apiVersion": "2019-02-01",
"name": "[parameters('publicIpAddressName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('publicIpAddressSku')]"
},
"properties": {
"publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2019-07-01",
"name": "[parameters('virtualMachineName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"osDisk": {
"createOption": "fromImage",
"vhd": {
"uri": "[concat(variables('storageContainerUri'), parameters('virtualMachineName'), variables('diskNameSalt'), '.vhd')]"
},
"name": "[parameters('virtualMachineName')]"
},
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachineComputerName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]"
}
}
},
"resources":[
{
"name": "extension1",
"type": "extensions",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[variables('fileLocation')]"
],
"commandToExecute": "[variables('commandToExecute')]"
}
}
}
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('diagnosticsStorageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('diagnosticsStorageAccountType')]"
},
"kind": "[parameters('diagnosticsStorageAccountKind')]",
"properties": {}
}
],
"outputs": {
"adminUsername": {
"type": "String",
"value": "[parameters('adminUsername')]"
},
"commandTExecute": {
"type": "String",
"value": "[variables('commandToExecute')]"
}
}
}

View File

@@ -0,0 +1,99 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "westus2"
},
"networkInterfaceName": {
"value": "rt-nic"
},
"networkSecurityGroupName": {
"value": "rt-nsg"
},
"networkSecurityGroupRules": {
"value": [
{
"name": "SSH",
"properties": {
"priority": 300,
"protocol": "TCP",
"access": "Allow",
"direction": "Inbound",
"sourceAddressPrefix": "*",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"destinationPortRange": "22"
}
}
]
},
"subnetName": {
"value": "default"
},
"virtualNetworkName": {
"value": "artifactory-vm-test-vnet"
},
"addressPrefixes": {
"value": [
"10.0.0.0/24"
]
},
"subnets": {
"value": [
{
"name": "default",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
]
},
"publicIpAddressName": {
"value": "rt-public-ip"
},
"publicIpAddressType": {
"value": "Dynamic"
},
"publicIpAddressSku": {
"value": "Basic"
},
"virtualMachineName": {
"value": "artifactory-vm"
},
"virtualMachineComputerName": {
"value": "rtvm"
},
"storageAccountName": {
"value": "mpstoragevhd"
},
"virtualMachineSize": {
"value": "Standard_B4ms"
},
"diagnosticsStorageAccountName": {
"value": "artifactoryvmtestdiag"
},
"diagnosticsStorageAccountId": {
"value": "Microsoft.Storage/storageAccounts/artifactoryvmtestdiag"
},
"diagnosticsStorageAccountType": {
"value": "Standard_LRS"
},
"diagnosticsStorageAccountKind": {
"value": "Storage"
},
"adminUsername": {
"value": "vmuser"
},
"adminPassword": {
"value": "OWERWRITE_THE_PASSWORD"
},
"artifactoryVersion": {
"value": "7.10.2"
},
"scriptName": {
"value": "install_pro7_to_vm.sh"
}
}
}

View File

@@ -101,7 +101,7 @@
"name": "artifactoryVersion", "name": "artifactoryVersion",
"type": "Microsoft.Common.DropDown", "type": "Microsoft.Common.DropDown",
"label": "JFrog Container Registry-vm image version to deploy.", "label": "JFrog Container Registry-vm image version to deploy.",
"defaultValue": "7.7.3", "defaultValue": "7.10.2",
"toolTip": "Version of JFrog Container Registry to deploy", "toolTip": "Version of JFrog Container Registry to deploy",
"constraints": { "constraints": {
"allowedValues": [ "allowedValues": [
@@ -120,6 +120,10 @@
{ {
"label": "7.7.3", "label": "7.7.3",
"value": "0.0.2" "value": "0.0.2"
},
{
"label": "7.10.2",
"value": "0.0.3"
} }
], ],
"required": true "required": true

View File

@@ -25,12 +25,13 @@
}, },
"artifactoryVersion": { "artifactoryVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.2", "defaultValue": "0.0.3",
"allowedValues": [ "allowedValues": [
"7.2.1", "7.2.1",
"7.3.2", "7.3.2",
"7.4.3", "7.4.3",
"0.0.2" "0.0.2",
"0.0.3"
], ],
"metadata": { "metadata": {
"description": "JFrog Container Registry-vm image version to deploy." "description": "JFrog Container Registry-vm image version to deploy."

View File

@@ -160,6 +160,17 @@ cat <<EOF >/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml
</config> </config>
EOF EOF
cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json
{
"productId": "ARM_artifactory-jcr-template/1.0.0",
"features": [
{
"featureId": "Partner/ACC-007221"
}
]
}
EOF
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//" > /tmp/temp.pem cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//" > /tmp/temp.pem
cat /tmp/temp.pem | sed 's/CERTIFICATE----- /&\n/g' | sed 's/ -----END/\n-----END/g' | awk '{if($0 ~ /----/) {print;} else { gsub(/ /,"\n");print;}}' > /etc/pki/tls/certs/cert.pem cat /tmp/temp.pem | sed 's/CERTIFICATE----- /&\n/g' | sed 's/ -----END/\n-----END/g' | awk '{if($0 ~ /----/) {print;} else { gsub(/ /,"\n");print;}}' > /etc/pki/tls/certs/cert.pem
rm /tmp/temp.pem rm /tmp/temp.pem

View File

@@ -25,12 +25,13 @@
}, },
"artifactoryVersion": { "artifactoryVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.2", "defaultValue": "0.0.3",
"allowedValues": [ "allowedValues": [
"7.2.1", "7.2.1",
"7.3.2", "7.3.2",
"7.4.3", "7.4.3",
"0.0.2" "0.0.2",
"0.0.3"
], ],
"metadata": { "metadata": {
"description": "JFrog Container Registry-vm image version to deploy." "description": "JFrog Container Registry-vm image version to deploy."

View File

@@ -160,6 +160,17 @@ cat <<EOF >/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml
</config> </config>
EOF EOF
cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json
{
"productId": "ARM_artifactory-jcr-template/1.0.0",
"features": [
{
"featureId": "Partner/ACC-007221"
}
]
}
EOF
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//" > /tmp/temp.pem cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//" > /tmp/temp.pem
cat /tmp/temp.pem | sed 's/CERTIFICATE----- /&\n/g' | sed 's/ -----END/\n-----END/g' | awk '{if($0 ~ /----/) {print;} else { gsub(/ /,"\n");print;}}' > /etc/pki/tls/certs/cert.pem cat /tmp/temp.pem | sed 's/CERTIFICATE----- /&\n/g' | sed 's/ -----END/\n-----END/g' | awk '{if($0 ~ /----/) {print;} else { gsub(/ /,"\n");print;}}' > /etc/pki/tls/certs/cert.pem
rm /tmp/temp.pem rm /tmp/temp.pem

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Upgrade version for every release # Upgrade version for every release
ARTIFACTORY_VERSION=7.7.3 ARTIFACTORY_VERSION=$1
UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//") UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//")
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@@ -25,7 +25,7 @@ apt-get -y install jfrog-artifactory-jcr=${ARTIFACTORY_VERSION} >> /tmp/install-
mkdir -p /var/opt/jfrog/artifactory/etc/info mkdir -p /var/opt/jfrog/artifactory/etc/info
cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json
{ {
"productId": "ARM_artifactory-jcr/1.0.0", "productId": "ARM_artifactory-jcr-vm/1.0.0",
"features": [ "features": [
{ {
"featureId": "Partner/ACC-007221" "featureId": "Partner/ACC-007221"

View File

@@ -0,0 +1,257 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "String"
},
"namingInfix": {
"type": "string"
},
"networkSecurityGroupRules": {
"type": "Array"
},
"subnetName": {
"type": "String"
},
"addressPrefixes": {
"type": "Array"
},
"subnets": {
"type": "Array"
},
"publicIpAddressType": {
"type": "String"
},
"publicIpAddressSku": {
"type": "String"
},
"virtualMachineName": {
"type": "String"
},
"virtualMachineComputerName": {
"type": "String"
},
"storageAccountName": {
"type": "String"
},
"virtualMachineSize": {
"type": "String"
},
"adminUsername": {
"type": "String"
},
"adminPassword": {
"type": "SecureString"
},
"diagnosticsStorageAccountName": {
"type": "String"
},
"diagnosticsStorageAccountId": {
"type": "String"
},
"diagnosticsStorageAccountType": {
"type": "String"
},
"diagnosticsStorageAccountKind": {
"type": "String"
},
"_artifactsLocation": {
"type": "string",
"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."
},
"defaultValue": "https://raw.githubusercontent.com/jfrog/JFrog-Cloud-Installers/vm-image-templates/AzureResourceManager/JCR/"
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
},
"defaultValue": ""
},
"artifactoryVersion": {
"type": "String"
},
"scriptName": {
"type": "String"
},
"baseTime": {
"type": "string",
"defaultValue": "[utcNow()]"
}
},
"variables": {
"networkInterfaceName": "[concat(parameters('namingInfix'), '-nic')]",
"networkSecurityGroupName": "[concat(parameters('namingInfix'), '-nsg')]",
"virtualNetworkName": "[concat(parameters('namingInfix'), '-vnet')]",
"publicIpAddressName": "[concat(parameters('namingInfix'), '-public-ip')]",
"nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]",
"vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]",
"storageContainerUri": "[concat(concat('https://', parameters('storageAccountName'), '.blob.core.windows.net/'), 'vhds/')]",
"scriptName": "[parameters('scriptName')]",
"commandToExecute": "[concat('bash ', variables('scriptName'), ' ', parameters('artifactoryVersion'))]",
"fileLocation": "[uri(parameters('_artifactsLocation'), concat('vm_install/', variables('scriptName'), parameters('_artifactsLocationSasToken')))]",
"diskNameSalt": "[concat(parameters('artifactoryVersion'), '-', parameters('baseTime'))]"
},
"resources": [
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2019-07-01",
"name": "[variables('networkInterfaceName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[concat('Microsoft.Network/publicIpAddresses/', variables('publicIpAddressName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
},
"privateIPAllocationMethod": "Dynamic",
"publicIpAddress": {
"id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', variables('publicIpAddressName'))]"
}
}
}
],
"networkSecurityGroup": {
"id": "[variables('nsgId')]"
}
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-02-01",
"name": "[variables('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": "[parameters('networkSecurityGroupRules')]"
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-09-01",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": "[parameters('addressPrefixes')]"
},
"subnets": "[parameters('subnets')]"
}
},
{
"type": "Microsoft.Network/publicIpAddresses",
"apiVersion": "2019-02-01",
"name": "[variables('publicIpAddressName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('publicIpAddressSku')]"
},
"properties": {
"publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2019-07-01",
"name": "[parameters('virtualMachineName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('networkInterfaceName'))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"osDisk": {
"createOption": "fromImage",
"vhd": {
"uri": "[concat(variables('storageContainerUri'), parameters('virtualMachineName'), variables('diskNameSalt'), '.vhd')]"
},
"name": "[parameters('virtualMachineName')]"
},
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachineComputerName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]"
}
}
},
"resources":[
{
"name": "extension1",
"type": "extensions",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[variables('fileLocation')]"
],
"commandToExecute": "[variables('commandToExecute')]"
}
}
}
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('diagnosticsStorageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('diagnosticsStorageAccountType')]"
},
"kind": "[parameters('diagnosticsStorageAccountKind')]",
"properties": {}
}
],
"outputs": {
"adminUsername": {
"type": "String",
"value": "[parameters('adminUsername')]"
},
"commandTExecute": {
"type": "String",
"value": "[variables('commandToExecute')]"
}
}
}

View File

@@ -0,0 +1,90 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "westus2"
},
"namingInfix": {
"value": "jcr"
},
"networkSecurityGroupRules": {
"value": [
{
"name": "SSH",
"properties": {
"priority": 300,
"protocol": "TCP",
"access": "Allow",
"direction": "Inbound",
"sourceAddressPrefix": "*",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"destinationPortRange": "22"
}
}
]
},
"subnetName": {
"value": "default"
},
"addressPrefixes": {
"value": [
"10.0.0.0/24"
]
},
"subnets": {
"value": [
{
"name": "default",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
]
},
"publicIpAddressType": {
"value": "Dynamic"
},
"publicIpAddressSku": {
"value": "Basic"
},
"virtualMachineName": {
"value": "jcr-vm"
},
"virtualMachineComputerName": {
"value": "jcrvm"
},
"storageAccountName": {
"value": "mpstoragevhd"
},
"virtualMachineSize": {
"value": "Standard_B4ms"
},
"diagnosticsStorageAccountName": {
"value": "jcrvmtestdiag"
},
"diagnosticsStorageAccountId": {
"value": "Microsoft.Storage/storageAccounts/jcrvmtestdiag"
},
"diagnosticsStorageAccountType": {
"value": "Standard_LRS"
},
"diagnosticsStorageAccountKind": {
"value": "Storage"
},
"adminUsername": {
"value": "vmuser"
},
"adminPassword": {
"value": "OWERWRITE_THE_PASSWORD"
},
"artifactoryVersion": {
"value": "7.10.2"
},
"scriptName": {
"value": "install_jcr7_to_vm.sh"
}
}
}

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.5", "defaultValue": "3.9.1",
"toolTip": "Version of Xray to deploy", "toolTip": "Version of Xray to deploy",
"constraints": { "constraints": {
"allowedValues": [ "allowedValues": [
@@ -138,6 +138,10 @@
{ {
"label": "3.8.5", "label": "3.8.5",
"value": "0.0.5" "value": "0.0.5"
},
{
"label": "3.9.1",
"value": "0.0.6"
} }
], ],
"required": true "required": true

View File

@@ -19,11 +19,12 @@
}, },
"xrayVersion": { "xrayVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.5", "defaultValue": "0.0.6",
"allowedValues": [ "allowedValues": [
"0.0.3", "0.0.3",
"0.0.4", "0.0.4",
"0.0.5" "0.0.5",
"0.0.6"
], ],
"metadata": { "metadata": {
"description": "Xray-vm image version to deploy." "description": "Xray-vm image version to deploy."

View File

@@ -21,6 +21,12 @@ cat <<EOF >/opt/jfrog/xray/var/etc/security/master.key
${MASTER_KEY} ${MASTER_KEY}
EOF EOF
# Add Template Callhome to the Xray instance
cat <<EOF >>/opt/jfrog/xray/app/bin/xray.default
export PARTNER_ID=Partner/ACC-007221
export INTEGRATION_NAME=ARM_xray-template/1.0.0
EOF
# Xray should have the same join key as the Artifactory instance # Xray should have the same join key as the Artifactory instance
# Both application should be deployed in the same Virtual Networks # Both application should be deployed in the same Virtual Networks
HOSTNAME=$(hostname -i) HOSTNAME=$(hostname -i)

View File

@@ -33,7 +33,7 @@
"value": "10.0.1.0/24" "value": "10.0.1.0/24"
}, },
"xrayVersion": { "xrayVersion": {
"value": "0.0.4" "value": "0.0.6"
}, },
"artifactoryURL": { "artifactoryURL": {
"value": "http://artifactory-url.cloudapp.azure.com" "value": "http://artifactory-url.cloudapp.azure.com"

View File

@@ -19,11 +19,12 @@
}, },
"xrayVersion": { "xrayVersion": {
"type": "string", "type": "string",
"defaultValue": "0.0.5", "defaultValue": "0.0.6",
"allowedValues": [ "allowedValues": [
"0.0.3", "0.0.3",
"0.0.4", "0.0.4",
"0.0.5" "0.0.5",
"0.0.6"
], ],
"metadata": { "metadata": {
"description": "Xray-vm image version to deploy." "description": "Xray-vm image version to deploy."

View File

@@ -21,6 +21,12 @@ cat <<EOF >/opt/jfrog/xray/var/etc/security/master.key
${MASTER_KEY} ${MASTER_KEY}
EOF EOF
# Add Template Callhome to the Xray instance
cat <<EOF >>/opt/jfrog/xray/app/bin/xray.default
export PARTNER_ID=Partner/ACC-007221
export INTEGRATION_NAME=ARM_xray-template/1.0.0
EOF
# Xray should have the same join key as the Artifactory instance # Xray should have the same join key as the Artifactory instance
# Both application should be deployed in the same Virtual Networks # Both application should be deployed in the same Virtual Networks
HOSTNAME=$(hostname -i) HOSTNAME=$(hostname -i)

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Upgrade version for every release # Upgrade version for every release
XRAY_VERSION=3.8.5 XRAY_VERSION=$1
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@@ -33,10 +33,10 @@ EOF
# Run interactive installation script with default parameters # Run interactive installation script with default parameters
cat "/opt/jfrog-xray-${XRAY_VERSION}-deb/input.txt" | ./install.sh >> /var/log/install-xray.log 2>&1 cat "/opt/jfrog-xray-${XRAY_VERSION}-deb/input.txt" | ./install.sh >> /var/log/install-xray.log 2>&1
# Add Callhome to the Xray instance # Add VM image Callhome to the Xray instance
cat <<EOF >>/opt/jfrog/xray/app/bin/xray.default cat <<EOF >>/opt/jfrog/xray/app/bin/xray.default
export PARTNER_ID=Partner/ACC-007221 export PARTNER_ID=Partner/ACC-007221
export INTEGRATION_NAME=ARM_xray/1.0.0 export INTEGRATION_NAME=ARM_xray-vm/1.0.0
EOF EOF
# Remove Xray service from boot up run # Remove Xray service from boot up run

View File

@@ -0,0 +1,262 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "String"
},
"networkInterfaceName": {
"type": "String"
},
"networkSecurityGroupName": {
"type": "String"
},
"networkSecurityGroupRules": {
"type": "Array"
},
"subnetName": {
"type": "String"
},
"virtualNetworkName": {
"type": "String"
},
"addressPrefixes": {
"type": "Array"
},
"subnets": {
"type": "Array"
},
"publicIpAddressName": {
"type": "String"
},
"publicIpAddressType": {
"type": "String"
},
"publicIpAddressSku": {
"type": "String"
},
"virtualMachineName": {
"type": "String"
},
"virtualMachineComputerName": {
"type": "String"
},
"storageAccountName": {
"type": "String"
},
"virtualMachineSize": {
"type": "String"
},
"adminUsername": {
"type": "String"
},
"adminPassword": {
"type": "SecureString"
},
"diagnosticsStorageAccountName": {
"type": "String"
},
"diagnosticsStorageAccountId": {
"type": "String"
},
"diagnosticsStorageAccountType": {
"type": "String"
},
"diagnosticsStorageAccountKind": {
"type": "String"
},
"_artifactsLocation": {
"type": "string",
"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."
},
"defaultValue": "https://raw.githubusercontent.com/jfrog/JFrog-Cloud-Installers/vm-image-templates/AzureResourceManager/Xray/"
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
},
"defaultValue": ""
},
"xrayVersion": {
"type": "String"
},
"scriptName": {
"type": "String"
},
"baseTime": {
"type": "string",
"defaultValue": "[utcNow()]"
}
},
"variables": {
"nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",
"vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]",
"storageContainerUri": "[concat(concat('https://', parameters('storageAccountName'), '.blob.core.windows.net/'), 'vhds/')]",
"scriptName": "[parameters('scriptName')]",
"commandToExecute": "[concat('bash ', variables('scriptName'), ' ', parameters('xrayVersion'))]",
"fileLocation": "[uri(parameters('_artifactsLocation'), concat('vm_install/', variables('scriptName'), parameters('_artifactsLocationSasToken')))]",
"diskNameSalt": "[concat(parameters('xrayVersion'), '-', parameters('baseTime'))]"
},
"resources": [
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2019-07-01",
"name": "[parameters('networkInterfaceName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
"[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
"[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
},
"privateIPAllocationMethod": "Dynamic",
"publicIpAddress": {
"id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
}
}
}
],
"networkSecurityGroup": {
"id": "[variables('nsgId')]"
}
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-02-01",
"name": "[parameters('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": "[parameters('networkSecurityGroupRules')]"
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-09-01",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": "[parameters('addressPrefixes')]"
},
"subnets": "[parameters('subnets')]"
}
},
{
"type": "Microsoft.Network/publicIpAddresses",
"apiVersion": "2019-02-01",
"name": "[parameters('publicIpAddressName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('publicIpAddressSku')]"
},
"properties": {
"publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2019-07-01",
"name": "[parameters('virtualMachineName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"osDisk": {
"createOption": "fromImage",
"vhd": {
"uri": "[concat(variables('storageContainerUri'), parameters('virtualMachineName'), variables('diskNameSalt'), '.vhd')]"
},
"name": "[parameters('virtualMachineName')]"
},
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachineComputerName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]"
}
}
},
"resources":[
{
"name": "extension1",
"type": "extensions",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[variables('fileLocation')]"
],
"commandToExecute": "[variables('commandToExecute')]"
}
}
}
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('diagnosticsStorageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('diagnosticsStorageAccountType')]"
},
"kind": "[parameters('diagnosticsStorageAccountKind')]",
"properties": {}
}
],
"outputs": {
"adminUsername": {
"type": "String",
"value": "[parameters('adminUsername')]"
},
"commandTExecute": {
"type": "String",
"value": "[variables('commandToExecute')]"
}
}
}

View File

@@ -0,0 +1,99 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "westus2"
},
"networkInterfaceName": {
"value": "xray-nic"
},
"networkSecurityGroupName": {
"value": "xray-nsg"
},
"networkSecurityGroupRules": {
"value": [
{
"name": "SSH",
"properties": {
"priority": 300,
"protocol": "TCP",
"access": "Allow",
"direction": "Inbound",
"sourceAddressPrefix": "*",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"destinationPortRange": "22"
}
}
]
},
"subnetName": {
"value": "default"
},
"virtualNetworkName": {
"value": "xray-vm-test-vnet"
},
"addressPrefixes": {
"value": [
"10.0.0.0/24"
]
},
"subnets": {
"value": [
{
"name": "default",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
]
},
"publicIpAddressName": {
"value": "xray-public-ip"
},
"publicIpAddressType": {
"value": "Dynamic"
},
"publicIpAddressSku": {
"value": "Basic"
},
"virtualMachineName": {
"value": "xray-vm"
},
"virtualMachineComputerName": {
"value": "xrayvm"
},
"storageAccountName": {
"value": "mpstoragevhd"
},
"virtualMachineSize": {
"value": "Standard_B4ms"
},
"diagnosticsStorageAccountName": {
"value": "xrayvmvmtestdiag"
},
"diagnosticsStorageAccountId": {
"value": "Microsoft.Storage/storageAccounts/xrayvmvmtestdiag"
},
"diagnosticsStorageAccountType": {
"value": "Standard_LRS"
},
"diagnosticsStorageAccountKind": {
"value": "Storage"
},
"adminUsername": {
"value": "vmuser"
},
"adminPassword": {
"value": "OWERWRITE_THE_PASSWORD"
},
"xrayVersion": {
"value": "3.9.1"
},
"scriptName": {
"value": "install_xray_to_vm.sh"
}
}
}