mirror of
https://github.com/ZwareBear/JFrog-Cloud-Installers.git
synced 2026-01-21 05:06:56 -06:00
ARM templates changes to met MS requirements
This commit is contained in:
449
AzureResourceManager/MP_submission_7/createUiDefinition.json
Normal file
449
AzureResourceManager/MP_submission_7/createUiDefinition.json
Normal file
@@ -0,0 +1,449 @@
|
||||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
|
||||
"handler": "Microsoft.Azure.CreateUIDef",
|
||||
"version": "0.1.2-preview",
|
||||
"parameters": {
|
||||
"basics": [
|
||||
{}
|
||||
],
|
||||
"steps": [
|
||||
{
|
||||
"name": "vmCredentials",
|
||||
"label": "VM Credential",
|
||||
"bladeTitle": "VM Credential",
|
||||
"subLabel": {
|
||||
"preValidation": "Provide VM credentials",
|
||||
"postValidation": "Great - let's move on!"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "adminUsername",
|
||||
"type": "Microsoft.Compute.UserNameTextBox",
|
||||
"label": "Admin username",
|
||||
"osPlatform": "Linux",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^[a-z0-9A-Z]{1,30}$",
|
||||
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-30 characters long."
|
||||
},
|
||||
"toolTip": "Provide admin username for the virtual machine"
|
||||
},
|
||||
{
|
||||
"name": "adminPassword",
|
||||
"type": "Microsoft.Compute.CredentialsCombo",
|
||||
"label": {
|
||||
"password": "Password",
|
||||
"confirmPassword": "Confirm password"
|
||||
},
|
||||
"osPlatform": "Linux",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"customPasswordRegex": "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{12,}$",
|
||||
"customValidationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number."
|
||||
},
|
||||
"options": {
|
||||
"hideConfirmation": false
|
||||
},
|
||||
"toolTip": {
|
||||
"password": "Provide admin password for the virtual machine"
|
||||
},
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "clusterConfig",
|
||||
"label": "Artifactory Cluster settings",
|
||||
"subLabel": {
|
||||
"preValidation": "Configure Artifactory Cluster settings",
|
||||
"postValidation": "Done!"
|
||||
},
|
||||
"bladeTitle": "Artifactory Cluster Settings",
|
||||
"elements": [
|
||||
{
|
||||
"name": "clusterName",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Cluster name",
|
||||
"toolTip": "Cluster name",
|
||||
"defaultValue": "",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^[a-z0-9A-Z]{1,30}$",
|
||||
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-30 characters long."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "vmSku",
|
||||
"type": "Microsoft.Compute.SizeSelector",
|
||||
"label": "Virtual machine size",
|
||||
"toolTip": "The size of the virtual machine for Artifactory",
|
||||
"recommendedSizes": [
|
||||
"Standard_D4s_v3"
|
||||
],
|
||||
"constraints": {
|
||||
"allowedSizes": [
|
||||
"Standard_A2_v2",
|
||||
"Standard_A4_v2",
|
||||
"Standard_A4",
|
||||
"Standard_D2s_v3",
|
||||
"Standard_D4s_v3",
|
||||
"Standard_D8s_v3",
|
||||
"Standard_D16s_v3",
|
||||
"Standard_D32s_v3",
|
||||
"Standard_DS3_v2",
|
||||
"Standard_D2_v2",
|
||||
"Standard_D3_v2",
|
||||
"Standard_DC2s",
|
||||
"Standard_DC4s"
|
||||
]
|
||||
},
|
||||
"osPlatform": "Linux",
|
||||
"count": 1
|
||||
},
|
||||
{
|
||||
"name": "nodeCount",
|
||||
"type": "Microsoft.Common.DropDown",
|
||||
"label": "Number of additional VM instances for member Artifactory nodes. Minimum 1 node.(+1 primary = 2 node cluster)",
|
||||
"defaultValue": "2",
|
||||
"toolTip": "Number of Artifactory member nodes in cluster",
|
||||
"constraints": {
|
||||
"allowedValues": [
|
||||
{
|
||||
"label": "1",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"label": "2",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"label": "3",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"label": "4",
|
||||
"value": 4
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
},
|
||||
"visible": "true"
|
||||
},
|
||||
{
|
||||
"name": "artifactoryVersion",
|
||||
"type": "Microsoft.Common.DropDown",
|
||||
"label": "Artifactory-vm image version to deploy.",
|
||||
"defaultValue": "7.4.3",
|
||||
"toolTip": "Version of Artifactory to deploy",
|
||||
"constraints": {
|
||||
"allowedValues": [
|
||||
{
|
||||
"label": "6.8.0",
|
||||
"value": "6.8.0"
|
||||
},
|
||||
{
|
||||
"label": "6.16.0",
|
||||
"value": "0.16.0"
|
||||
},
|
||||
{
|
||||
"label": "6.17.0",
|
||||
"value": "0.17.0"
|
||||
},
|
||||
{
|
||||
"label": "6.18.0",
|
||||
"value": "6.18.0"
|
||||
},
|
||||
{
|
||||
"label": "7.2.1",
|
||||
"value": "7.2.1"
|
||||
},
|
||||
{
|
||||
"label": "7.3.2",
|
||||
"value": "0.3.2"
|
||||
},
|
||||
{
|
||||
"label": "7.4.3",
|
||||
"value": "7.4.3"
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
},
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"name": "masterKey",
|
||||
"type": "Microsoft.Common.PasswordBox",
|
||||
"label": {
|
||||
"password": "Artifactory master Key",
|
||||
"confirmPassword": "Confirm master Key"
|
||||
},
|
||||
"toolTip": "Master key for Artifactory cluster. Generate master.key using command '$openssl rand -hex 16'",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^[a-z0-9A-Z]{1,32}$",
|
||||
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-32 characters long."
|
||||
},
|
||||
"options": {
|
||||
"hideConfirmation": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "artifactoryLicense1",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Artifactory Enterprise License.",
|
||||
"toolTip": "Artifactory Enterprise License. Providing one license is mandatory",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^.{1,10000}",
|
||||
"validationMessage": "Only Enterprise licenses are allowed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "artifactoryLicense2",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Artifactory Enterprise License.",
|
||||
"toolTip": "Artifactory Enterprise License. Providing one license is mandatory",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^.{1,10000}",
|
||||
"validationMessage": "Only Enterprise licenses are allowed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "artifactoryLicense3",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Artifactory Enterprise License.",
|
||||
"toolTip": "Artifactory Enterprise License. Providing one license is mandatory",
|
||||
"constraints": {
|
||||
"required": false,
|
||||
"regex": "^.{1,10000}",
|
||||
"validationMessage": "Only Enterprise licenses are allowed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "artifactoryLicense4",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Artifactory Enterprise License.",
|
||||
"toolTip": "Artifactory Enterprise License. Providing one license is mandatory",
|
||||
"constraints": {
|
||||
"required": false,
|
||||
"regex": "^.{1,10000}",
|
||||
"validationMessage": "Only Enterprise licenses are allowed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "artifactoryLicense5",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Artifactory Enterprise License.",
|
||||
"toolTip": "Artifactory Enterprise License. Providing one license is mandatory",
|
||||
"constraints": {
|
||||
"required": false,
|
||||
"regex": "^.{1,10000}",
|
||||
"validationMessage": "Only Enterprise licenses are allowed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "certificate",
|
||||
"type": "Microsoft.Common.PasswordBox",
|
||||
"label": {
|
||||
"password": "Provide your SSL Certificate.",
|
||||
"confirmPassword": "Confirm SSL Certificate."
|
||||
},
|
||||
"toolTip": "To use Artifactory as docker registry you need to provide wild card valid Certificate. Provide your SSL Certificate.",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^(-----BEGIN CERTIFICATE-----)(.+)(-----END CERTIFICATE-----)$",
|
||||
"validationMessage": "Provide SSL Certificate."
|
||||
},
|
||||
"options": {
|
||||
"hideConfirmation": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "certificateKey",
|
||||
"type": "Microsoft.Common.PasswordBox",
|
||||
"label": {
|
||||
"password": "Provide your SSL Certificate key.",
|
||||
"confirmPassword": "Confirm SSL Certificate key."
|
||||
},
|
||||
"toolTip": "Provide your SSL Certificate key",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^(-----BEGIN)(.+)(PRIVATE KEY-----)(.+)(-----END)(.+)(PRIVATE KEY-----)$",
|
||||
"validationMessage": "Provide SSL Certificate Key."
|
||||
},
|
||||
"options": {
|
||||
"hideConfirmation": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "certificateDomain",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Provide your Certificate Domain Name.",
|
||||
"defaultValue": "artifactory",
|
||||
"toolTip": "Provide your Certificate Domain Name. For e.g jfrog.team for certificate with *.jfrog.team",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^(\\*)*([\\w-\\.])+$",
|
||||
"validationMessage": "Must be a valid fully-qualified domain name."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "artifactoryServerName",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Provide artifactory server name to be used in Nginx.",
|
||||
"defaultValue": "artifactory",
|
||||
"toolTip": "Provide artifactory server name to be used in Nginx. e.g artifactory for artifactory.jfrog.team",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^[a-z0-9A-Z]{1,20}$",
|
||||
"validationMessage": "Only letters and numbers are allowed, and the value must be 1-20 characters long."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "extraJavaOptions",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Setting Java Memory Parameters for Artifactory",
|
||||
"defaultValue": "-server -Xms2g -Xmx8g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError=\\\"kill -9 %p\\\"",
|
||||
"toolTip": "Setting Java Memory Parameters for Artifactory. Learn about system requirements for Artifactory https://www.jfrog.com/confluence/display/RTF/System+Requirements#SystemRequirements-RecommendedHardware.",
|
||||
"constraints": {
|
||||
"required": false,
|
||||
"regex": "[^a-zA-Z0-9]+\\S+\\D",
|
||||
"validationMessage": "Example: -server -Xms2g -Xmx12g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError=\\\"kill -9 %p\\\""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "databaseConfig",
|
||||
"label": "Database Configuration",
|
||||
"subLabel": {
|
||||
"preValidation": "Configure the Database",
|
||||
"postValidation": "Done"
|
||||
},
|
||||
"bladeTitle": "Database Credential",
|
||||
"elements": [
|
||||
{
|
||||
"name": "dbAdminUsername",
|
||||
"type": "Microsoft.Compute.UserNameTextBox",
|
||||
"label": "User name",
|
||||
"toolTip": "Admin username for the database",
|
||||
"osPlatform": "Linux",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^[a-z0-9A-Z]{1,30}$",
|
||||
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-30 characters long."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dbAdminPassword",
|
||||
"type": "Microsoft.Common.PasswordBox",
|
||||
"label": {
|
||||
"password": "Password",
|
||||
"confirmPassword": "Confirm password"
|
||||
},
|
||||
"toolTip": "Admin password for the database",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{12,}$",
|
||||
"validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number."
|
||||
},
|
||||
"options": {
|
||||
"hideConfirmation": false
|
||||
},
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"name": "dbName",
|
||||
"type": "Microsoft.Common.TextBox",
|
||||
"label": "Database name",
|
||||
"toolTip": "Database name",
|
||||
"constraints": {
|
||||
"required": true,
|
||||
"regex": "^[a-z0-9A-Z]{1,15}$",
|
||||
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-15 characters long."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dbEdition",
|
||||
"type": "Microsoft.Common.DropDown",
|
||||
"label": "Database Edition",
|
||||
"defaultValue": "Basic",
|
||||
"toolTip": "Edition of Database to use",
|
||||
"constraints": {
|
||||
"allowedValues": [
|
||||
{
|
||||
"label": "Basic",
|
||||
"value": "Basic"
|
||||
},
|
||||
{
|
||||
"label": "Standard",
|
||||
"value": "Standard"
|
||||
},
|
||||
{
|
||||
"label": "Premium",
|
||||
"value": "Premium"
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
},
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "storageConfig",
|
||||
"label": "Storage settings",
|
||||
"subLabel": {
|
||||
"preValidation": "Configure the infrastructure settings",
|
||||
"postValidation": "Done"
|
||||
},
|
||||
"bladeTitle": "Storage settings",
|
||||
"elements": [
|
||||
{
|
||||
"name": "storageAccountsType",
|
||||
"type": "Microsoft.Common.DropDown",
|
||||
"label": "Storage account type",
|
||||
"defaultValue": "Standard_LRS",
|
||||
"toolTip": "Storage account type",
|
||||
"constraints": {
|
||||
"allowedValues": [
|
||||
{
|
||||
"label": "Standard_LRS",
|
||||
"value": "Standard_LRS"
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
},
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"clusterName": "[steps('clusterConfig').clusterName]",
|
||||
"vmSku": "[steps('clusterConfig').vmSku]",
|
||||
"location": "[location()]",
|
||||
"nodeCount": "[steps('clusterConfig').nodeCount]",
|
||||
"artifactoryVersion": "[steps('clusterConfig').artifactoryVersion]",
|
||||
"masterKey": "[steps('clusterConfig').masterKey]",
|
||||
"artifactoryLicense1": "[steps('clusterConfig').artifactoryLicense1]",
|
||||
"artifactoryLicense2": "[steps('clusterConfig').artifactoryLicense2]",
|
||||
"artifactoryLicense3": "[steps('clusterConfig').artifactoryLicense3]",
|
||||
"artifactoryLicense4": "[steps('clusterConfig').artifactoryLicense4]",
|
||||
"artifactoryLicense5": "[steps('clusterConfig').artifactoryLicense5]",
|
||||
"certificate": "[steps('clusterConfig').certificate]",
|
||||
"certificateKey": "[steps('clusterConfig').certificateKey]",
|
||||
"certificateDomain": "[steps('clusterConfig').certificateDomain]",
|
||||
"artifactoryServerName": "[steps('clusterConfig').artifactoryServerName]",
|
||||
"extraJavaOptions": "[steps('clusterConfig').extraJavaOptions]",
|
||||
"adminUsername": "[steps('vmCredentials').adminUsername]",
|
||||
"adminPassword": "[steps('vmCredentials').adminPassword.password]",
|
||||
"DB_Admin_User": "[steps('databaseConfig').dbAdminUsername]",
|
||||
"DB_Admin_Password": "[steps('databaseConfig').dbAdminPassword]",
|
||||
"DB_Name": "[steps('databaseConfig').dbName]",
|
||||
"DB_Edition": "[steps('databaseConfig').dbEdition]",
|
||||
"storageAccountType": "[steps('storageConfig').storageAccountsType]"
|
||||
}
|
||||
}
|
||||
}
|
||||
924
AzureResourceManager/MP_submission_7/mainTemplate.json
Normal file
924
AzureResourceManager/MP_submission_7/mainTemplate.json
Normal file
@@ -0,0 +1,924 @@
|
||||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"vmSku": {
|
||||
"type": "string",
|
||||
"defaultValue": "Standard_D4s_v3",
|
||||
"metadata": {
|
||||
"description": "Size of VMs in the VM Scale Set."
|
||||
}
|
||||
},
|
||||
"clusterName": {
|
||||
"type": "string",
|
||||
"maxLength": 61,
|
||||
"metadata": {
|
||||
"description": "String used as a base for naming resources. Must be 3-61 characters in length and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended."
|
||||
}
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"defaultValue": "[resourceGroup().location]",
|
||||
"metadata": {
|
||||
"description": "Location for the resources."
|
||||
}
|
||||
},
|
||||
"nodeCount": {
|
||||
"type": "int",
|
||||
"defaultValue": 2,
|
||||
"minValue": 1,
|
||||
"maxValue": 100,
|
||||
"metadata": {
|
||||
"description": "Number of VM instances (100 or less) for member artifactory nodes. Minimum 1 node."
|
||||
}
|
||||
},
|
||||
"artifactoryVersion": {
|
||||
"type": "string",
|
||||
"defaultValue": "7.4.3",
|
||||
"allowedValues": [
|
||||
"6.6.0",
|
||||
"6.6.1",
|
||||
"6.7.0",
|
||||
"6.8.0",
|
||||
"6.11.3",
|
||||
"6.15.0",
|
||||
"0.16.0",
|
||||
"0.17.0",
|
||||
"6.18.0",
|
||||
"7.2.1",
|
||||
"0.3.2",
|
||||
"7.4.3"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "Artifactory-vm image version to deploy."
|
||||
}
|
||||
},
|
||||
"masterKey": {
|
||||
"type": "securestring",
|
||||
"maxLength": 64,
|
||||
"metadata": {
|
||||
"description": "Master key for Artifactory cluster. Generate master.key using command '$openssl rand -hex 16'"
|
||||
}
|
||||
},
|
||||
"adminUsername": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Admin username on all VMs. Follow conventions for azure VM admin user name."
|
||||
}
|
||||
},
|
||||
"adminPassword": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "Admin password on all VMs. Follow conventions for azure VM admin password rules."
|
||||
}
|
||||
},
|
||||
"artifactoryLicense1": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Artifactory Enterprise License. Providing one license is mandatory"
|
||||
}
|
||||
},
|
||||
"artifactoryLicense2": {
|
||||
"type": "string",
|
||||
"defaultValue": "",
|
||||
"metadata": {
|
||||
"description": "Artifactory Enterprise License"
|
||||
}
|
||||
},
|
||||
"artifactoryLicense3": {
|
||||
"type": "string",
|
||||
"defaultValue": "",
|
||||
"metadata": {
|
||||
"description": "Artifactory Enterprise License"
|
||||
}
|
||||
},
|
||||
"artifactoryLicense4": {
|
||||
"type": "string",
|
||||
"defaultValue": "",
|
||||
"metadata": {
|
||||
"description": "Artifactory Enterprise License"
|
||||
}
|
||||
},
|
||||
"artifactoryLicense5": {
|
||||
"type": "string",
|
||||
"defaultValue": "",
|
||||
"metadata": {
|
||||
"description": "Artifactory Enterprise License"
|
||||
}
|
||||
},
|
||||
"certificate": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "To use Artifactory as docker registry you need to provide wild card valid Certificate. Provide your SSL Certificate."
|
||||
}
|
||||
},
|
||||
"certificateKey": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "Provide your SSL Certificate key"
|
||||
}
|
||||
},
|
||||
"certificateDomain": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"defaultValue": "artifactory",
|
||||
"metadata": {
|
||||
"description": "Provide your Certificate Domain Name. For e.g jfrog.team for certificate with *.jfrog.team"
|
||||
}
|
||||
},
|
||||
"artifactoryServerName": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"defaultValue": "artifactory",
|
||||
"metadata": {
|
||||
"description": "Provide artifactory server name to be used in Nginx. e.g artifactory for artifactory.jfrog.team"
|
||||
}
|
||||
},
|
||||
"extraJavaOptions": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"defaultValue": "-server -Xms2g -Xmx8g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError=\\\"kill -9 %p\\\"",
|
||||
"metadata": {
|
||||
"description": "Setting Java Memory Parameters for Artifactory. Learn about system requirements for Artifactory https://www.jfrog.com/confluence/display/RTF/System+Requirements#SystemRequirements-RecommendedHardware."
|
||||
}
|
||||
},
|
||||
"DB_Admin_User": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"metadata": {
|
||||
"description": "Database Admin user name"
|
||||
}
|
||||
},
|
||||
"DB_Admin_Password": {
|
||||
"type": "securestring",
|
||||
"minLength": 1,
|
||||
"metadata": {
|
||||
"description": "Database Admin password"
|
||||
}
|
||||
},
|
||||
"DB_Name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"metadata": {
|
||||
"description": "Database name"
|
||||
}
|
||||
},
|
||||
"DB_Edition": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"defaultValue": "Basic",
|
||||
"allowedValues": [
|
||||
"Basic",
|
||||
"Standard",
|
||||
"Premium"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "Database Edition"
|
||||
}
|
||||
},
|
||||
"storageAccountType": {
|
||||
"type": "string",
|
||||
"defaultValue": "Standard_LRS",
|
||||
"allowedValues": [
|
||||
"Standard_LRS",
|
||||
"Standard_GRS",
|
||||
"Standard_ZRS"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "Storage Account type"
|
||||
}
|
||||
},
|
||||
"_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": "[deployment().properties.templateLink.uri]"
|
||||
},
|
||||
"_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": ""
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"namingInfix": "[toLower(substring(concat(parameters('clusterName'), uniqueString(resourceGroup().id)), 0, 9))]",
|
||||
"addressPrefix": "10.0.0.0/16",
|
||||
"subnetPrimaryPrefix": "10.0.1.0/24",
|
||||
"subnetMemberPrefix": "10.0.2.0/24",
|
||||
"virtualNetworkName": "[concat(variables('namingInfix'), 'vnet')]",
|
||||
"subnetPrimaryName": "[concat(variables('namingInfix'), 'primarySubnet')]",
|
||||
"subnetMemberName": "[concat(variables('namingInfix'), 'memberSubnet')]",
|
||||
"scaleSetPrimaryName": "[concat(variables('namingInfix'), 'primaryScaleset')]",
|
||||
"scaleSetMemberName": "[concat(variables('namingInfix'), 'memberScaleset')]",
|
||||
"lbName": "[concat(variables('namingInfix'), 'lb')]",
|
||||
"bepoolPrimaryName": "[concat(variables('lbName'), 'primaryBepool')]",
|
||||
"bepoolMemberName": "[concat(variables('lbName'), 'memberBepool')]",
|
||||
"fepoolPrimaryName": "[concat(variables('lbName'), 'primaryFepool')]",
|
||||
"fepoolMemberName": "[concat(variables('lbName'), 'memberFepool')]",
|
||||
"bepoolPrimaryID": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('lbName'), variables('bepoolPrimaryName'))]",
|
||||
"bepoolMemberID": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('lbName'), variables('bepoolMemberName'))]",
|
||||
"feIpConfigPrimaryName": "[concat(variables('fepoolPrimaryName'), 'primaryIpConfig')]",
|
||||
"feIpConfigMemberName": "[concat(variables('fepoolMemberName'), 'memberIpConfig')]",
|
||||
"feIpConfigPrimaryId": "[resourceId('Microsoft.Network/loadBalancers/frontendIpConfigurations', variables('lbName'), variables('feIpConfigPrimaryName'))]",
|
||||
"feIpConfigMemberId": "[resourceId('Microsoft.Network/loadBalancers/frontendIpConfigurations', variables('lbName'), variables('feIpConfigMemberName'))]",
|
||||
"pipPrimaryName": "[concat(variables('namingInfix'), 'primaryPip')]",
|
||||
"pipMemberName": "[concat(variables('namingInfix'), 'memberPip')]",
|
||||
"nicPrimaryName": "[concat(variables('namingInfix'), 'primaryNic')]",
|
||||
"nicMemberName": "[concat(variables('namingInfix'), 'memberNic')]",
|
||||
"natPoolPrimaryName": "[concat(variables('lbName'), 'primaryNatpool')]",
|
||||
"natPoolMemberName": "[concat(variables('lbName'), 'memberNatpool')]",
|
||||
"ipConfigName": "[concat(variables('namingInfix'), 'ipconfig')]",
|
||||
"httpProbePrimaryName": "primaryHttpProbe",
|
||||
"httpsProbePrimaryName": "primaryHttpsProbe",
|
||||
"httpProbeMemberName": "memberHttpProbe",
|
||||
"httpsProbeMemberName": "memberHttpsProbe",
|
||||
"storageAccountName": "[concat(variables('namingInfix'), 'storage')]",
|
||||
"vmStorageAccountContainerName": "filestore",
|
||||
"azureSqlServerName": "[concat(variables('namingInfix'), 'sqlsrv')]",
|
||||
"DB_Name": "[parameters('DB_Name')]",
|
||||
"DB_Admin_User": "[parameters('DB_Admin_User')]",
|
||||
"DB_Admin_Password": "[parameters('DB_Admin_Password')]",
|
||||
"DB_Edition": "[parameters('DB_Edition')]",
|
||||
"DB_Location": "[parameters('location')]",
|
||||
"masterKey": "[parameters('masterKey')]",
|
||||
"certificate": "[parameters('certificate')]",
|
||||
"certificateKey": "[parameters('certificateKey')]",
|
||||
"certificateDomain": "[parameters('certificateDomain')]",
|
||||
"artifactoryServerName": "[parameters('artifactoryServerName')]",
|
||||
"extraJavaOptions": "[parameters('extraJavaOptions')]",
|
||||
"artifactoryLicense1": "[parameters('artifactoryLicense1')]",
|
||||
"artifactoryLicense2": "[parameters('artifactoryLicense2')]",
|
||||
"artifactoryLicense3": "[parameters('artifactoryLicense3')]",
|
||||
"artifactoryLicense4": "[parameters('artifactoryLicense4')]",
|
||||
"artifactoryLicense5": "[parameters('artifactoryLicense5')]",
|
||||
"osType": {
|
||||
"publisher": "jfrog",
|
||||
"offer": "artifactory-vm",
|
||||
"sku": "artifactory-vm",
|
||||
"version": "[parameters('artifactoryVersion')]"
|
||||
},
|
||||
"imageReference": "[variables('osType')]",
|
||||
"dbTemplate": "azureDBDeploy.json",
|
||||
"dbTemplateLocation": "[uri(parameters('_artifactsLocation'), concat('nested/', variables('dbTemplate'), parameters('_artifactsLocationSasToken')))]",
|
||||
"nsgName": "[concat(variables('namingInfix'), 'nsg')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"apiVersion": "2019-05-01",
|
||||
"name": "pid-04c1c376-5d4b-4771-9a7f-054f5910dcef",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"template": {
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"resources": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Network/networkSecurityGroups",
|
||||
"location": "[parameters('location')]",
|
||||
"name": "[variables('nsgName')]",
|
||||
"apiVersion": "2018-07-01",
|
||||
"properties": {
|
||||
"securityRules": [
|
||||
{
|
||||
"name": "ssh-rule",
|
||||
"properties": {
|
||||
"description": "Allow SSH",
|
||||
"protocol": "Tcp",
|
||||
"sourcePortRange": "*",
|
||||
"destinationPortRange": "22",
|
||||
"sourceAddressPrefix": "Internet",
|
||||
"destinationAddressPrefix": "*",
|
||||
"access": "Allow",
|
||||
"priority": 100,
|
||||
"direction": "Inbound"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "http-artifactory-rule",
|
||||
"properties": {
|
||||
"description": "Allow HTTP",
|
||||
"protocol": "Tcp",
|
||||
"sourcePortRange": "*",
|
||||
"destinationPortRange": "8081",
|
||||
"sourceAddressPrefix": "Internet",
|
||||
"destinationAddressPrefix": "*",
|
||||
"access": "Allow",
|
||||
"priority": 101,
|
||||
"direction": "Inbound"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "http-nginx-rule",
|
||||
"properties": {
|
||||
"description": "Allow HTTP",
|
||||
"protocol": "Tcp",
|
||||
"sourcePortRange": "*",
|
||||
"destinationPortRange": "80",
|
||||
"sourceAddressPrefix": "Internet",
|
||||
"destinationAddressPrefix": "*",
|
||||
"access": "Allow",
|
||||
"priority": 102,
|
||||
"direction": "Inbound"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "https-nginx-rule",
|
||||
"properties": {
|
||||
"description": "Allow HTTP",
|
||||
"protocol": "Tcp",
|
||||
"sourcePortRange": "*",
|
||||
"destinationPortRange": "443",
|
||||
"sourceAddressPrefix": "Internet",
|
||||
"destinationAddressPrefix": "*",
|
||||
"access": "Allow",
|
||||
"priority": 103,
|
||||
"direction": "Inbound"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "membership-rule",
|
||||
"properties": {
|
||||
"description": "Allow HTTP",
|
||||
"protocol": "Tcp",
|
||||
"sourcePortRange": "*",
|
||||
"destinationPortRange": "10001",
|
||||
"sourceAddressPrefix": "Internet",
|
||||
"destinationAddressPrefix": "*",
|
||||
"access": "Allow",
|
||||
"priority": 105,
|
||||
"direction": "Inbound"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Network/virtualNetworks",
|
||||
"name": "[variables('virtualNetworkName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"apiVersion": "2018-07-01",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"addressSpace": {
|
||||
"addressPrefixes": [
|
||||
"[variables('addressPrefix')]"
|
||||
]
|
||||
},
|
||||
"subnets": [
|
||||
{
|
||||
"name": "[variables('subnetPrimaryName')]",
|
||||
"properties": {
|
||||
"addressPrefix": "[variables('subnetPrimaryPrefix')]",
|
||||
"networkSecurityGroup": {
|
||||
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('subnetMemberName')]",
|
||||
"properties": {
|
||||
"addressPrefix": "[variables('subnetMemberPrefix')]",
|
||||
"networkSecurityGroup": {
|
||||
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2018-07-01",
|
||||
"type": "Microsoft.Network/networkInterfaces",
|
||||
"name": "[variables('nicPrimaryName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
|
||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
|
||||
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"name": "ipconfig1",
|
||||
"properties": {
|
||||
"privateIPAllocationMethod": "Dynamic",
|
||||
"subnet": {
|
||||
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetPrimaryName'))]"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"networkSecurityGroup": {
|
||||
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2018-07-01",
|
||||
"type": "Microsoft.Network/networkInterfaces",
|
||||
"name": "[variables('nicMemberName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]",
|
||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
|
||||
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"name": "ipconfig1",
|
||||
"properties": {
|
||||
"privateIPAllocationMethod": "Dynamic",
|
||||
"subnet": {
|
||||
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetMemberName'))]"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"networkSecurityGroup": {
|
||||
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Network/publicIPAddresses",
|
||||
"name": "[variables('pipPrimaryName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"sku": {
|
||||
"name": "Standard"
|
||||
},
|
||||
"apiVersion": "2018-07-01",
|
||||
"properties": {
|
||||
"publicIPAllocationMethod": "Static",
|
||||
"dnsSettings": {
|
||||
"domainNameLabel": "[variables('namingInfix')]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Network/publicIPAddresses",
|
||||
"name": "[variables('pipMemberName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"sku": {
|
||||
"name": "Standard"
|
||||
},
|
||||
"apiVersion": "2018-07-01",
|
||||
"properties": {
|
||||
"publicIPAllocationMethod": "Static",
|
||||
"dnsSettings": {
|
||||
"domainNameLabel": "[concat(variables('namingInfix'),'2')]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Network/loadBalancers",
|
||||
"name": "[variables('lbName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"apiVersion": "2018-07-01",
|
||||
"sku": {
|
||||
"name": "Standard"
|
||||
},
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
|
||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]"
|
||||
],
|
||||
"tags":{
|
||||
"displayName": "Load Balancer"
|
||||
},
|
||||
"properties": {
|
||||
"frontendIPConfigurations": [
|
||||
{
|
||||
"name": "[variables('feIpConfigPrimaryName')]",
|
||||
"properties": {
|
||||
"publicIPAddress": {
|
||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('pipPrimaryName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('feIpConfigMemberName')]",
|
||||
"properties": {
|
||||
"publicIPAddress": {
|
||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('pipMemberName'))]"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"backendAddressPools": [
|
||||
{
|
||||
"name": "[variables('bepoolPrimaryName')]"
|
||||
},
|
||||
{
|
||||
"name": "[variables('bepoolMemberName')]"
|
||||
}
|
||||
],
|
||||
"inboundNatPools": [
|
||||
{
|
||||
"name": "[variables('natPoolPrimaryName')]",
|
||||
"properties": {
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('feIpConfigPrimaryId')]"
|
||||
},
|
||||
"protocol": "tcp",
|
||||
"frontendPortRangeStart": 10022,
|
||||
"frontendPortRangeEnd": 11022,
|
||||
"backendPort": 22
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('natPoolMemberName')]",
|
||||
"properties": {
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('feIpConfigMemberId')]"
|
||||
},
|
||||
"protocol": "tcp",
|
||||
"frontendPortRangeStart": 20022,
|
||||
"frontendPortRangeEnd": 21022,
|
||||
"backendPort": 22
|
||||
}
|
||||
}
|
||||
],
|
||||
"loadBalancingRules": [
|
||||
{
|
||||
"name": "HTTPRulePrimary",
|
||||
"properties": {
|
||||
"loadDistribution": "Default",
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('feIpConfigPrimaryId')]"
|
||||
},
|
||||
"backendAddressPool": {
|
||||
"id": "[variables('bepoolPrimaryID')]"
|
||||
},
|
||||
"protocol": "Tcp",
|
||||
"frontendPort": 80,
|
||||
"backendPort": 80,
|
||||
"enableFloatingIP": false,
|
||||
"idleTimeoutInMinutes": 5,
|
||||
"probe": {
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('lbName'), variables('httpProbePrimaryName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "HTTPSRulePrimary",
|
||||
"properties": {
|
||||
"loadDistribution": "Default",
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('feIpConfigPrimaryId')]"
|
||||
},
|
||||
"backendAddressPool": {
|
||||
"id": "[variables('bepoolPrimaryID')]"
|
||||
},
|
||||
"protocol": "Tcp",
|
||||
"frontendPort": 443,
|
||||
"backendPort": 443,
|
||||
"enableFloatingIP": false,
|
||||
"idleTimeoutInMinutes": 5,
|
||||
"probe": {
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('lbName'), variables('httpsProbePrimaryName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "HTTPRuleMember",
|
||||
"properties": {
|
||||
"loadDistribution": "Default",
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('feIpConfigMemberId')]"
|
||||
},
|
||||
"backendAddressPool": {
|
||||
"id": "[variables('bepoolMemberID')]"
|
||||
},
|
||||
"protocol": "Tcp",
|
||||
"frontendPort": 80,
|
||||
"backendPort": 80,
|
||||
"enableFloatingIP": false,
|
||||
"idleTimeoutInMinutes": 5,
|
||||
"probe": {
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('lbName'), variables('httpProbeMemberName'))]"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "HTTPSRuleMember",
|
||||
"properties": {
|
||||
"loadDistribution": "Default",
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('feIpConfigMemberId')]"
|
||||
},
|
||||
"backendAddressPool": {
|
||||
"id": "[variables('bepoolMemberID')]"
|
||||
},
|
||||
"protocol": "Tcp",
|
||||
"frontendPort": 443,
|
||||
"backendPort": 443,
|
||||
"enableFloatingIP": false,
|
||||
"idleTimeoutInMinutes": 5,
|
||||
"probe": {
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('lbName'), variables('httpsProbeMemberName'))]"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"probes": [
|
||||
{
|
||||
"name": "[variables('httpProbePrimaryName')]",
|
||||
"properties": {
|
||||
"protocol": "Http",
|
||||
"requestPath": "/artifactory/api/system/ping",
|
||||
"port": 80,
|
||||
"intervalInSeconds": 60,
|
||||
"numberOfProbes": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('httpsProbePrimaryName')]",
|
||||
"properties": {
|
||||
"protocol": "Tcp",
|
||||
"port": 443,
|
||||
"intervalInSeconds": 60,
|
||||
"numberOfProbes": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('httpProbeMemberName')]",
|
||||
"properties": {
|
||||
"protocol": "Http",
|
||||
"requestPath": "/artifactory/api/system/ping",
|
||||
"port": 80,
|
||||
"intervalInSeconds": 60,
|
||||
"numberOfProbes": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('httpsProbeMemberName')]",
|
||||
"properties": {
|
||||
"protocol": "Tcp",
|
||||
"port": 443,
|
||||
"intervalInSeconds": 60,
|
||||
"numberOfProbes": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2018-07-01",
|
||||
"type": "Microsoft.Storage/storageAccounts",
|
||||
"name": "[variables('storageAccountName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"sku": {
|
||||
"name": "[parameters('storageAccountType')]"
|
||||
},
|
||||
"tags":{
|
||||
"displayName": "Artifactory Storage Account"
|
||||
},
|
||||
"kind": "Storage",
|
||||
"properties": {}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"name": "deploySQLDB",
|
||||
"apiVersion": "2018-07-01",
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('dbTemplateLocation')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"db_user": {
|
||||
"value": "[parameters('DB_Admin_User')]"
|
||||
},
|
||||
"db_password": {
|
||||
"value": "[parameters('DB_Admin_Password')]"
|
||||
},
|
||||
"db_server": {
|
||||
"value": "[variables('azureSqlServerName')]"
|
||||
},
|
||||
"db_name": {
|
||||
"value": "[parameters('DB_Name')]"
|
||||
},
|
||||
"db_edition": {
|
||||
"value": "[variables('DB_Edition')]"
|
||||
},
|
||||
"db_location": {
|
||||
"value": "[variables('DB_Location')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Compute/virtualMachineScaleSets",
|
||||
"name": "[variables('scaleSetPrimaryName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"apiVersion": "2018-10-01",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]",
|
||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
|
||||
"[concat('Microsoft.Resources/deployments/', 'deploySQLDB')]",
|
||||
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
|
||||
],
|
||||
"plan": {
|
||||
"name": "artifactory-vm",
|
||||
"publisher": "jfrog",
|
||||
"product": "artifactory-vm"
|
||||
},
|
||||
"sku": {
|
||||
"name": "[parameters('vmSku')]",
|
||||
"tier": "Standard",
|
||||
"capacity": "1"
|
||||
},
|
||||
"properties": {
|
||||
"singlePlacementGroup": true,
|
||||
"overprovision": "false",
|
||||
"upgradePolicy": {
|
||||
"mode": "Manual"
|
||||
},
|
||||
"virtualMachineProfile": {
|
||||
"storageProfile": {
|
||||
"osDisk": {
|
||||
"caching": "ReadWrite",
|
||||
"diskSizeGB": "250",
|
||||
"createOption": "FromImage"
|
||||
},
|
||||
"imageReference": "[variables('imageReference')]"
|
||||
},
|
||||
"osProfile": {
|
||||
"computerNamePrefix": "[variables('namingInfix')]",
|
||||
"adminUsername": "[parameters('adminUsername')]",
|
||||
"adminPassword": "[parameters('adminPassword')]",
|
||||
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nARTIFACTORY_VERSION=', parameters('artifactoryVersion'),'\nCERTIFICATE_KEY=',variables('certificateKey'),'\nCERTIFICATE=', variables('certificate'),'\nCERTIFICATE_DOMAIN=',variables('certificateDomain'),'\nARTIFACTORY_SERVER_NAME=',variables('artifactoryServerName'),'\nEXTRA_JAVA_OPTS=',variables('extraJavaOptions'),'\nJDBC_STR=',reference('Microsoft.Resources/deployments/deploySQLDB').outputs.jdbcConnString.value,'\nDB_NAME=',variables('DB_Name'),'\nDB_ADMIN_USER=',variables('DB_Admin_User'),'\nDB_ADMIN_PASSWD=',variables('DB_Admin_Password'),'\nSTO_ACT_NAME=',variables('storageAccountName'),'\nSTO_ACT_ENDPOINT=',reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob,'\nSTO_CTR_NAME=',variables('vmStorageAccountContainerName'),'\nSTO_ACT_KEY=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-07-01').keys[0].value,'\nMASTER_KEY=',variables('masterKey'),'\nIS_PRIMARY=','true','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaceConfigurations": [
|
||||
{
|
||||
"name": "[variables('nicPrimaryName')]",
|
||||
"properties": {
|
||||
"primary": true,
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"name": "[concat(variables('ipConfigName'),'1')]",
|
||||
"properties": {
|
||||
"subnet": {
|
||||
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetPrimaryName'))]"
|
||||
},
|
||||
"loadBalancerBackendAddressPools": [
|
||||
{
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('lbName'), variables('bePoolPrimaryName'))]"
|
||||
}
|
||||
],
|
||||
"loadBalancerInboundNatPools": [
|
||||
{
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/inboundNatPools', variables('lbName'), variables('natPoolPrimaryName'))]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"extensionProfile": {
|
||||
"extensions": [
|
||||
{
|
||||
"name": "extension1",
|
||||
"properties": {
|
||||
"publisher": "Microsoft.Azure.Extensions",
|
||||
"type": "CustomScript",
|
||||
"typeHandlerVersion": "2.0",
|
||||
"autoUpgradeMinorVersion": false,
|
||||
"settings": {
|
||||
"fileUris": [
|
||||
"[uri(parameters('_artifactsLocation'), concat('scripts/install_artifactory.sh', parameters('_artifactsLocationSasToken')))]",
|
||||
"[uri(parameters('_artifactsLocation'), concat('scripts/install_artifactory7.sh', parameters('_artifactsLocationSasToken')))]",
|
||||
"[uri(parameters('_artifactsLocation'), concat('scripts/version_selector.sh', parameters('_artifactsLocationSasToken')))]"
|
||||
]
|
||||
},
|
||||
"protectedSettings": {
|
||||
"commandToExecute": "bash version_selector.sh && ls -al && pwd >> /var/lib/cloud/instance/user-data.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Compute/virtualMachineScaleSets",
|
||||
"name": "[variables('scaleSetMemberName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"apiVersion": "2018-10-01",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]",
|
||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
|
||||
"[concat('Microsoft.Compute/virtualMachineScaleSets/', variables('scaleSetPrimaryName'))]",
|
||||
"[concat('Microsoft.Resources/deployments/', 'deploySQLDB')]",
|
||||
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
|
||||
],
|
||||
"plan": {
|
||||
"name": "artifactory-vm",
|
||||
"publisher": "jfrog",
|
||||
"product": "artifactory-vm"
|
||||
},
|
||||
"sku": {
|
||||
"name": "[parameters('vmSku')]",
|
||||
"tier": "Standard",
|
||||
"capacity": "[parameters('nodeCount')]"
|
||||
},
|
||||
"properties": {
|
||||
"singlePlacementGroup": true,
|
||||
"overprovision": "false",
|
||||
"upgradePolicy": {
|
||||
"mode": "Manual"
|
||||
},
|
||||
"virtualMachineProfile": {
|
||||
"storageProfile": {
|
||||
"osDisk": {
|
||||
"caching": "ReadWrite",
|
||||
"diskSizeGB": "250",
|
||||
"createOption": "FromImage"
|
||||
},
|
||||
"imageReference": "[variables('imageReference')]"
|
||||
},
|
||||
"osProfile": {
|
||||
"computerNamePrefix": "[variables('namingInfix')]",
|
||||
"adminUsername": "[parameters('adminUsername')]",
|
||||
"adminPassword": "[parameters('adminPassword')]",
|
||||
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nARTIFACTORY_VERSION=', parameters('artifactoryVersion'),'\nCERTIFICATE_KEY=',parameters('certificateKey'),'\nCERTIFICATE=', parameters('certificate'),'\nCERTIFICATE_DOMAIN=',parameters('certificateDomain'),'\nARTIFACTORY_SERVER_NAME=',parameters('artifactoryServerName'),'\nEXTRA_JAVA_OPTS=',parameters('extraJavaOptions'),'\nJDBC_STR=',reference('Microsoft.Resources/deployments/deploySQLDB').outputs.jdbcConnString.value,'\nDB_NAME=',variables('DB_Name'),'\nDB_ADMIN_USER=',variables('DB_Admin_User'),'\nDB_ADMIN_PASSWD=',variables('DB_Admin_Password'),'\nSTO_ACT_NAME=',variables('storageAccountName'),'\nSTO_ACT_ENDPOINT=',reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob,'\nSTO_CTR_NAME=',variables('vmStorageAccountContainerName'),'\nSTO_ACT_KEY=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-07-01').keys[0].value,'\nMASTER_KEY=',variables('masterKey'),'\nIS_PRIMARY=','false','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaceConfigurations": [
|
||||
{
|
||||
"name": "[variables('nicMemberName')]",
|
||||
"properties": {
|
||||
"primary": true,
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"name": "[concat(variables('ipConfigName'),'1')]",
|
||||
"properties": {
|
||||
"subnet": {
|
||||
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetMemberName'))]"
|
||||
},
|
||||
"loadBalancerBackendAddressPools": [
|
||||
{
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('lbName'), variables('bePoolMemberName'))]"
|
||||
}
|
||||
],
|
||||
"loadBalancerInboundNatPools": [
|
||||
{
|
||||
"id": "[resourceId('Microsoft.Network/loadBalancers/inboundNatPools', variables('lbName'), variables('natPoolMemberName'))]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"extensionProfile": {
|
||||
"extensions": [
|
||||
{
|
||||
"name": "extension1",
|
||||
"properties": {
|
||||
"publisher": "Microsoft.Azure.Extensions",
|
||||
"type": "CustomScript",
|
||||
"typeHandlerVersion": "2.0",
|
||||
"autoUpgradeMinorVersion": false,
|
||||
"settings": {
|
||||
"fileUris": [
|
||||
"[uri(parameters('_artifactsLocation'), concat('scripts/install_artifactory.sh', parameters('_artifactsLocationSasToken')))]",
|
||||
"[uri(parameters('_artifactsLocation'), concat('scripts/install_artifactory7.sh', parameters('_artifactsLocationSasToken')))]",
|
||||
"[uri(parameters('_artifactsLocation'), concat('scripts/version_selector.sh', parameters('_artifactsLocationSasToken')))]"
|
||||
]
|
||||
},
|
||||
"protectedSettings": {
|
||||
"commandToExecute": "bash version_selector.sh && ls -al && pwd >> /var/lib/cloud/instance/user-data.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"fqdn": {
|
||||
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',variables('pipMemberName')),'2018-07-01').dnsSettings.fqdn]",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"db_user": {
|
||||
"type": "string",
|
||||
"defaultValue": "artifactory",
|
||||
"minLength": 1
|
||||
},
|
||||
"db_password": {
|
||||
"type": "securestring"
|
||||
},
|
||||
"db_server": {
|
||||
"type": "string",
|
||||
"defaultValue": "artmssqlsrv",
|
||||
"minLength": 1
|
||||
},
|
||||
"db_name": {
|
||||
"type": "string",
|
||||
"defaultValue": "artdb",
|
||||
"minLength": 1
|
||||
},
|
||||
"db_location": {
|
||||
"type": "string",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"db_edition": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"Basic",
|
||||
"Standard",
|
||||
"Premium"
|
||||
]
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"rtdbCollation": "Latin1_General_100_CS_AS",
|
||||
"db_location": "[parameters('db_location')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"name": "[parameters('db_server')]",
|
||||
"type": "Microsoft.Sql/servers",
|
||||
"kind": "v12.0",
|
||||
"location": "[variables('db_location')]",
|
||||
"apiVersion": "2019-06-01-preview",
|
||||
"tags": {
|
||||
"displayName": "artifactoryDB"
|
||||
},
|
||||
"properties": {
|
||||
"administratorLogin": "[parameters('db_user')]",
|
||||
"administratorLoginPassword": "[parameters('db_password')]",
|
||||
"version": "12.0"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
|
||||
"type": "firewallrules",
|
||||
"location": "[variables('db_location')]",
|
||||
"apiVersion": "2019-06-01-preview",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Sql/servers/', parameters('db_server'))]"
|
||||
],
|
||||
"properties": {
|
||||
"startIpAddress": "0.0.0.0",
|
||||
"endIpAddress": "0.0.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[parameters('db_name')]",
|
||||
"type": "databases",
|
||||
"kind": "v12.0,user",
|
||||
"location": "[variables('db_location')]",
|
||||
"apiVersion": "2019-06-01-preview",
|
||||
"dependsOn": [
|
||||
"[parameters('db_server')]"
|
||||
],
|
||||
"tags": {
|
||||
"displayName": "artifactoryDB"
|
||||
},
|
||||
"properties": {
|
||||
"edition": "[parameters('db_edition')]",
|
||||
"maxSizeBytes": "1073741824",
|
||||
"collation": "[variables('rtdbCollation')]"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"jdbcConnString": {
|
||||
"type": "string",
|
||||
"value": "[concat('jdbc:sqlserver://', reference(concat('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
#!/bin/bash
|
||||
DB_URL=$(cat /var/lib/cloud/instance/user-data.txt | grep "^JDBC_STR" | sed "s/JDBC_STR=//")
|
||||
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_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//")
|
||||
STORAGE_ACCT=$(cat /var/lib/cloud/instance/user-data.txt | grep "^STO_ACT_NAME=" | sed "s/STO_ACT_NAME=//")
|
||||
STORAGE_CONTAINER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^STO_CTR_NAME=" | sed "s/STO_CTR_NAME=//")
|
||||
STORAGE_ACCT_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^STO_ACT_KEY=" | sed "s/STO_ACT_KEY=//")
|
||||
ARTIFACTORY_VERSION=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_VERSION=" | sed "s/ARTIFACTORY_VERSION=//")
|
||||
MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//")
|
||||
IS_PRIMARY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^IS_PRIMARY=" | sed "s/IS_PRIMARY=//")
|
||||
ARTIFACTORY_LICENSE_1=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE1=" | sed "s/LICENSE1=//")
|
||||
ARTIFACTORY_LICENSE_2=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE2=" | sed "s/LICENSE2=//")
|
||||
ARTIFACTORY_LICENSE_3=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE3=" | sed "s/LICENSE3=//")
|
||||
ARTIFACTORY_LICENSE_4=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE4=" | sed "s/LICENSE4=//")
|
||||
ARTIFACTORY_LICENSE_5=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE5=" | sed "s/LICENSE5=//")
|
||||
|
||||
UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//")
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
#Generate Self-Signed Cert
|
||||
mkdir -p /etc/pki/tls/private/ /etc/pki/tls/certs/
|
||||
openssl req -nodes -x509 -newkey rsa:4096 -keyout /etc/pki/tls/private/example.key -out /etc/pki/tls/certs/example.pem -days 356 -subj "/C=US/ST=California/L=SantaClara/O=IT/CN=*.localhost"
|
||||
|
||||
CERTIFICATE_DOMAIN=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_DOMAIN=" | sed "s/CERTIFICATE_DOMAIN=//")
|
||||
[ -z "$CERTIFICATE_DOMAIN" ] && CERTIFICATE_DOMAIN=artifactory
|
||||
|
||||
ARTIFACTORY_SERVER_NAME=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_SERVER_NAME=" | sed "s/ARTIFACTORY_SERVER_NAME=//")
|
||||
[ -z "$ARTIFACTORY_SERVER_NAME" ] && ARTIFACTORY_SERVER_NAME=artifactory
|
||||
|
||||
#Configuring nginx
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
|
||||
cat <<EOF >/etc/nginx/nginx.conf
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log info;
|
||||
#pid logs/nginx.pid;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
variables_hash_max_size 1024;
|
||||
variables_hash_bucket_size 64;
|
||||
server_names_hash_max_size 4096;
|
||||
server_names_hash_bucket_size 128;
|
||||
types_hash_max_size 2048;
|
||||
types_hash_bucket_size 64;
|
||||
proxy_read_timeout 2400s;
|
||||
client_header_timeout 2400s;
|
||||
client_body_timeout 2400s;
|
||||
proxy_connect_timeout 75s;
|
||||
proxy_send_timeout 2400s;
|
||||
proxy_buffer_size 32k;
|
||||
proxy_buffers 40 32k;
|
||||
proxy_busy_buffers_size 64k;
|
||||
proxy_temp_file_write_size 250m;
|
||||
proxy_http_version 1.1;
|
||||
client_body_buffer_size 128k;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
#keepalive_timeout 0;
|
||||
keepalive_timeout 65;
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/nginx/conf.d/artifactory.conf
|
||||
ssl_certificate /etc/pki/tls/certs/cert.pem;
|
||||
ssl_certificate_key /etc/pki/tls/private/cert.key;
|
||||
ssl_session_cache shared:SSL:1m;
|
||||
ssl_prefer_server_ciphers on;
|
||||
## server configuration
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen 80 ;
|
||||
server_name ~(?<repo>.+)\\.${CERTIFICATE_DOMAIN} artifactory ${ARTIFACTORY_SERVER_NAME}.${CERTIFICATE_DOMAIN};
|
||||
if (\$http_x_forwarded_proto = '') {
|
||||
set \$http_x_forwarded_proto \$scheme;
|
||||
}
|
||||
## Application specific logs
|
||||
## access_log /var/log/nginx/artifactory-access.log timing;
|
||||
## error_log /var/log/nginx/artifactory-error.log;
|
||||
rewrite ^/$ /artifactory/webapp/ redirect;
|
||||
rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect;
|
||||
rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/\$repo/\$1/\$2;
|
||||
chunked_transfer_encoding on;
|
||||
client_max_body_size 0;
|
||||
location /artifactory/ {
|
||||
proxy_read_timeout 2400;
|
||||
proxy_pass_header Server;
|
||||
proxy_cookie_path ~*^/.* /;
|
||||
proxy_pass http://127.0.0.1:8081/artifactory/;
|
||||
proxy_set_header X-Artifactory-Override-Base-Url
|
||||
\$http_x_forwarded_proto://\$host:\$server_port/artifactory;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Forwarded-Proto \$http_x_forwarded_proto;
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/var/opt/jfrog/artifactory/etc/artifactory.cluster.license
|
||||
${ARTIFACTORY_LICENSE_1}
|
||||
|
||||
${ARTIFACTORY_LICENSE_2}
|
||||
|
||||
${ARTIFACTORY_LICENSE_3}
|
||||
|
||||
${ARTIFACTORY_LICENSE_4}
|
||||
|
||||
${ARTIFACTORY_LICENSE_5}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/var/opt/jfrog/artifactory/etc/ha-node.properties
|
||||
node.id=art1
|
||||
artifactory.ha.data.dir=/var/opt/jfrog/artifactory/data
|
||||
context.url=http://127.0.0.1:8081/artifactory
|
||||
membership.port=10001
|
||||
hazelcast.interface=172.25.0.3
|
||||
primary=${IS_PRIMARY}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/var/opt/jfrog/artifactory/etc/db.properties
|
||||
type=mssql
|
||||
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url=${DB_URL};databaseName=${DB_NAME};sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository
|
||||
username=${DB_USER}
|
||||
password=${DB_PASSWORD}
|
||||
EOF
|
||||
|
||||
mkdir -p /var/opt/jfrog/artifactory/etc/security
|
||||
|
||||
cat <<EOF >/var/opt/jfrog/artifactory/etc/security/master.key
|
||||
${MASTER_KEY}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/var/opt/jfrog/artifactory/etc/binarystore.xml
|
||||
<config version="2">
|
||||
<chain>
|
||||
<provider id="cache-fs-eventual-azure-blob-storage" type="cache-fs">
|
||||
<provider id="sharding-cluster-eventual-azure-blob-storage" type="sharding-cluster">
|
||||
<sub-provider id="eventual-cluster-azure-blob-storage" type="eventual-cluster">
|
||||
<provider id="retry-azure-blob-storage" type="retry">
|
||||
<provider id="azure-blob-storage" type="azure-blob-storage"/>
|
||||
</provider>
|
||||
</sub-provider>
|
||||
<dynamic-provider id="remote-azure-blob-storage" type="remote"/>
|
||||
</provider>
|
||||
</provider>
|
||||
</chain>
|
||||
|
||||
<!-- cluster eventual Azure Blob Storage Service default chain -->
|
||||
<provider id="sharding-cluster-eventual-azure-blob-storage" type="sharding-cluster">
|
||||
<readBehavior>crossNetworkStrategy</readBehavior>
|
||||
<writeBehavior>crossNetworkStrategy</writeBehavior>
|
||||
<redundancy>2</redundancy>
|
||||
<lenientLimit>1</lenientLimit>
|
||||
<property name="zones" value="local,remote"/>
|
||||
</provider>
|
||||
|
||||
<provider id="remote-azure-blob-storage" type="remote">
|
||||
<zone>remote</zone>
|
||||
</provider>
|
||||
|
||||
<provider id="eventual-cluster-azure-blob-storage" type="eventual-cluster">
|
||||
<zone>local</zone>
|
||||
</provider>
|
||||
|
||||
<!--cluster eventual template-->
|
||||
<provider id="azure-blob-storage" type="azure-blob-storage">
|
||||
<accountName>${STORAGE_ACCT}</accountName>
|
||||
<accountKey>${STORAGE_ACCT_KEY}</accountKey>
|
||||
<endpoint>https://${STORAGE_ACCT}.blob.core.windows.net/</endpoint>
|
||||
<containerName>${STORAGE_CONTAINER}</containerName>
|
||||
</provider>
|
||||
</config>
|
||||
EOF
|
||||
|
||||
|
||||
HOSTNAME=$(hostname -i)
|
||||
sed -i -e "s/art1/art-$(date +%s$RANDOM)/" /var/opt/jfrog/artifactory/etc/ha-node.properties
|
||||
sed -i -e "s/127.0.0.1/$HOSTNAME/" /var/opt/jfrog/artifactory/etc/ha-node.properties
|
||||
sed -i -e "s/172.25.0.3/$HOSTNAME/" /var/opt/jfrog/artifactory/etc/ha-node.properties
|
||||
|
||||
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
|
||||
rm /tmp/temp.pem
|
||||
|
||||
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_KEY=" | sed "s/CERTIFICATE_KEY=//" > /tmp/temp.key
|
||||
cat /tmp/temp.key | sed 's/KEY----- /&\n/' | sed 's/ -----END/\n-----END/' | awk '{if($0 ~ /----/) {print;} else { gsub(/ /,"\n");print;}}' > /etc/pki/tls/private/cert.key
|
||||
rm /tmp/temp.key
|
||||
|
||||
EXTRA_JAVA_OPTS=$(cat /var/lib/cloud/instance/user-data.txt | grep "^EXTRA_JAVA_OPTS=" | sed "s/EXTRA_JAVA_OPTS=//")
|
||||
[ -z "$EXTRA_JAVA_OPTS" ] && EXTRA_JAVA_OPTS='-server -Xms2g -Xmx6g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError="kill -9 %p"'
|
||||
echo "export JAVA_OPTIONS=\"${EXTRA_JAVA_OPTS}\"" >> /var/opt/jfrog/artifactory/etc/default
|
||||
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
|
||||
sleep $((RANDOM % 120))
|
||||
service artifactory start
|
||||
service nginx start
|
||||
nginx -s reload
|
||||
echo "INFO: Artifactory installation completed."
|
||||
@@ -0,0 +1,202 @@
|
||||
#!/bin/bash
|
||||
DB_URL=$(cat /var/lib/cloud/instance/user-data.txt | grep "^JDBC_STR" | sed "s/JDBC_STR=//")
|
||||
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_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//")
|
||||
STORAGE_ACCT=$(cat /var/lib/cloud/instance/user-data.txt | grep "^STO_ACT_NAME=" | sed "s/STO_ACT_NAME=//")
|
||||
STORAGE_CONTAINER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^STO_CTR_NAME=" | sed "s/STO_CTR_NAME=//")
|
||||
STORAGE_ACCT_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^STO_ACT_KEY=" | sed "s/STO_ACT_KEY=//")
|
||||
ARTIFACTORY_VERSION=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_VERSION=" | sed "s/ARTIFACTORY_VERSION=//")
|
||||
MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//")
|
||||
JOIN_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^JOIN_KEY=" | sed "s/JOIN_KEY=//")
|
||||
IS_PRIMARY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^IS_PRIMARY=" | sed "s/IS_PRIMARY=//")
|
||||
ARTIFACTORY_LICENSE_1=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE1=" | sed "s/LICENSE1=//")
|
||||
ARTIFACTORY_LICENSE_2=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE2=" | sed "s/LICENSE2=//")
|
||||
ARTIFACTORY_LICENSE_3=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE3=" | sed "s/LICENSE3=//")
|
||||
ARTIFACTORY_LICENSE_4=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE4=" | sed "s/LICENSE4=//")
|
||||
ARTIFACTORY_LICENSE_5=$(cat /var/lib/cloud/instance/user-data.txt | grep "^LICENSE5=" | sed "s/LICENSE5=//")
|
||||
#JOIN_KEY_GENERATED=$(openssl rand -hex 16)
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
#Generate Self-Signed Cert
|
||||
mkdir -p /etc/pki/tls/private/ /etc/pki/tls/certs/
|
||||
openssl req -nodes -x509 -newkey rsa:4096 -keyout /etc/pki/tls/private/example.key -out /etc/pki/tls/certs/example.pem -days 356 -subj "/C=US/ST=California/L=SantaClara/O=IT/CN=*.localhost"
|
||||
|
||||
CERTIFICATE_DOMAIN=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_DOMAIN=" | sed "s/CERTIFICATE_DOMAIN=//")
|
||||
[ -z "$CERTIFICATE_DOMAIN" ] && CERTIFICATE_DOMAIN=artifactory
|
||||
|
||||
ARTIFACTORY_SERVER_NAME=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_SERVER_NAME=" | sed "s/ARTIFACTORY_SERVER_NAME=//")
|
||||
[ -z "$ARTIFACTORY_SERVER_NAME" ] && ARTIFACTORY_SERVER_NAME=artifactory
|
||||
|
||||
#Configuring nginx
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
|
||||
cat <<EOF >/etc/nginx/nginx.conf
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log info;
|
||||
#pid logs/nginx.pid;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
variables_hash_max_size 1024;
|
||||
variables_hash_bucket_size 64;
|
||||
server_names_hash_max_size 4096;
|
||||
server_names_hash_bucket_size 128;
|
||||
types_hash_max_size 2048;
|
||||
types_hash_bucket_size 64;
|
||||
proxy_read_timeout 2400s;
|
||||
client_header_timeout 2400s;
|
||||
client_body_timeout 2400s;
|
||||
proxy_connect_timeout 75s;
|
||||
proxy_send_timeout 2400s;
|
||||
proxy_buffer_size 32k;
|
||||
proxy_buffers 40 32k;
|
||||
proxy_busy_buffers_size 64k;
|
||||
proxy_temp_file_write_size 250m;
|
||||
proxy_http_version 1.1;
|
||||
client_body_buffer_size 128k;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
#keepalive_timeout 0;
|
||||
keepalive_timeout 65;
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/nginx/conf.d/artifactory.conf
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_certificate /etc/pki/tls/certs/cert.pem;
|
||||
ssl_certificate_key /etc/pki/tls/private/cert.key;
|
||||
ssl_session_cache shared:SSL:1m;
|
||||
ssl_prefer_server_ciphers on;
|
||||
## server configuration
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen 80 ;
|
||||
server_name ~(?<repo>.+)\\.${CERTIFICATE_DOMAIN} artifactory ${ARTIFACTORY_SERVER_NAME}.${CERTIFICATE_DOMAIN};
|
||||
if (\$http_x_forwarded_proto = '') {
|
||||
set \$http_x_forwarded_proto \$scheme;
|
||||
}
|
||||
## Application specific logs
|
||||
## access_log /var/log/nginx/artifactory-access.log timing;
|
||||
## error_log /var/log/nginx/artifactory-error.log;
|
||||
rewrite ^/$ /ui/ redirect;
|
||||
rewrite ^/ui$ /ui/ redirect;
|
||||
chunked_transfer_encoding on;
|
||||
client_max_body_size 0;
|
||||
location / {
|
||||
proxy_read_timeout 2400;
|
||||
proxy_pass_header Server;
|
||||
proxy_cookie_path ~*^/.* /;
|
||||
proxy_pass http://127.0.0.1:8082;
|
||||
proxy_next_upstream error timeout non_idempotent;
|
||||
proxy_next_upstream_tries 1;
|
||||
proxy_set_header X-JFrog-Override-Base-Url \$http_x_forwarded_proto://\$host:\$server_port;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Forwarded-Proto \$http_x_forwarded_proto;
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
|
||||
location ~ ^/artifactory/ {
|
||||
proxy_pass http://127.0.0.1:8081;
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
mkdir -p /opt/jfrog/artifactory/var/etc/artifactory/
|
||||
cat <<EOF >/opt/jfrog/artifactory/var/etc/artifactory/artifactory.cluster.license
|
||||
${ARTIFACTORY_LICENSE_1}
|
||||
|
||||
${ARTIFACTORY_LICENSE_2}
|
||||
|
||||
${ARTIFACTORY_LICENSE_3}
|
||||
|
||||
${ARTIFACTORY_LICENSE_4}
|
||||
|
||||
${ARTIFACTORY_LICENSE_5}
|
||||
EOF
|
||||
|
||||
HOSTNAME=$(ip route get 8.8.8.8 | awk '{print $NF; exit}')
|
||||
|
||||
if [ "${IS_PRIMARY}" = "true" ]; then
|
||||
NODE_NAME=art-primary
|
||||
else
|
||||
NODE_NAME=art-$(date +%s$RANDOM)
|
||||
fi
|
||||
|
||||
# Java options
|
||||
EXTRA_JAVA_OPTS=$(cat /var/lib/cloud/instance/user-data.txt | grep "^EXTRA_JAVA_OPTS=" | sed "s/EXTRA_JAVA_OPTS=//")
|
||||
sed -i -e "s/#extraJavaOpts: \"-Xms512m -Xmx2g\"/extraJavaOpts: ${EXTRA_JAVA_OPTS}/" /var/opt/jfrog/artifactory/etc/system.yaml
|
||||
|
||||
# Node settings
|
||||
HOSTNAME=$(hostname -i)
|
||||
sed -i -e "s/#id: \"art1\"/id: \"${NODE_NAME}\"/" /var/opt/jfrog/artifactory/etc/system.yaml
|
||||
sed -i -e "s/#ip:/ip: ${HOSTNAME}/" /var/opt/jfrog/artifactory/etc/system.yaml
|
||||
sed -i -e "s/#primary: true/primary: ${IS_PRIMARY}/" /var/opt/jfrog/artifactory/etc/system.yaml
|
||||
sed -i -e "s/#haEnabled:/haEnabled:/" /var/opt/jfrog/artifactory/etc/system.yaml
|
||||
|
||||
# Set MS SQL configuration
|
||||
cat <<EOF >>/var/opt/jfrog/artifactory/etc/system.yaml
|
||||
## One of: mysql, oracle, mssql, postgresql, mariadb
|
||||
## Default: Embedded derby
|
||||
## Example for mysql
|
||||
type: mssql
|
||||
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: ${DB_URL};databaseName=${DB_NAME};sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository
|
||||
username: ${DB_USER}
|
||||
password: ${DB_PASSWORD}
|
||||
|
||||
EOF
|
||||
|
||||
# Create master.key on each node
|
||||
mkdir -p /opt/jfrog/artifactory/var/etc/security/
|
||||
|
||||
cat <<EOF >/opt/jfrog/artifactory/var/etc/security/master.key
|
||||
${MASTER_KEY}
|
||||
EOF
|
||||
|
||||
# Azure Blob Storage configuration
|
||||
# https://www.jfrog.com/confluence/display/JFROG/Configuring+the+Filestore#ConfiguringtheFilestore-AzureBlobStorageClusterBinaryProvider
|
||||
mkdir -p /var/opt/jfrog/artifactory/etc/artifactory/
|
||||
cat <<EOF >/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml
|
||||
<config version="2">
|
||||
<chain template="cluster-azure-blob-storage"/>
|
||||
<provider id="azure-blob-storage" type="azure-blob-storage">
|
||||
<accountName>${STORAGE_ACCT}</accountName>
|
||||
<accountKey>${STORAGE_ACCT_KEY}</accountKey>
|
||||
<endpoint>https://${STORAGE_ACCT}.blob.core.windows.net/</endpoint>
|
||||
<containerName>${STORAGE_CONTAINER}</containerName>
|
||||
</provider>
|
||||
</config>
|
||||
EOF
|
||||
|
||||
|
||||
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
|
||||
rm /tmp/temp.pem
|
||||
|
||||
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_KEY=" | sed "s/CERTIFICATE_KEY=//" > /tmp/temp.key
|
||||
cat /tmp/temp.key | sed 's/KEY----- /&\n/' | sed 's/ -----END/\n-----END/' | awk '{if($0 ~ /----/) {print;} else { gsub(/ /,"\n");print;}}' > /etc/pki/tls/private/cert.key
|
||||
rm /tmp/temp.key
|
||||
|
||||
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
|
||||
sleep $((RANDOM % 120))
|
||||
service artifactory start
|
||||
service nginx start
|
||||
nginx -s reload
|
||||
echo "INFO: Artifactory HA installation completed."
|
||||
echo ""
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
ARTIFACTORY_VERSION=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_VERSION=" | sed "s/ARTIFACTORY_VERSION=//")
|
||||
IFS=$'\t'
|
||||
SUPPORTED_VERSIONS=("6.8.0\t6.11.3\t6.15.0\t0.16.0\t0.17.0\t6.18.0")
|
||||
unset IFS
|
||||
|
||||
if [[ "\t${SUPPORTED_VERSIONS[@]}\t" =~ "\t${ARTIFACTORY_VERSION}\t" ]]; then
|
||||
sh install_artifactory.sh
|
||||
echo "\ninstall_artifactory.sh was selected" >> user-data.txt
|
||||
else
|
||||
sh install_artifactory7.sh
|
||||
echo "\ninstall_artifactory7.sh was selected" >> user-data.txt
|
||||
fi
|
||||
Reference in New Issue
Block a user