Added offline mode for xray. Added option to configure pg_hba.conf.

This commit is contained in:
Jeff Fry
2020-09-27 10:53:12 -07:00
111 changed files with 9069 additions and 599 deletions

View File

@@ -12,6 +12,10 @@ This Ansible directory consists of the following directories that support the JF
| collection_version | artifactory_version | xray_version |
|--------------------|---------------------|--------------|
| 1.1.0 | 7.7.8 | 3.8.6 |
| 1.0.9 | 7.7.3 | 3.8.0 |
| 1.0.8 | 7.7.3 | 3.8.0 |
| 1.0.8 | 7.7.1 | 3.5.2 |
| 1.0.8 | 7.6.1 | 3.5.2 |
| 1.0.7 | 7.6.1 | 3.5.2 |
| 1.0.6 | 7.5.0 | 3.3.0 |

View File

@@ -9,7 +9,7 @@ namespace: "jfrog"
name: "installers"
# The version of the collection. Must be compatible with semantic versioning
version: "1.0.8"
version: "1.1.0"
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: "README.md"

View File

@@ -12,7 +12,7 @@ The artifactory role installs the Artifactory Pro software onto the host. Per th
* _db_user_: The database user to configure. eg. "artifactory"
* _db_password_: The database password to configure. "Art1fact0ry"
* _server_name_: This is the server name. eg. "artifactory.54.175.51.178.xip.io"
* _system_file_: Your own [system YAML](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) file can be specified and used. **If specified, this file will be used rather than constructing a file from the parameters above.**
* _artifactory_system_yaml_: Your own [system YAML](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) file can be specified and used. **If specified, this file will be used rather than constructing a file from the parameters above.**
* _binary_store_file_: Your own [binary store file](https://www.jfrog.com/confluence/display/JFROG/Configuring+the+Filestore) can be used. If specified, the default cluster-file-system will not be used.
* _artifactory_upgrade_only_: Perform an software upgrade only. Default is false.
@@ -24,6 +24,8 @@ The artifactory role installs the Artifactory Pro software onto the host. Per th
### secondary vars (vars used by the secondary Artifactory server)
* _artifactory_is_primary_: For the secondary node(s) this must be set to **false**.
Additional variables can be found in [defaults/main.yml](./defaults/main.yml).
## Example Playbook
```
---

View File

@@ -4,7 +4,7 @@
ansible_marketplace: standalone
# The version of Artifactory to install
artifactory_version: 7.6.1
artifactory_version: 7.7.8
# licenses file - specify a licenses file or specify up to 5 licenses
artifactory_license1:
@@ -29,7 +29,7 @@ artifactory_file_store_dir: /data
artifactory_flavour: pro
extra_java_opts: -server -Xms2g -Xmx14g -Xss256k -XX:+UseG1GC
artifactory_system_yaml_template: system.yaml.j2
artifactory_tar: https://dl.bintray.com/jfrog/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/{{ artifactory_version }}/jfrog-artifactory-pro-{{ artifactory_version }}-linux.tar.gz
artifactory_home: "{{ jfrog_home_directory }}/artifactory"
artifactory_untar_home: "{{ jfrog_home_directory }}/artifactory-{{ artifactory_flavour }}-{{ artifactory_version }}"

View File

@@ -25,6 +25,19 @@
state: directory
become: yes
- name: Local Copy artifactory
unarchive:
src: "{{ local_artifactory_tar }}"
dest: "{{ jfrog_home_directory }}"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
creates: "{{ artifactory_untar_home }}"
become: yes
when: local_artifactory_tar is defined
register: downloadartifactory
until: downloadartifactory is succeeded
retries: 3
- name: download artifactory
unarchive:
src: "{{ artifactory_tar }}"
@@ -34,6 +47,7 @@
group: "{{ artifactory_group }}"
creates: "{{ artifactory_untar_home }}"
become: yes
when: artifactory_tar is defined
register: downloadartifactory
until: downloadartifactory is succeeded
retries: 3
@@ -50,6 +64,12 @@
group: "{{ artifactory_group }}"
become: yes
- name: ensure ownership of data
file:
path: "{{ artifactory_home }}/var/data"
owner: "artifactory"
group: "artifactory"
- name: ensure etc exists
file:
path: "{{ artifactory_home }}/var/etc"
@@ -60,17 +80,17 @@
- name: use specified system yaml
copy:
src: "{{ system_file }}"
src: "{{ artifactory_system_yaml }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes
when: system_file is defined
when: artifactory_system_yaml is defined
- name: configure system yaml
- name: configure system yaml template
template:
src: system.yaml.j2
src: "{{ artifactory_system_yaml_template }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes
when: system_file is not defined
when: artifactory_system_yaml is not defined
- name: ensure {{ artifactory_home }}/var/etc/security/ exists
file:
@@ -134,23 +154,34 @@
become: yes
when: artifactory_license_file is not defined and artifactory_is_primary == true
- name: Copy local database driver
copy:
src: "{{ db_local_location }}"
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
when: db_local_location is defined
become: yes
- name: download database driver
get_url:
url: "{{ db_download_url }}"
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
when: db_download_url is defined
become: yes
- name: create artifactory service
shell: "{{ artifactory_home }}/app/bin/installService.sh"
become: yes
- name: ensure ownership of var/data
- name: Ensure permissions are correct
file:
path: "{{ artifactory_home }}/var/data"
owner: "artifactory"
group: "artifactory"
path: "{{ artifactory_home }}"
group: "{{ artifactory_group }}"
owner: "{{ artifactory_user }}"
recurse: yes
become: yes
- name: start and enable the primary node

View File

@@ -1,16 +1,27 @@
---
- name: perform dependency installation
include_tasks: "{{ ansible_os_family }}.yml"
- name: install nginx
package:
name: nginx
state: present
register: package_res
retries: 5
delay: 60
become: yes
until: package_res is success
- name: Nginx Install Block
block:
- name: install nginx
package:
name: nginx
state: present
register: package_res
retries: 5
delay: 60
become: yes
until: package_res is success
rescue:
- name: perform dependency installation
include_tasks: "{{ ansible_os_family }}.yml"
- name: install nginx
package:
name: nginx
state: present
register: package_res
retries: 5
delay: 60
become: yes
until: package_res is success
- name: configure main nginx conf file.
copy:

View File

@@ -5,6 +5,17 @@ The postgres role will install Postgresql software and configure a database and
* _db_users_: This is a list of database users to create. eg. db_users: - { db_user: "artifactory", db_password: "Art1fAct0ry" }
* _dbs_: This is the database to create. eg. dbs: - { db_name: "artifactory", db_owner: "artifactory" }
By default, the [_pg_hba.conf_](https://www.postgresql.org/docs/9.1/auth-pg-hba-conf.html) client authentication file is configured for open access for development purposes through the _postgres_allowed_hosts_ variable:
```
postgres_allowed_hosts:
- { type: "host", database: "all", user: "all", address: "0.0.0.0/0", method: "trust"}
```
**THIS SHOULD NOT BE USED FOR PRODUCTION.**
**Update this variable to only allow access from Artifactory and Xray.**
## Example Playbook
```
---

View File

@@ -82,3 +82,8 @@ postgres_server_auto_explain_log_min_duration: -1
# Whether or not to use EXPLAIN ANALYZE.
postgres_server_auto_explain_log_analyze: true
# Sets the hosts that can access the database
postgres_allowed_hosts:
- { type: "host", database: "all", user: "all", address: "0.0.0.0/0", method: "trust"}

View File

@@ -4,4 +4,8 @@ local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
## remote connections IPv4
host all all 0.0.0.0/0 trust
{% if postgres_allowed_hosts and postgres_allowed_hosts is iterable %}
{% for host in postgres_allowed_hosts %}
{{ host.type | default('host') }} {{ host.database | default('all') }} {{ host.user | default('all') }} {{ host.address | default('0.0.0.0/0') }} {{ item.auth | default('trust') }}
{% endfor %}
{% endif %}

View File

@@ -11,9 +11,10 @@ The xray role will install Xray software onto the host. An Artifactory server an
* _db_url_: This is the database url. eg. "postgres://10.0.0.59:5432/xraydb?sslmode=disable"
* _db_user_: The database user to configure. eg. "xray"
* _db_password_: The database password to configure. "xray"
* _system_file_: Your own [system YAML](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) file can be specified and used. If specified, this file will be used rather than constructing a file from the parameters above.
* _xray_system_yaml_: Your own [system YAML](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) file can be specified and used. If specified, this file will be used rather than constructing a file from the parameters above.
* _xray_upgrade_only_: Perform an software upgrade only. Default is false.
Additional variables can be found in [defaults/main.yml](./defaults/main.yml).
## Example Playbook
```
---

View File

@@ -4,7 +4,7 @@
ansible_marketplace: standalone
# The version of xray to install
xray_version: 3.5.2
xray_version: 3.8.6
# whether to enable HA
xray_ha_enabled: true
@@ -24,4 +24,6 @@ xray_user: xray
xray_group: xray
# if this is an upgrade
xray_upgrade_only: false
xray_upgrade_only: false
xray_system_yaml_template: system.yaml.j2

View File

@@ -52,11 +52,19 @@
group: "{{ xray_group }}"
become: yes
- name: configure system yaml
template:
src: system.yaml.j2
dest: "{{ xray_home }}/var/etc/system.yaml"
- name: use specified system yaml
copy:
src: "{{ artifactory_system_yaml }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes
when: artifactory_system_yaml is defined
- name: configure system yaml template
template:
src: "{{ artifactory_system_yaml_template }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes
when: artifactory_system_yaml is not defined
- name: ensure {{ xray_home }}/var/etc/security/ exists
file:

View File

@@ -82,7 +82,6 @@
],
"constraints": {
"allowedSizes": [
"Standard_A2_v2",
"Standard_A4_v2",
"Standard_A4",
"Standard_D2s_v3",
@@ -133,14 +132,10 @@
"name": "artifactoryVersion",
"type": "Microsoft.Common.DropDown",
"label": "Artifactory-vm image version to deploy.",
"defaultValue": "7.4.3",
"defaultValue": "7.7.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"
@@ -163,7 +158,15 @@
},
{
"label": "7.4.3",
"value": "7.4.3"
"value": "7.4.30"
},
{
"label": "7.6.2",
"value": "0.0.1"
},
{
"label": "7.7.3",
"value": "0.0.2"
}
],
"required": true
@@ -180,7 +183,24 @@
"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}$",
"regex": "^[a-z0-9A-Z]{12,32}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-32 characters long."
},
"options": {
"hideConfirmation": true
}
},
{
"name": "joinKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Artifactory join Key",
"confirmPassword": "Confirm join Key"
},
"toolTip": "Join key for Artifactory cluster. Generate join.key using command '$openssl rand -hex 16'",
"constraints": {
"required": false,
"regex": "^[a-z0-9A-Z]{12,32}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-32 characters long."
},
"options": {
@@ -251,7 +271,7 @@
},
"toolTip": "To use Artifactory as docker registry you need to provide wild card valid Certificate. Provide your SSL Certificate.",
"constraints": {
"required": true,
"required": false,
"regex": "^(-----BEGIN CERTIFICATE-----)(.+)(-----END CERTIFICATE-----)$",
"validationMessage": "Provide SSL Certificate."
},
@@ -268,7 +288,7 @@
},
"toolTip": "Provide your SSL Certificate key",
"constraints": {
"required": true,
"required": false,
"regex": "^(-----BEGIN)(.+)(PRIVATE KEY-----)(.+)(-----END)(.+)(PRIVATE KEY-----)$",
"validationMessage": "Provide SSL Certificate Key."
},
@@ -283,7 +303,7 @@
"defaultValue": "artifactory",
"toolTip": "Provide your Certificate Domain Name. For e.g jfrog.team for certificate with *.jfrog.team",
"constraints": {
"required": true,
"required": false,
"regex": "^(\\*)*([\\w-\\.])+$",
"validationMessage": "Must be a valid fully-qualified domain name."
}
@@ -324,7 +344,77 @@
"bladeTitle": "Database Credential",
"elements": [
{
"name": "dbAdminUsername",
"name": "infoMessage",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "You can deploy a new Database or use your existing Postgres or MSSQL Databeses"
}
},
{
"name": "db_type",
"type": "Microsoft.Common.DropDown",
"label": "Database options",
"toolTip": "Deploy a new DB instance or use an existing DB",
"constraints": {
"required": true,
"allowedValues": [
{
"label": "Deploy a new Postgresql instance",
"value": "Postgresql_deploy.json"
},
{
"label": "Use existing Postgresql instance",
"value": "Postgresql_existing.json"
},
{
"label": "Deploy a new MSSQL instance",
"value": "MSSQL_deploy.json"
},
{
"label": "Use existing MSSQL instance",
"value": "MSSQL_existing.json"
}
]
},
"visible": true
},
{
"name": "db_name",
"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": "db_server",
"type": "Microsoft.Common.TextBox",
"label": "Database server name. Skip if a new deployment is selected",
"toolTip": "Database server name",
"constraints": {
"required": false,
"regex": "^[a-z0-9A-Z]{1,15}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-15 characters long."
}
},
{
"name": "manual_db_url",
"type": "Microsoft.Common.TextBox",
"label": "Database connection string. Skip if a new deployment is selected",
"toolTip": "Jdbc connection string for MSSQL or Postgresql",
"constraints": {
"required": false,
"regex": "..*",
"validationMessage": "DB connection string is not valid"
}
},
{
"name": "db_user",
"type": "Microsoft.Compute.UserNameTextBox",
"label": "User name",
"toolTip": "Admin username for the database",
@@ -336,7 +426,7 @@
}
},
{
"name": "dbAdminPassword",
"name": "db_password",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Password",
@@ -354,22 +444,11 @@
"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",
"name": "db_edition",
"type": "Microsoft.Common.DropDown",
"label": "Database Edition",
"defaultValue": "Basic",
"toolTip": "Edition of Database to use",
"toolTip": "MSSQL. Edition of Database to use",
"constraints": {
"allowedValues": [
{
@@ -385,7 +464,7 @@
"value": "Premium"
}
],
"required": true
"required": false
},
"visible": true
}
@@ -427,6 +506,7 @@
"nodeCount": "[steps('clusterConfig').nodeCount]",
"artifactoryVersion": "[steps('clusterConfig').artifactoryVersion]",
"masterKey": "[steps('clusterConfig').masterKey]",
"joinKey": "[steps('clusterConfig').joinKey]",
"artifactoryLicense1": "[steps('clusterConfig').artifactoryLicense1]",
"artifactoryLicense2": "[steps('clusterConfig').artifactoryLicense2]",
"artifactoryLicense3": "[steps('clusterConfig').artifactoryLicense3]",
@@ -439,10 +519,13 @@
"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]",
"db_type": "[steps('databaseConfig').db_type]",
"db_name": "[steps('databaseConfig').db_name]",
"db_server": "[steps('databaseConfig').db_server]",
"manual_db_url": "[steps('databaseConfig').manual_db_url]",
"db_user": "[steps('databaseConfig').db_user]",
"db_password": "[steps('databaseConfig').db_password]",
"db_edition": "[steps('databaseConfig').db_edition]",
"storageAccountType": "[steps('storageConfig').storageAccountsType]"
}
}

View File

@@ -16,6 +16,51 @@
"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."
}
},
"db_type": {
"type": "string",
"defaultValue": "Postgresql_deploy.json",
"allowedValues": [
"Postgresql_deploy.json",
"MSSQL_deploy.json",
"Postgresql_existing.json",
"MSSQL_existing.json"
],
"metadata": {
"description": "Deploy new Postgresql, MSSQL or use existing DB"
}
},
"manual_db_url": {
"type": "string",
"metadata": {
"description": "DB server URL, if existing DB server is used instead of a new deployment (jdbc:sqlserver://.. or jdbc:postgresql://..)"
}
},
"db_server": {
"type": "string",
"metadata": {
"description": "DB server name, if pre-existing DB is used"
}
},
"db_name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "MSSQL Database name"
}
},
"db_edition": {
"type": "string",
"minLength": 1,
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
],
"metadata": {
"description": "MSSQL Database Edition"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
@@ -34,7 +79,7 @@
},
"artifactoryVersion": {
"type": "string",
"defaultValue": "7.4.3",
"defaultValue": "0.0.2",
"allowedValues": [
"6.6.0",
"6.6.1",
@@ -47,7 +92,10 @@
"6.18.0",
"7.2.1",
"0.3.2",
"7.4.3"
"7.4.3",
"7.4.30",
"0.0.1",
"0.0.2"
],
"metadata": {
"description": "Artifactory-vm image version to deploy."
@@ -60,6 +108,13 @@
"description": "Master key for Artifactory cluster. Generate master.key using command '$openssl rand -hex 16'"
}
},
"joinKey": {
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Join key for Artifactory cluster. Generate join.key using command '$openssl rand -hex 16'"
}
},
"adminUsername": {
"type": "string",
"metadata": {
@@ -142,38 +197,30 @@
"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": {
"db_user": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Database Admin user name"
}
},
"DB_Admin_Password": {
"db_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"
"databases": {
"type": "object",
"defaultValue": {
"properties": [
{
"name": "artdb",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
},
"storageAccountType": {
@@ -237,13 +284,16 @@
"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')]",
"azureSqlServerName": "[if(or(equals(parameters('db_type'), 'MSSQL_existing.json'),equals(parameters('db_type'),'Postgresql_existing.json')), parameters('db_server'), concat(variables('namingInfix'), 'sqlsrv'))]",
"artDBname": "[parameters('databases').properties[0].name]",
"postgres_db_user": "[concat(parameters('db_user'), '@', variables('azureSqlServerName'))]",
"db_user": "[if(or(equals(parameters('db_type'), 'Postgresql_deploy.json'),equals(parameters('db_type'),'Postgresql_existing.json')), variables('postgres_db_user'), parameters('db_user'))]",
"db_password": "[parameters('db_password')]",
"db_location": "[parameters('location')]",
"db_name": "[parameters('db_name')]",
"db_edition": "[parameters('db_edition')]",
"masterKey": "[parameters('masterKey')]",
"joinKey": "[parameters('joinKey')]",
"certificate": "[parameters('certificate')]",
"certificateKey": "[parameters('certificateKey')]",
"certificateDomain": "[parameters('certificateDomain')]",
@@ -261,7 +311,7 @@
"version": "[parameters('artifactoryVersion')]"
},
"imageReference": "[variables('osType')]",
"dbTemplate": "azureDBDeploy.json",
"dbTemplate": "[parameters('db_type')]",
"dbTemplateLocation": "[uri(parameters('_artifactsLocation'), concat('nested/', variables('dbTemplate'), parameters('_artifactsLocationSasToken')))]",
"nsgName": "[concat(variables('namingInfix'), 'nsg')]"
},
@@ -283,7 +333,7 @@
"type": "Microsoft.Network/networkSecurityGroups",
"location": "[parameters('location')]",
"name": "[variables('nsgName')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"securityRules": [
{
@@ -363,9 +413,9 @@
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"addressSpace": {
@@ -396,14 +446,14 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-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'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"ipConfigurations": [
@@ -423,14 +473,14 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-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'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"ipConfigurations": [
@@ -456,7 +506,7 @@
"sku": {
"name": "Standard"
},
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"publicIPAllocationMethod": "Static",
"dnsSettings": {
@@ -471,7 +521,7 @@
"sku": {
"name": "Standard"
},
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"publicIPAllocationMethod": "Static",
"dnsSettings": {
@@ -483,13 +533,13 @@
"type": "Microsoft.Network/loadBalancers",
"name": "[variables('lbName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"sku": {
"name": "Standard"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]"
],
"tags":{
"displayName": "Load Balancer"
@@ -672,7 +722,7 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
@@ -688,7 +738,7 @@
{
"type": "Microsoft.Resources/deployments",
"name": "deploySQLDB",
"apiVersion": "2018-07-01",
"apiVersion": "2019-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
@@ -697,22 +747,28 @@
},
"parameters": {
"db_user": {
"value": "[parameters('DB_Admin_User')]"
"value": "[parameters('db_user')]"
},
"db_password": {
"value": "[parameters('DB_Admin_Password')]"
"value": "[variables('db_password')]"
},
"db_server": {
"value": "[variables('azureSqlServerName')]"
},
"db_location": {
"value": "[variables('db_location')]"
},
"databases": {
"value": "[parameters('databases')]"
},
"db_name": {
"value": "[parameters('DB_Name')]"
"value": "[variables('db_name')]"
},
"db_edition": {
"value": "[variables('DB_Edition')]"
"value": "[variables('db_edition')]"
},
"db_location": {
"value": "[variables('DB_Location')]"
"manual_db_url": {
"value": "[parameters('manual_db_url')]"
}
}
}
@@ -723,10 +779,10 @@
"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'))]"
"[resourceId('Microsoft.Network/loadBalancers/', variables('lbName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Resources/deployments/', 'deploySQLDB')]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
],
"plan": {
"name": "artifactory-vm",
@@ -757,7 +813,7 @@
"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'))]"
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nARTIFACTORY_VERSION=', parameters('artifactoryVersion'),'\nCERTIFICATE_KEY=',variables('certificateKey'),'\nCERTIFICATE=', variables('certificate'),'\nCERTIFICATE_DOMAIN=',variables('certificateDomain'),'\nDB_TYPE=',parameters('db_type'),'\nARTIFACTORY_SERVER_NAME=',variables('artifactoryServerName'),'\nEXTRA_JAVA_OPTS=',variables('extraJavaOptions'),'\nJDBC_STR=',reference('Microsoft.Resources/deployments/deploySQLDB').outputs.jdbcConnString.value,'\nDB_NAME=',variables('artDBname'),'\nDB_ADMIN_USER=',variables('db_user'),'\nDB_ADMIN_PASSWD=',variables('db_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'),'\nJOIN_KEY=',variables('joinKey'),'\nIS_PRIMARY=','true','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
@@ -821,11 +877,11 @@
"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'))]"
"[resourceId('Microsoft.Network/loadBalancers/', variables('lbName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Compute/virtualMachineScaleSets/', variables('scaleSetPrimaryName'))]",
"[resourceId('Microsoft.Resources/deployments/', 'deploySQLDB')]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
],
"plan": {
"name": "artifactory-vm",
@@ -856,7 +912,7 @@
"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'))]"
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nARTIFACTORY_VERSION=', parameters('artifactoryVersion'),'\nCERTIFICATE_KEY=',variables('certificateKey'),'\nCERTIFICATE=', variables('certificate'),'\nCERTIFICATE_DOMAIN=',variables('certificateDomain'),'\nDB_TYPE=',parameters('db_type'),'\nARTIFACTORY_SERVER_NAME=',variables('artifactoryServerName'),'\nEXTRA_JAVA_OPTS=',variables('extraJavaOptions'),'\nJDBC_STR=',reference('Microsoft.Resources/deployments/deploySQLDB').outputs.jdbcConnString.value,'\nDB_NAME=',variables('artDBname'),'\nDB_ADMIN_USER=',variables('db_user'),'\nDB_ADMIN_PASSWD=',variables('db_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'),'\nJOIN_KEY=',variables('joinKey'),'\nIS_PRIMARY=','false','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
},
"networkProfile": {
"networkInterfaceConfigurations": [

View File

@@ -1,9 +1,10 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"$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": {
@@ -11,39 +12,43 @@
},
"db_server": {
"type": "string",
"defaultValue": "artmssqlsrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artdb",
"minLength": 1
},
"db_location": {
"type": "string",
"defaultValue": ""
"type": "string"
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
"rtdbCollation": "Latin1_General_100_CS_AS",
"db_location": "[parameters('db_location')]"
"rtdbCollation": "Latin1_General_100_CS_AS"
},
"resources": [
{
"name": "[parameters('db_server')]",
"type": "Microsoft.Sql/servers",
"kind": "v12.0",
"location": "[variables('db_location')]",
"apiVersion": "2015-05-01-preview",
"dependsOn": [
],
"location": "[parameters('db_location')]",
"apiVersion": "2020-02-02-preview",
"tags": {
"displayName": "artifactoryDB"
},
@@ -56,10 +61,10 @@
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallrules",
"location": "[variables('db_location')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('db_location')]",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('db_server'))]"
"[resourceId('Microsoft.Sql/servers/', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
@@ -70,8 +75,8 @@
"name": "[parameters('db_name')]",
"type": "databases",
"kind": "v12.0,user",
"location": "[variables('db_location')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('db_location')]",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[parameters('db_server')]"
],
@@ -90,7 +95,15 @@
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:sqlserver://', reference(concat('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
"value": "[concat('jdbc:sqlserver://', reference(resourceId('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
},
"dbUrl": {
"type": "string",
"value": "[parameters('manual_db_url')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
}
}
}

View File

@@ -0,0 +1,76 @@
{
"$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": "mssqlsrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artdb",
"minLength": 1
},
"db_location": {
"type": "string"
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
],
"outputs": {
"db_user": {
"type": "string",
"value": "[parameters('db_user')]"
},
"db_server": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_name": {
"type": "string",
"value": "[parameters('db_name')]"
},
"db_location": {
"type": "string",
"value": "[parameters('db_location')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
},
"dbUrl": {
"type": "string",
"value": "[parameters('manual_db_url')]"
}
}
}

View File

@@ -0,0 +1,178 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"type": "string",
"defaultValue": "xray",
"minLength": 1
},
"db_password": {
"type": "securestring"
},
"db_server": {
"type": "string",
"defaultValue": "xraypostgressrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artrtdb",
"minLength": 1
},
"db_location": {
"type": "string"
},
"skuCapacity": {
"type": "int",
"defaultValue": 2
},
"skuFamily": {
"type": "string",
"defaultValue": "Gen5"
},
"skuName": {
"type": "string",
"defaultValue": "GP_Gen5_2"
},
"skuSizeMB": {
"type": "int",
"defaultValue": 5120
},
"skuTier": {
"type": "string",
"defaultValue": "GeneralPurpose"
},
"version": {
"type": "string",
"defaultValue": "9.6"
},
"backupRetentionDays": {
"type": "int",
"defaultValue": 7
},
"geoRedundantBackup": {
"type": "string",
"defaultValue": "Disabled"
},
"databases": {
"type": "object"
},
"sslEnforcement": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Disabled",
"metadata": {
"description": "SSL Enforcement"
}
},
"publicNetworkAccess": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Enabled",
"metadata": {
"description": "Public Network Access"
}
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"name": "[parameters('db_server')]",
"properties": {
"version": "[parameters('version')]",
"administratorLogin": "[parameters('db_user')]",
"administratorLoginPassword": "[parameters('db_password')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"sslEnforcement": "[parameters('sslEnforcement')]",
"storageProfile": {
"storageMB": "[parameters('skuSizeMB')]",
"backupRetentionDays": "[parameters('backupRetentionDays')]",
"geoRedundantBackup": "[parameters('geoRedundantBackup')]"
}
},
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('skuCapacity')]",
"size": "[parameters('skuSizeMB')]",
"family": "[parameters('skuFamily')]"
},
"resources": [
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallRules",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/databases",
"apiversion": "2017-12-01",
"name": "[concat(parameters('db_server'), '/', parameters('databases').properties[0].name)]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"charset": "[parameters('databases').properties[0].charset]",
"collation": "[parameters('databases').properties[0].collation]"
}
}
]
}
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:postgresql://', reference(resourceId('Microsoft.DBforPostgreSQL/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':5432')]"
},
"dbServerName": {
"type": "string",
"value": "[parameters('db_server')]"
},
"xrayConnString": {
"type": "string",
"value": "[concat('postgres://', reference(resourceId('Microsoft.DBforPostgreSQL/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':5432')]"
},
"db_name": {
"type": "string",
"value": "[parameters('db_name')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"dbUrl": {
"type": "string",
"value": "[parameters('manual_db_url')]"
}
}
}

View File

@@ -0,0 +1,76 @@
{
"$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": "xraypostgressrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artdb",
"minLength": 1
},
"db_location": {
"type": "string"
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[parameters('manual_db_url')]"
},
"db_user": {
"type": "string",
"value": "[parameters('db_user')]"
},
"db_server": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_name": {
"type": "string",
"value": "[parameters('db_name')]"
},
"db_location": {
"type": "string",
"value": "[parameters('db_location')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
}
}
}

View File

@@ -1,12 +1,17 @@
#!/bin/bash
# Script stdout and stderr are stored in /var/lib/waagent/custom-script/download on the VM
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_TYPE=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_TYPE=" | sed "s/DB_TYPE=//")
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=//")
CERTIFICATE=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//")
CERTIFICATE_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_KEY=" | sed "s/CERTIFICATE_KEY=//")
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=//")
@@ -20,6 +25,9 @@ export DEBIAN_FRONTEND=noninteractive
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"
# Install Postgresql driver
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/postgresql-9.4.1212.jar https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar >> /tmp/install-databse-driver.log 2>&1
CERTIFICATE_DOMAIN=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_DOMAIN=" | sed "s/CERTIFICATE_DOMAIN=//")
[ -z "$CERTIFICATE_DOMAIN" ] && CERTIFICATE_DOMAIN=artifactory
@@ -71,6 +79,8 @@ cat <<EOF >/etc/nginx/nginx.conf
}
EOF
if [[ -n "${CERTIFICATE}" ]] || [[ -n "${CERTIFICATE_KEY}" ]]; then
cat <<EOF >/etc/nginx/conf.d/artifactory.conf
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/pki/tls/certs/cert.pem;
@@ -111,7 +121,44 @@ server {
}
}
EOF
else
cat <<EOF >/etc/nginx/conf.d/artifactory.conf
## server configuration
server {
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
fi
mkdir -p /opt/jfrog/artifactory/var/etc/artifactory/
cat <<EOF >/opt/jfrog/artifactory/var/etc/artifactory/artifactory.cluster.license
@@ -145,11 +192,13 @@ 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
if [[ $DB_TYPE =~ "MSSQL" ]]; then
# 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
## Example for mssql
type: mssql
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: ${DB_URL};databaseName=${DB_NAME};sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository
@@ -157,6 +206,20 @@ cat <<EOF >>/var/opt/jfrog/artifactory/etc/system.yaml
password: ${DB_PASSWORD}
EOF
elif [[ $DB_TYPE =~ "Postgresql" ]]; then
# Set Postgresql settings (add if/else for Postgres/MSSQL) ATTENTION - RT VM 7.5.5 doesn't have Postgres driver!!
cat <<EOF >>/var/opt/jfrog/artifactory/etc/system.yaml
## One of: mysql, oracle, mssql, postgresql, mariadb
## Default: Embedded derby
## Example for postgresql
type: postgresql
driver: org.postgresql.Driver
url: ${DB_URL}/${DB_NAME}
username: ${DB_USER}
password: ${DB_PASSWORD}
EOF
fi
# Create master.key on each node
mkdir -p /opt/jfrog/artifactory/var/etc/security/
@@ -179,14 +242,19 @@ cat <<EOF >/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml
</config>
EOF
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//" > /tmp/temp.pem
if [[ -n "${CERTIFICATE}" ]] || [[ -n "${CERTIFICATE_KEY}" ]]; then
cat <<EOF >/tmp/temp.pem
${CERTIFICATE}
EOF
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
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_KEY=" | sed "s/CERTIFICATE_KEY=//" > /tmp/temp.key
cat <<EOF >/tmp/temp.key
${CERTIFICATE_KEY}
EOF
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
rm /tmp/temp.key
fi
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/*

View File

@@ -5,9 +5,9 @@ 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
./install_artifactory.sh
echo "\ninstall_artifactory.sh was selected" >> user-data.txt
else
sh install_artifactory7.sh
./install_artifactory7.sh
echo "\ninstall_artifactory7.sh was selected" >> user-data.txt
fi

View File

@@ -1,9 +1,9 @@
# Setup Artifactory Enterprise
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FJFrogDev%2FJFrog-Cloud-Installers%2Fmaster%2FAzureResourceManager%2Fazuredeploy.json" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png"/>
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fjfrog%2FJFrog-Cloud-Installers%2Farm-xray%2FAzureResourceManager%2FArtifactory%2Fazuredeploy_ms_ps.json" target="_blank">
<img src="https://aka.ms/deploytoazurebutton"/>
</a>
<a href="http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FJFrogDev%2FJFrog-Cloud-Installers%2Fmaster%2FAzureResourceManager%2Fazuredeploy.json" target="_blank">
<a href="http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2Fjfrog%2FJFrog-Cloud-Installers%2Farm-xray%2FAzureResourceManager%2FArtifactory%2Fazuredeploy_ms_ps.json" target="_blank">
<img src="http://armviz.io/visualizebutton.png"/>
</a>
@@ -20,7 +20,7 @@ This template can help you setup the [Artifactory Enterprise](https://jfrog.com/
![screenshot](images/Parameters.png)
3. Click on Purchase to start deploying resources. It will deploy MsSQL database, Azure Blob storage container, VM installing Nginx and Artifactory and Load balancer.
3. Click on Review + Create, then on Create to start deploying resources. It will deploy MsSQL or Postgresql database (or it can use existing), Azure Blob storage container, VM installing Nginx and Artifactory and Load balancer.
4. Once deployment is done. Copy FQDN from Output of deployment template.
@@ -29,8 +29,8 @@ This template can help you setup the [Artifactory Enterprise](https://jfrog.com/
6. You will see specified artifactory member nodes in 'Admin -> High Availability' page.
### Note:
1. This template only supports Artifactory version 5.8.x and above.
2. Turn off daily backups. Read Documentation provided [here](https://www.jfrog.com/confluence/display/RTF/Managing+Backups)
1. This template only supports Artifactory version 6.18.x and above.
2. Turn off daily backups. Read Documentation provided [here](https://www.jfrog.com/confluence/display/RTF/Managing+Backups)
3. Use SSL Certificate with valid wild card to you artifactory as docker registry with subdomain method.
4. Input values for 'adminUsername' and 'adminPassword' parameters needs to follow azure VM access rules.
5. One primary node is configured automatically. And, Minimum 1 member node is expected for the Artifactory HA installation.
@@ -50,12 +50,11 @@ considering you have SSL certificate for `*.jfrog.team`
### Steps to upgrade Artifactory Version
1. Login into Primary VM instance and sudo as root. Use the admin credentials provided in the install setup.
1. Login into first member VM instance and sudo as root. Use the admin credentials provided in the install setup.
Note: Use load balancer's NAT entries under Azure resources, to get the allocated NAT port for accessing the VM instance.
2. Stop nginx and artifactory services.
```
service nginx stop
service artifactory stop
```
@@ -67,9 +66,9 @@ Note: Use load balancer's NAT entries under Azure resources, to get the allocate
4. Start artifactory and nginx services.
```
service artifactory start
service nginx start
```
5. Repeat above steps for all member nodes.
5. Repeat above steps for all member nodes then for primary node.
6. To check the version of each node, open Administration -> Monitoring -> Service status
------
#### Note:

View File

@@ -16,6 +16,51 @@
"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."
}
},
"db_type": {
"type": "string",
"defaultValue": "Postgresql_deploy.json",
"allowedValues": [
"Postgresql_deploy.json",
"MSSQL_deploy.json",
"Postgresql_existing.json",
"MSSQL_existing.json"
],
"metadata": {
"description": "Deploy new Postgresql, MSSQL or use existing DB"
}
},
"manual_db_url": {
"type": "string",
"metadata": {
"description": "DB server URL, if existing DB server is used instead of a new deployment (jdbc:sqlserver://.. or jdbc:postgresql://..)"
}
},
"db_server": {
"type": "string",
"metadata": {
"description": "DB server name, if pre-existing DB is used"
}
},
"db_name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "MSSQL Database name"
}
},
"db_edition": {
"type": "string",
"minLength": 1,
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
],
"metadata": {
"description": "MSSQL Database Edition"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
@@ -34,7 +79,7 @@
},
"artifactoryVersion": {
"type": "string",
"defaultValue": "7.4.30",
"defaultValue": "0.0.2",
"allowedValues": [
"6.6.0",
"6.6.1",
@@ -50,21 +95,24 @@
"7.2.1",
"7.4.3",
"7.4.30",
"7.4.31"
"7.4.31",
"7.5.7",
"0.0.1",
"0.0.2"
],
"metadata": {
"description": "Artifactory-vm image version to deploy."
}
},
"masterKey": {
"type": "string",
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Master key for Artifactory cluster. Generate master.key using command '$openssl rand -hex 16'"
}
},
"joinKey": {
"type": "string",
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Join key for Artifactory cluster. Generate join.key using command '$openssl rand -hex 16'"
@@ -117,15 +165,13 @@
}
},
"certificate": {
"type": "string",
"defaultValue": "-----BEGIN CERTIFICATE----- MIIFhzCCA2+gAwIBAgIJALC4r5BQWZE4MA0GCSqGSIb3DQEBCwUAMFoxCzAJBgNV BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRMwEQYDVQQHDApTYW50YUNsYXJh MQswCQYDVQQKDAJJVDEUMBIGA1UEAwwLKi5sb2NhbGhvc3QwHhcNMTgwMTE3MTk0 NjI4WhcNMTkwMTA4MTk0NjI4WjBaMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2Fs aWZvcm5pYTETMBEGA1UEBwwKU2FudGFDbGFyYTELMAkGA1UECgwCSVQxFDASBgNV BAMMCyoubG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA 7KfOWDQlov8cMa8r/lcJqiWZaH9myQC74Vbe0HXsntQbcvljkjG2P7ebm5dd9Bzc sauNOJpbKf5AhFK1iwJUAkciGc1LR4k8wfWmQM3NPS8hrqrtH20zqNpdFRpNYjja JofwccPNm030GhhZkZ95TpruvmswMDwspl3jfqdcc/eiQsHcKyGnV2a+UAeoqe7J mHhmhRy1MLqAjF5U1GrUYUONA+22iRDJb4c9B91QoWvsnXpdA9NKV/mmA3/rIdx6 Ld2IPRdrIw2K5sAnXsh3bx2oCSvSfussf0x+4XDrnsaHVfjwvfNL8ECOuac2Oi/E WOp9528gOohpFAuwEt63Vl5p8/CC9m0HJDTZBKm2l5eD1kdPIj4PvP9Sn9CxGXKQ E1bxWoFxGX8EyRW0b0NK31N7b8JPZ1SoFNiB5amOMNLvR26a7cQrKumTuJeYK9Ja JaxhMXM7R0DA0Ev8ZG2xmyCygox+1KPSmJOIEpT70BFbj3rKLNqP22ET+zvPuh+2 DdgyrpHFeYkGWjMbWPjK7wJsD2zM8ccoJQfepPz8I4rT0JfrKAQgCGuGOggneaNJ KTVGNOFbj5AXdZ/Q+GvNommyRdq4J7EnqY6L+P25fo5qZ6UZ/iS0tPcvxgn0Fdhs pUPbQyQIDZyxZd3Q1lUIE38ol8P66mS2zbzf8EeOCoUCAwEAAaNQME4wHQYDVR0O BBYEFETAQM/5P7XJ8kevHFj6BPndQOFaMB8GA1UdIwQYMBaAFETAQM/5P7XJ8kev HFj6BPndQOFaMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAJ1TepKv LWYhFmVQcgZwZf/qt1a1cohzJSm6da9RCnnAWC7WC/U117bgSomtrH1v0OysHFhB zBBUeBqI7+OmzAX8dhj+roKkcnFUM/IwlK1eueIIA//CWvEf/o0XExilVS2yCc9d PTpOQBXwk9QinxK36kHdBiGxa7dW0JPnOEEmuMgGORKeLy4J6Ik8iSeFY1SZVcOI +6WWvoKciPlmIeccC+6YVmkeBwhP2o5r5w/UAaO2hSnGvmm4UIj/VJv4VQu7xTUp cIfFz5NtIr80DbqcyPiEMS2ETJ4L/kO4MS5FfeEXyQuXCzmiIDVY6tE3C7+kZmK4 JzPLuWm9ndQoyQySOGfQqvlUR1+YxUdvmu3LrOS5dOA354Q36wHa4wEGUoHU/7GV fYQmmmDSDaNSpXW5PFey6scFyDBS/yYJ0H9EjYb/11HeWYj8Yv5xTWj8nhzJONC8 D6Y5ydlU4PifM2pOf88pTYpmogNwLJWXbql5I9cvMa8APo4yLVqcISU5ynsvFke+ Non+T0mHpJai/hrA9NK+s6EGC1dAX58jy61h6FhOPI1d4s/mov/KMa2t3SfZp5SF 81aR6dHvO56teiK5M1xMkrqG75zh3TMFJJLRFe9XxeB4JeN76URB3mgADOUqkBxd ibSgVqfKwOw4IujEcqMUc5mqSnbLY1Dv+oby -----END 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": "string",
"defaultValue": "-----BEGIN PRIVATE KEY----- MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDsp85YNCWi/xwx ryv+VwmqJZlof2bJALvhVt7Qdeye1Bty+WOSMbY/t5ubl130HNyxq404mlsp/kCE UrWLAlQCRyIZzUtHiTzB9aZAzc09LyGuqu0fbTOo2l0VGk1iONomh/Bxw82bTfQa GFmRn3lOmu6+azAwPCymXeN+p1xz96JCwdwrIadXZr5QB6ip7smYeGaFHLUwuoCM XlTUatRhQ40D7baJEMlvhz0H3VCha+ydel0D00pX+aYDf+sh3Hot3Yg9F2sjDYrm wCdeyHdvHagJK9J+6yx/TH7hcOuexodV+PC980vwQI65pzY6L8RY6n3nbyA6iGkU C7AS3rdWXmnz8IL2bQckNNkEqbaXl4PWR08iPg+8/1Kf0LEZcpATVvFagXEZfwTJ FbRvQ0rfU3tvwk9nVKgU2IHlqY4w0u9HbprtxCsq6ZO4l5gr0lolrGExcztHQMDQ S/xkbbGbILKCjH7Uo9KYk4gSlPvQEVuPesos2o/bYRP7O8+6H7YN2DKukcV5iQZa MxtY+MrvAmwPbMzxxyglB96k/PwjitPQl+soBCAIa4Y6CCd5o0kpNUY04VuPkBd1 n9D4a82iabJF2rgnsSepjov4/bl+jmpnpRn+JLS09y/GCfQV2GylQ9tDJAgNnLFl 3dDWVQgTfyiXw/rqZLbNvN/wR44KhQIDAQABAoICAQDm1pAp7UPBCELCG/I3t0KQ GvjWu17RNcwN86SHhl92VcMolSaQ1bjF0h0Q2ccldHm5PHMWAUpnXcAk0mCO5Yh4 aFZVALEraCxBrZGrqJNH2Q9rxwJhIy2+yLD/Apb09iukZfkdnzaRBKrUQWgs6Xd0 OyAh0YBBrJCI/xAG3M0LuUMnBt3xnHQUhv2gJrhYeble5iJqOSRsEZ+OS/1G7aWX 8kI80MS6UguKpEndv/0EV7eHrHHKZ3Ee+z76Lu52Kw9qaaqYnJ0+pdkVV92PUM9f LXhY6cv7TP4sdbtVv8W1LEWakKaTQhySjwYpBXeZrjpB2QlSlEzFi4WjrfrjjSca UZazm/jY5uDI2cXf35NyZUkbYxIKlGtURtDpoPp5R7XguHSoqLrh2Zsc79mZfNST zFwbhNBVB2nAl6ZyIRNFLjVhQScvlImpIVSVZm5/NiiABIEaxRh8w8C5qRMctSTy KF6rS6as2KsPQHpiu/6nDMqqTZ8UMQ3yXEpai5VwAzKFP67usHheKf4RIXNUn7Xc JxWiI8KfOV5n4cSJK1/R+i+ZpWyQiloao4v7GS/fwZTsILeBLBa0utDmNs5aJgVK cEagRjVGAeAEc2W+jXmSqtZRHQowJmEKOARMn4lI+duziSCjIfPH6xIDAUhVlc/K u03432NupfPepW6BYVBgQQKCAQEA/+CD2uiRZgmzuEn/vn/u7jGFjETdUQmfl5kX pMTtueXyQxHBRwBCZqq885doozeQd7mLRcW+klngq1NmnEnjx+NfUzFJLpEmQO1/ AMHUpYpZY4jOyntx9cBy+M+DUfNtdsJUz+VOe3HO5/lJJf+gSgpVp2ku1oOrgEeH a71aGIXOsiOQ/fHL4Q0CuylersD5Dq4Tdf/u6rr4NbwOZQCQ9WH0uTckA9SkjJFu iHXblg8j9RUNbj89WPrEulKA98duFuLvGTeohcAPQ8f60Z7sxDLGLRyRvhUO4EBr hTTmcfI2LsPWSo+X+n6eBqfUfGZub2qN+d2B08qKgnGdgFEf6QKCAQEA7MTtAphl lswq4kPvDkPHMqJhmPBgb5NAUzE2Z8yjJY3IX6zxinSDnuMwEzCinKe7rzv6aYIh klviND/oyLOxVlLESZu62epokgIey05sv9a/030z7q5hradNzcMP1VfGVs6IeOvr 3Kit4T7LI1L2eXwD1Yks6uHHw8lHAlyrrlbwCEmzqElKs0YtkvNa4HFgesFNnObe f8C29LOPZMqje7iAT91823MGI9NML9qGYON/ZLc4uCB9no+o6ZOTQHqX1xxSWv5D 66KGiRnUC/RAq6RbTVn3NxFgvb3k0rejbQbxW5KCri1E4sTw+pZ5bIRUJcXi+J+Z Tg88lVbmqXfwPQKCAQEA94yShDr0UC+au/R7hCXpVnB6r5YAN+KDj/sAsNwE0hDx LIoE31gU5ZbRbylQhne/QNU1NK93C8gAYEAzyYiC4mPLWYUZNAAhbjdW47iirfUH PhChX6vGOOeTU7wPZD2J7ZdczjUelLcqYar/Zc/Fl1wgOfK86bRBO733+fgbLhZm PlnCcKx5fqVDuybu/0qaqeUn1sVgs59nezURCA5gL8YxKO973GjhOU2KDmNXqfnD 49wWPk7YXzldEpW3SACdNW8futnqJFwHaKAUvLBwh/BHYmV9atScq8AnRZxERoD6 govcyg3aDvJomC/OlvvSY+BGszHl5KzTDBg3NGlH4QKCAQA/71lU5xQfqVg3K0MF ZhYHPUP/iYFw/6FSFarsUp0Higa+lzPOQHI+WHjl5a8zgDO1OQwAq6wnGnq1w0A3 2hYcClOI0O2e5KaCLuJj4fSJxRKdqGR6okosG05uLqs63+3mCPVfOc3CEyaI+Wzf SArYeT2LzvP7JSbNXq+3GpEdjcpZYpWJ7uimCmBKGz7B9runykUMBme0tbRx1X72 J6YHxaWYa2XI2IGi8O7UyTyaMzR2XOeLCPMC+yYQlNIhijkwVCyE974dhhCwOvJA nB9Oeh5Rf+a6zw2BjyKYKBCQY1yPbrutDvpYBfhQoot9Wyph3NLScj5yjri8VvAI eSO9AoIBAQDyUx5YUgHgpoJtRZ+8PGQBZHm5L5HJhvfUs96I9Z4lZSXnCmEJyOWn LIob8c0n4hU1EXdbbl+7eRQgG3oGKyF0XXhuaP3vHprIBW6tm9kCGORTliZOaZdW 0Mj9GUv2de1r8anwJMFvIMXsuO08rsGzsIt7DrNYa0YSMkeDwPenRfDHXOYH2fjf RKjlP3fQr/iLL/YuMGaNxzIeyWPZ2WTUUC0bllNxMTZmztuMkPNb7fhhs0hLecXM fE2nbwUaGwMZaails1+5G3HvEAlChJ1GN9XnYxrtfqq93tYELWBiNcv1LaMAFvj8 S+j1+iUKGGhwVmhqh75q5do3+VF3XlAh -----END PRIVATE KEY-----",
"type": "securestring",
"metadata": {
"description": "Provide your SSL Certificate key"
}
@@ -154,38 +200,30 @@
"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": {
"db_user": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Database Admin user name"
}
},
"DB_Admin_Password": {
"db_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"
"databases": {
"type": "object",
"defaultValue": {
"properties": [
{
"name": "artdb",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
},
"storageAccountType": {
@@ -205,7 +243,7 @@
"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/refactoring-rt6-rt7/AzureResourceManager/"
"defaultValue": "https://raw.githubusercontent.com/jfrog/JFrog-Cloud-Installers/master/AzureResourceManager/Artifactory/"
},
"_artifactsLocationSasToken": {
"type": "securestring",
@@ -249,12 +287,14 @@
"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')]",
"azureSqlServerName": "[if(or(equals(parameters('db_type'), 'MSSQL_existing.json'),equals(parameters('db_type'),'Postgresql_existing.json')), parameters('db_server'), concat(variables('namingInfix'), 'sqlsrv'))]",
"artDBname": "[parameters('databases').properties[0].name]",
"postgres_db_user": "[concat(parameters('db_user'), '@', variables('azureSqlServerName'))]",
"db_user": "[if(or(equals(parameters('db_type'), 'Postgresql_deploy.json'),equals(parameters('db_type'),'Postgresql_existing.json')), variables('postgres_db_user'), parameters('db_user'))]",
"db_password": "[parameters('db_password')]",
"db_location": "[parameters('location')]",
"db_name": "[parameters('db_name')]",
"db_edition": "[parameters('db_edition')]",
"masterKey": "[parameters('masterKey')]",
"joinKey": "[parameters('joinKey')]",
"certificate": "[parameters('certificate')]",
@@ -270,11 +310,11 @@
"osType": {
"publisher": "jfrog",
"offer": "artifactory-vm",
"sku": "artifactory-vm-private",
"sku": "artifactory-vm",
"version": "[parameters('artifactoryVersion')]"
},
"imageReference": "[variables('osType')]",
"dbTemplate": "azureDBDeploy.json",
"dbTemplate": "[parameters('db_type')]",
"dbTemplateLocation": "[uri(parameters('_artifactsLocation'), concat('nested/', variables('dbTemplate'), parameters('_artifactsLocationSasToken')))]",
"nsgName": "[concat(variables('namingInfix'), 'nsg')]"
},
@@ -296,7 +336,7 @@
"type": "Microsoft.Network/networkSecurityGroups",
"location": "[parameters('location')]",
"name": "[variables('nsgName')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"securityRules": [
{
@@ -376,9 +416,9 @@
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"addressSpace": {
@@ -409,14 +449,14 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-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'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"ipConfigurations": [
@@ -436,14 +476,14 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-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'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"ipConfigurations": [
@@ -469,7 +509,7 @@
"sku": {
"name": "Standard"
},
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"publicIPAllocationMethod": "Static",
"dnsSettings": {
@@ -484,7 +524,7 @@
"sku": {
"name": "Standard"
},
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"publicIPAllocationMethod": "Static",
"dnsSettings": {
@@ -496,13 +536,13 @@
"type": "Microsoft.Network/loadBalancers",
"name": "[variables('lbName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"sku": {
"name": "Standard"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipMemberName'))]"
],
"tags":{
"displayName": "Load Balancer"
@@ -685,7 +725,7 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
@@ -701,7 +741,7 @@
{
"type": "Microsoft.Resources/deployments",
"name": "deploySQLDB",
"apiVersion": "2018-07-01",
"apiVersion": "2019-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
@@ -710,22 +750,28 @@
},
"parameters": {
"db_user": {
"value": "[parameters('DB_Admin_User')]"
"value": "[parameters('db_user')]"
},
"db_password": {
"value": "[parameters('DB_Admin_Password')]"
"value": "[variables('db_password')]"
},
"db_server": {
"value": "[variables('azureSqlServerName')]"
},
"db_location": {
"value": "[variables('db_location')]"
},
"databases": {
"value": "[parameters('databases')]"
},
"db_name": {
"value": "[parameters('DB_Name')]"
"value": "[variables('db_name')]"
},
"db_edition": {
"value": "[parameters('DB_Edition')]"
"value": "[variables('db_edition')]"
},
"db_location": {
"value": "[variables('DB_Location')]"
"manual_db_url": {
"value": "[parameters('manual_db_url')]"
}
}
}
@@ -736,13 +782,13 @@
"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'))]"
"[resourceId('Microsoft.Network/loadBalancers/', variables('lbName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Resources/deployments/', 'deploySQLDB')]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
],
"plan": {
"name": "artifactory-vm-private",
"name": "artifactory-vm",
"publisher": "jfrog",
"product": "artifactory-vm"
},
@@ -770,7 +816,7 @@
"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'),'\nJOIN_KEY=',variables('joinKey'),'\nIS_PRIMARY=','true','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nARTIFACTORY_VERSION=', parameters('artifactoryVersion'),'\nCERTIFICATE_KEY=',variables('certificateKey'),'\nCERTIFICATE=', variables('certificate'),'\nCERTIFICATE_DOMAIN=',variables('certificateDomain'),'\nDB_TYPE=',parameters('db_type'),'\nARTIFACTORY_SERVER_NAME=',variables('artifactoryServerName'),'\nEXTRA_JAVA_OPTS=',variables('extraJavaOptions'),'\nJDBC_STR=',reference('Microsoft.Resources/deployments/deploySQLDB').outputs.jdbcConnString.value,'\nDB_NAME=',variables('artDBname'),'\nDB_ADMIN_USER=',variables('db_user'),'\nDB_ADMIN_PASSWD=',variables('db_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'),'\nJOIN_KEY=',variables('joinKey'),'\nIS_PRIMARY=','true','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
@@ -834,14 +880,14 @@
"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'))]"
"[resourceId('Microsoft.Network/loadBalancers/', variables('lbName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Compute/virtualMachineScaleSets/', variables('scaleSetPrimaryName'))]",
"[resourceId('Microsoft.Resources/deployments/', 'deploySQLDB')]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
],
"plan": {
"name": "artifactory-vm-private",
"name": "artifactory-vm",
"publisher": "jfrog",
"product": "artifactory-vm"
},
@@ -869,7 +915,7 @@
"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'),'\nJOIN_KEY=',variables('joinKey'),'\nIS_PRIMARY=','false','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
"customData": "[base64(concat('#INSTALL SCRIPT INPUTS\nARTIFACTORY_VERSION=', parameters('artifactoryVersion'),'\nCERTIFICATE_KEY=',variables('certificateKey'),'\nCERTIFICATE=', variables('certificate'),'\nCERTIFICATE_DOMAIN=',variables('certificateDomain'),'\nDB_TYPE=',parameters('db_type'),'\nARTIFACTORY_SERVER_NAME=',variables('artifactoryServerName'),'\nEXTRA_JAVA_OPTS=',variables('extraJavaOptions'),'\nJDBC_STR=',reference('Microsoft.Resources/deployments/deploySQLDB').outputs.jdbcConnString.value,'\nDB_NAME=',variables('artDBname'),'\nDB_ADMIN_USER=',variables('db_user'),'\nDB_ADMIN_PASSWD=',variables('db_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'),'\nJOIN_KEY=',variables('joinKey'),'\nIS_PRIMARY=','false','\nLICENSE1=',variables('artifactoryLicense1'),'\nLICENSE2=',variables('artifactoryLicense2'),'\nLICENSE3=',variables('artifactoryLicense3'),'\nLICENSE4=',variables('artifactoryLicense4'),'\nLICENSE5=',variables('artifactoryLicense5'),'\n'))]"
},
"networkProfile": {
"networkInterfaceConfigurations": [

View File

@@ -0,0 +1,68 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"value": "rtha"
},
"adminUsername": {
"value": "vmuser"
},
"adminPassword": {
"value": "password"
},
"db_type": {
"value": "Postgresql_deploy.json"
},
"db_user": {
"value": "artifactory"
},
"db_password": {
"value": "password"
},
"db_name": {
"value": "artdb"
},
"db_edition": {
"value": "Basic"
},
"databases": {
"value": {
"properties": [
{
"name": "artdb",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
},
"manual_db_url": {
"value": "jdbc:postgresql://postgressrvr.postgres.database.azure.com:5432"
},
"db_server": {
"value": "postgressrvr"
},
"masterKey": {
"value": "GENERATE_MASTER_KEY"
},
"joinKey": {
"value": "GENERATE_JOIN_KEY"
},
"certificate": {
"value": "-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----"
},
"certificateKey": {
"value": "-----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----"
},
"artifactoryLicense1": {
"value": ""
},
"artifactoryLicense2": {
"value": ""
},
"artifactoryLicense3": {
"value": ""
}
}
}

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

View File

@@ -1,54 +1,54 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"type": "string",
"minLength": 1,
"defaultValue": "artifactory"
"defaultValue": "artifactory",
"minLength": 1
},
"db_password": {
"type": "securestring",
"defaultValue": "jFrog123"
"type": "securestring"
},
"db_server": {
"type": "string",
"minLength": 1,
"defaultValue": "artmssqlsrv"
"defaultValue": "artmssqlsrv",
"minLength": 1
},
"db_name": {
"type": "string",
"minLength": 1,
"defaultValue": "artdb"
"defaultValue": "artdb",
"minLength": 1
},
"db_location": {
"type": "string",
"defaultValue": ""
"type": "string"
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
"apiVersion": "2015-05-01-preview",
"rtdbCollation": "Latin1_General_100_CS_AS",
"db_location": "[if(equals(parameters('db_location'), ''), resourceGroup().location, parameters('db_location'))]"
"rtdbCollation": "Latin1_General_100_CS_AS"
},
"resources": [
{
"name": "[parameters('db_server')]",
"type": "Microsoft.Sql/servers",
"kind": "v12.0",
"location": "[variables('db_location')]",
"apiVersion": "[variables('apiVersion')]",
"dependsOn": [
],
"location": "[parameters('db_location')]",
"apiVersion": "2020-02-02-preview",
"tags": {
"displayName": "artifactoryDB"
},
@@ -61,10 +61,10 @@
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallrules",
"location": "[variables('db_location')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[parameters('db_location')]",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('db_server'))]"
"[resourceId('Microsoft.Sql/servers/', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
@@ -75,8 +75,8 @@
"name": "[parameters('db_name')]",
"type": "databases",
"kind": "v12.0,user",
"location": "[variables('db_location')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[parameters('db_location')]",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[parameters('db_server')]"
],
@@ -95,7 +95,15 @@
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:sqlserver://', reference(concat('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
"value": "[concat('jdbc:sqlserver://', reference(resourceId('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
},
"dbUrl": {
"type": "string",
"value": "[parameters('manual_db_url')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
}
}
}

View File

@@ -0,0 +1,76 @@
{
"$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": "mssqlsrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artdb",
"minLength": 1
},
"db_location": {
"type": "string"
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
],
"outputs": {
"db_user": {
"type": "string",
"value": "[parameters('db_user')]"
},
"db_server": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_name": {
"type": "string",
"value": "[parameters('db_name')]"
},
"db_location": {
"type": "string",
"value": "[parameters('db_location')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
},
"dbUrl": {
"type": "string",
"value": "[parameters('manual_db_url')]"
}
}
}

View File

@@ -0,0 +1,178 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"type": "string",
"defaultValue": "xray",
"minLength": 1
},
"db_password": {
"type": "securestring"
},
"db_server": {
"type": "string",
"defaultValue": "xraypostgressrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artrtdb",
"minLength": 1
},
"db_location": {
"type": "string"
},
"skuCapacity": {
"type": "int",
"defaultValue": 2
},
"skuFamily": {
"type": "string",
"defaultValue": "Gen5"
},
"skuName": {
"type": "string",
"defaultValue": "GP_Gen5_2"
},
"skuSizeMB": {
"type": "int",
"defaultValue": 5120
},
"skuTier": {
"type": "string",
"defaultValue": "GeneralPurpose"
},
"version": {
"type": "string",
"defaultValue": "9.6"
},
"backupRetentionDays": {
"type": "int",
"defaultValue": 7
},
"geoRedundantBackup": {
"type": "string",
"defaultValue": "Disabled"
},
"databases": {
"type": "object"
},
"sslEnforcement": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Disabled",
"metadata": {
"description": "SSL Enforcement"
}
},
"publicNetworkAccess": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Enabled",
"metadata": {
"description": "Public Network Access"
}
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"name": "[parameters('db_server')]",
"properties": {
"version": "[parameters('version')]",
"administratorLogin": "[parameters('db_user')]",
"administratorLoginPassword": "[parameters('db_password')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"sslEnforcement": "[parameters('sslEnforcement')]",
"storageProfile": {
"storageMB": "[parameters('skuSizeMB')]",
"backupRetentionDays": "[parameters('backupRetentionDays')]",
"geoRedundantBackup": "[parameters('geoRedundantBackup')]"
}
},
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('skuCapacity')]",
"size": "[parameters('skuSizeMB')]",
"family": "[parameters('skuFamily')]"
},
"resources": [
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallRules",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/databases",
"apiversion": "2017-12-01",
"name": "[concat(parameters('db_server'), '/', parameters('databases').properties[0].name)]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"charset": "[parameters('databases').properties[0].charset]",
"collation": "[parameters('databases').properties[0].collation]"
}
}
]
}
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:postgresql://', reference(resourceId('Microsoft.DBforPostgreSQL/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':5432')]"
},
"dbServerName": {
"type": "string",
"value": "[parameters('db_server')]"
},
"xrayConnString": {
"type": "string",
"value": "[concat('postgres://', reference(resourceId('Microsoft.DBforPostgreSQL/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':5432')]"
},
"db_name": {
"type": "string",
"value": "[parameters('db_name')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"dbUrl": {
"type": "string",
"value": "[parameters('manual_db_url')]"
}
}
}

View File

@@ -0,0 +1,76 @@
{
"$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": "xraypostgressrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "artdb",
"minLength": 1
},
"db_location": {
"type": "string"
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[parameters('manual_db_url')]"
},
"db_user": {
"type": "string",
"value": "[parameters('db_user')]"
},
"db_server": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_name": {
"type": "string",
"value": "[parameters('db_name')]"
},
"db_location": {
"type": "string",
"value": "[parameters('db_location')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
}
}
}

View File

@@ -1,27 +1,33 @@
#!/bin/bash
# Script stdout and stderr are stored in /var/lib/waagent/custom-script/download on the VM
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_TYPE=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_TYPE=" | sed "s/DB_TYPE=//")
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=//")
CERTIFICATE=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//")
CERTIFICATE_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_KEY=" | sed "s/CERTIFICATE_KEY=//")
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"
# Install Postgresql driver
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/postgresql-9.4.1212.jar https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar >> /tmp/install-databse-driver.log 2>&1
CERTIFICATE_DOMAIN=$(cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_DOMAIN=" | sed "s/CERTIFICATE_DOMAIN=//")
[ -z "$CERTIFICATE_DOMAIN" ] && CERTIFICATE_DOMAIN=artifactory
@@ -73,6 +79,8 @@ cat <<EOF >/etc/nginx/nginx.conf
}
EOF
if [[ -n "${CERTIFICATE}" ]] || [[ -n "${CERTIFICATE_KEY}" ]]; then
cat <<EOF >/etc/nginx/conf.d/artifactory.conf
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/pki/tls/certs/cert.pem;
@@ -113,7 +121,44 @@ server {
}
}
EOF
else
cat <<EOF >/etc/nginx/conf.d/artifactory.conf
## server configuration
server {
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
fi
mkdir -p /opt/jfrog/artifactory/var/etc/artifactory/
cat <<EOF >/opt/jfrog/artifactory/var/etc/artifactory/artifactory.cluster.license
@@ -147,11 +192,13 @@ 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
if [[ $DB_TYPE =~ "MSSQL" ]]; then
# 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
## Example for mssql
type: mssql
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: ${DB_URL};databaseName=${DB_NAME};sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository
@@ -159,10 +206,23 @@ cat <<EOF >>/var/opt/jfrog/artifactory/etc/system.yaml
password: ${DB_PASSWORD}
EOF
elif [[ $DB_TYPE =~ "Postgresql" ]]; then
# Set Postgresql settings (add if/else for Postgres/MSSQL) ATTENTION - RT VM 7.5.5 doesn't have Postgres driver!!
cat <<EOF >>/var/opt/jfrog/artifactory/etc/system.yaml
## One of: mysql, oracle, mssql, postgresql, mariadb
## Default: Embedded derby
## Example for postgresql
type: postgresql
driver: org.postgresql.Driver
url: ${DB_URL}/${DB_NAME}
username: ${DB_USER}
password: ${DB_PASSWORD}
EOF
fi
# 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
@@ -182,21 +242,26 @@ cat <<EOF >/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml
</config>
EOF
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE=" | sed "s/CERTIFICATE=//" > /tmp/temp.pem
if [[ -n "${CERTIFICATE}" ]] || [[ -n "${CERTIFICATE_KEY}" ]]; then
cat <<EOF >/tmp/temp.pem
${CERTIFICATE}
EOF
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
cat /var/lib/cloud/instance/user-data.txt | grep "^CERTIFICATE_KEY=" | sed "s/CERTIFICATE_KEY=//" > /tmp/temp.key
cat <<EOF >/tmp/temp.key
${CERTIFICATE_KEY}
EOF
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
rm /tmp/temp.key
fi
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
sleep 120
systemctl start artifactory
systemctl start nginx
nginx -s reload
echo "INFO: Artifactory HA installation completed."
echo ""

View File

@@ -5,9 +5,9 @@ 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
./install_artifactory.sh
echo "\ninstall_artifactory.sh was selected" >> user-data.txt
else
sh install_artifactory7.sh
./install_artifactory7.sh
echo "\ninstall_artifactory7.sh was selected" >> user-data.txt
fi

View File

@@ -0,0 +1,51 @@
#!/bin/bash
# Upgrade version for every release
ARTIFACTORY_VERSION=7.7.3
UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//")
export DEBIAN_FRONTEND=noninteractive
# install the wget and curl
apt-get update
apt-get -y install wget curl>> /tmp/install-curl.log 2>&1
#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"
# install the Artifactory PRO and Nginx
echo "deb https://jfrog.bintray.com/artifactory-pro-debs ${UBUNTU_CODENAME} main" | tee -a /etc/apt/sources.list
curl --retry 5 https://bintray.com/user/downloadSubjectPublicKey?username=jfrog | apt-key add -
apt-get update
apt-get -y install nginx>> /tmp/install-nginx.log 2>&1
apt-get -y install jfrog-artifactory-pro=${ARTIFACTORY_VERSION} >> /tmp/install-artifactory.log 2>&1
# Add callhome metadata (allow us to collect information)
mkdir -p /var/opt/jfrog/artifactory/etc/info
cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json
{
"productId": "ARM_artifactory-pro/1.0.0",
"features": [
{
"featureId": "Partner/ACC-007221"
}
]
}
EOF
#Install database drivers (for Java 11, path is different for RT6 and RT7)
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/mysql-connector-java-5.1.38.jar https://bintray.com/artifact/download/bintray/jcenter/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar >> /tmp/install-databse-driver.log 2>&1
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/mssql-jdbc-7.4.1.jre11.jar https://bintray.com/artifact/download/bintray/jcenter/com/microsoft/sqlserver/mssql-jdbc/7.4.1.jre11/mssql-jdbc-7.4.1.jre11.jar >> /tmp/install-databse-driver.log 2>&1
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/postgresql-9.4.1212.jar https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar >> /tmp/install-databse-driver.log 2>&1
#Configuring nginx
rm /etc/nginx/sites-enabled/default
printf "\nartifactory.ping.allowUnauthenticated=true" >> /var/opt/jfrog/artifactory/etc/artifactory/artifactory.system.properties
chown artifactory:artifactory -R /var/opt/jfrog/artifactory/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/*
# Remove Artifactory service from boot up run
systemctl disable artifactory
systemctl disable nginx

View File

@@ -78,11 +78,10 @@
"label": "Virtual machine size",
"toolTip": "The size of the virtual machine for JFrog Container Registry",
"recommendedSizes": [
"Standard_A2_v2"
"Standard_D2s_v3"
],
"constraints": {
"allowedSizes": [
"Standard_A2_v2",
"Standard_A4_v2",
"Standard_A4",
"Standard_D2s_v3",
@@ -102,7 +101,7 @@
"name": "artifactoryVersion",
"type": "Microsoft.Common.DropDown",
"label": "JFrog Container Registry-vm image version to deploy.",
"defaultValue": "7.4.3",
"defaultValue": "7.7.3",
"toolTip": "Version of JFrog Container Registry to deploy",
"constraints": {
"allowedValues": [
@@ -117,6 +116,10 @@
{
"label": "7.4.3",
"value": "7.4.3"
},
{
"label": "7.7.3",
"value": "0.0.2"
}
],
"required": true
@@ -133,7 +136,7 @@
"toolTip": "Master key for JFrog Container Registry cluster. Generate master.key using command '$openssl rand -hex 16'",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,32}$",
"regex": "^[a-z0-9A-Z]{12,32}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-32 characters long."
},
"options": {

View File

@@ -4,7 +4,7 @@
"parameters": {
"vmSku": {
"type": "string",
"defaultValue": "Standard_A2_v2",
"defaultValue": "Standard_D2s_v3",
"metadata": {
"description": "Size of VMs in the VM Scale Set."
}
@@ -25,11 +25,12 @@
},
"artifactoryVersion": {
"type": "string",
"defaultValue": "7.4.3",
"defaultValue": "0.0.2",
"allowedValues": [
"7.2.1",
"7.3.2",
"7.4.3"
"7.4.3",
"0.0.2"
],
"metadata": {
"description": "JFrog Container Registry-vm image version to deploy."
@@ -213,7 +214,7 @@
"type": "Microsoft.Network/networkSecurityGroups",
"location": "[parameters('location')]",
"name": "[variables('nsgName')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"securityRules": [
{
@@ -293,9 +294,9 @@
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"addressSpace": {
@@ -317,14 +318,14 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-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'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"ipConfigurations": [
@@ -350,7 +351,7 @@
"sku": {
"name": "Standard"
},
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"publicIPAllocationMethod": "Static",
"dnsSettings": {
@@ -362,12 +363,12 @@
"type": "Microsoft.Network/loadBalancers",
"name": "[variables('lbName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"sku": {
"name": "Standard"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]"
],
"tags":{
"displayName": "Load Balancer"
@@ -468,7 +469,7 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
@@ -484,7 +485,7 @@
{
"type": "Microsoft.Resources/deployments",
"name": "deploySQLDB",
"apiVersion": "2018-07-01",
"apiVersion": "2019-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
@@ -519,10 +520,10 @@
"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'))]"
"[resourceId('Microsoft.Network/loadBalancers/', variables('lbName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Resources/deployments/', 'deploySQLDB')]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
],
"plan": {
"name": "artifactory-jcr",

View File

@@ -43,7 +43,7 @@
"type": "Microsoft.Sql/servers",
"kind": "v12.0",
"location": "[variables('db_location')]",
"apiVersion": "2019-06-01-preview",
"apiVersion": "2020-02-02-preview",
"tags": {
"displayName": "artifactoryDB"
},
@@ -57,9 +57,9 @@
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallrules",
"location": "[variables('db_location')]",
"apiVersion": "2019-06-01-preview",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('db_server'))]"
"[resourceId('Microsoft.Sql/servers/', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
@@ -71,7 +71,7 @@
"type": "databases",
"kind": "v12.0,user",
"location": "[variables('db_location')]",
"apiVersion": "2019-06-01-preview",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[parameters('db_server')]"
],
@@ -90,7 +90,7 @@
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:sqlserver://', reference(concat('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
"value": "[concat('jdbc:sqlserver://', reference(resourceId('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
}
}
}

View File

@@ -4,7 +4,7 @@
"parameters": {
"vmSku": {
"type": "string",
"defaultValue": "Standard_A2_v2",
"defaultValue": "Standard_D2s_v3",
"metadata": {
"description": "Size of VMs in the VM Scale Set."
}
@@ -25,19 +25,19 @@
},
"artifactoryVersion": {
"type": "string",
"defaultValue": "7.4.3",
"defaultValue": "0.0.2",
"allowedValues": [
"7.2.1",
"7.3.2",
"7.4.3"
"7.4.3",
"0.0.2"
],
"metadata": {
"description": "JFrog Container Registry-vm image version to deploy."
}
},
"masterKey": {
"type": "string",
"defaultValue": "1ce2be4490ca2c662cb79636cf9b7b8e",
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Master key for JFrog Container Registry cluster. Generate master.key using command '$openssl rand -hex 16'"
@@ -56,15 +56,13 @@
}
},
"certificate": {
"type": "string",
"defaultValue": "-----BEGIN CERTIFICATE----- MIIFhzCCA2+gAwIBAgIJALC4r5BQWZE4MA0GCSqGSIb3DQEBCwUAMFoxCzAJBgNV BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRMwEQYDVQQHDApTYW50YUNsYXJh MQswCQYDVQQKDAJJVDEUMBIGA1UEAwwLKi5sb2NhbGhvc3QwHhcNMTgwMTE3MTk0 NjI4WhcNMTkwMTA4MTk0NjI4WjBaMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2Fs aWZvcm5pYTETMBEGA1UEBwwKU2FudGFDbGFyYTELMAkGA1UECgwCSVQxFDASBgNV BAMMCyoubG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA 7KfOWDQlov8cMa8r/lcJqiWZaH9myQC74Vbe0HXsntQbcvljkjG2P7ebm5dd9Bzc sauNOJpbKf5AhFK1iwJUAkciGc1LR4k8wfWmQM3NPS8hrqrtH20zqNpdFRpNYjja JofwccPNm030GhhZkZ95TpruvmswMDwspl3jfqdcc/eiQsHcKyGnV2a+UAeoqe7J mHhmhRy1MLqAjF5U1GrUYUONA+22iRDJb4c9B91QoWvsnXpdA9NKV/mmA3/rIdx6 Ld2IPRdrIw2K5sAnXsh3bx2oCSvSfussf0x+4XDrnsaHVfjwvfNL8ECOuac2Oi/E WOp9528gOohpFAuwEt63Vl5p8/CC9m0HJDTZBKm2l5eD1kdPIj4PvP9Sn9CxGXKQ E1bxWoFxGX8EyRW0b0NK31N7b8JPZ1SoFNiB5amOMNLvR26a7cQrKumTuJeYK9Ja JaxhMXM7R0DA0Ev8ZG2xmyCygox+1KPSmJOIEpT70BFbj3rKLNqP22ET+zvPuh+2 DdgyrpHFeYkGWjMbWPjK7wJsD2zM8ccoJQfepPz8I4rT0JfrKAQgCGuGOggneaNJ KTVGNOFbj5AXdZ/Q+GvNommyRdq4J7EnqY6L+P25fo5qZ6UZ/iS0tPcvxgn0Fdhs pUPbQyQIDZyxZd3Q1lUIE38ol8P66mS2zbzf8EeOCoUCAwEAAaNQME4wHQYDVR0O BBYEFETAQM/5P7XJ8kevHFj6BPndQOFaMB8GA1UdIwQYMBaAFETAQM/5P7XJ8kev HFj6BPndQOFaMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAJ1TepKv LWYhFmVQcgZwZf/qt1a1cohzJSm6da9RCnnAWC7WC/U117bgSomtrH1v0OysHFhB zBBUeBqI7+OmzAX8dhj+roKkcnFUM/IwlK1eueIIA//CWvEf/o0XExilVS2yCc9d PTpOQBXwk9QinxK36kHdBiGxa7dW0JPnOEEmuMgGORKeLy4J6Ik8iSeFY1SZVcOI +6WWvoKciPlmIeccC+6YVmkeBwhP2o5r5w/UAaO2hSnGvmm4UIj/VJv4VQu7xTUp cIfFz5NtIr80DbqcyPiEMS2ETJ4L/kO4MS5FfeEXyQuXCzmiIDVY6tE3C7+kZmK4 JzPLuWm9ndQoyQySOGfQqvlUR1+YxUdvmu3LrOS5dOA354Q36wHa4wEGUoHU/7GV fYQmmmDSDaNSpXW5PFey6scFyDBS/yYJ0H9EjYb/11HeWYj8Yv5xTWj8nhzJONC8 D6Y5ydlU4PifM2pOf88pTYpmogNwLJWXbql5I9cvMa8APo4yLVqcISU5ynsvFke+ Non+T0mHpJai/hrA9NK+s6EGC1dAX58jy61h6FhOPI1d4s/mov/KMa2t3SfZp5SF 81aR6dHvO56teiK5M1xMkrqG75zh3TMFJJLRFe9XxeB4JeN76URB3mgADOUqkBxd ibSgVqfKwOw4IujEcqMUc5mqSnbLY1Dv+oby -----END 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": "string",
"defaultValue": "-----BEGIN PRIVATE KEY----- MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDsp85YNCWi/xwx ryv+VwmqJZlof2bJALvhVt7Qdeye1Bty+WOSMbY/t5ubl130HNyxq404mlsp/kCE UrWLAlQCRyIZzUtHiTzB9aZAzc09LyGuqu0fbTOo2l0VGk1iONomh/Bxw82bTfQa GFmRn3lOmu6+azAwPCymXeN+p1xz96JCwdwrIadXZr5QB6ip7smYeGaFHLUwuoCM XlTUatRhQ40D7baJEMlvhz0H3VCha+ydel0D00pX+aYDf+sh3Hot3Yg9F2sjDYrm wCdeyHdvHagJK9J+6yx/TH7hcOuexodV+PC980vwQI65pzY6L8RY6n3nbyA6iGkU C7AS3rdWXmnz8IL2bQckNNkEqbaXl4PWR08iPg+8/1Kf0LEZcpATVvFagXEZfwTJ FbRvQ0rfU3tvwk9nVKgU2IHlqY4w0u9HbprtxCsq6ZO4l5gr0lolrGExcztHQMDQ S/xkbbGbILKCjH7Uo9KYk4gSlPvQEVuPesos2o/bYRP7O8+6H7YN2DKukcV5iQZa MxtY+MrvAmwPbMzxxyglB96k/PwjitPQl+soBCAIa4Y6CCd5o0kpNUY04VuPkBd1 n9D4a82iabJF2rgnsSepjov4/bl+jmpnpRn+JLS09y/GCfQV2GylQ9tDJAgNnLFl 3dDWVQgTfyiXw/rqZLbNvN/wR44KhQIDAQABAoICAQDm1pAp7UPBCELCG/I3t0KQ GvjWu17RNcwN86SHhl92VcMolSaQ1bjF0h0Q2ccldHm5PHMWAUpnXcAk0mCO5Yh4 aFZVALEraCxBrZGrqJNH2Q9rxwJhIy2+yLD/Apb09iukZfkdnzaRBKrUQWgs6Xd0 OyAh0YBBrJCI/xAG3M0LuUMnBt3xnHQUhv2gJrhYeble5iJqOSRsEZ+OS/1G7aWX 8kI80MS6UguKpEndv/0EV7eHrHHKZ3Ee+z76Lu52Kw9qaaqYnJ0+pdkVV92PUM9f LXhY6cv7TP4sdbtVv8W1LEWakKaTQhySjwYpBXeZrjpB2QlSlEzFi4WjrfrjjSca UZazm/jY5uDI2cXf35NyZUkbYxIKlGtURtDpoPp5R7XguHSoqLrh2Zsc79mZfNST zFwbhNBVB2nAl6ZyIRNFLjVhQScvlImpIVSVZm5/NiiABIEaxRh8w8C5qRMctSTy KF6rS6as2KsPQHpiu/6nDMqqTZ8UMQ3yXEpai5VwAzKFP67usHheKf4RIXNUn7Xc JxWiI8KfOV5n4cSJK1/R+i+ZpWyQiloao4v7GS/fwZTsILeBLBa0utDmNs5aJgVK cEagRjVGAeAEc2W+jXmSqtZRHQowJmEKOARMn4lI+duziSCjIfPH6xIDAUhVlc/K u03432NupfPepW6BYVBgQQKCAQEA/+CD2uiRZgmzuEn/vn/u7jGFjETdUQmfl5kX pMTtueXyQxHBRwBCZqq885doozeQd7mLRcW+klngq1NmnEnjx+NfUzFJLpEmQO1/ AMHUpYpZY4jOyntx9cBy+M+DUfNtdsJUz+VOe3HO5/lJJf+gSgpVp2ku1oOrgEeH a71aGIXOsiOQ/fHL4Q0CuylersD5Dq4Tdf/u6rr4NbwOZQCQ9WH0uTckA9SkjJFu iHXblg8j9RUNbj89WPrEulKA98duFuLvGTeohcAPQ8f60Z7sxDLGLRyRvhUO4EBr hTTmcfI2LsPWSo+X+n6eBqfUfGZub2qN+d2B08qKgnGdgFEf6QKCAQEA7MTtAphl lswq4kPvDkPHMqJhmPBgb5NAUzE2Z8yjJY3IX6zxinSDnuMwEzCinKe7rzv6aYIh klviND/oyLOxVlLESZu62epokgIey05sv9a/030z7q5hradNzcMP1VfGVs6IeOvr 3Kit4T7LI1L2eXwD1Yks6uHHw8lHAlyrrlbwCEmzqElKs0YtkvNa4HFgesFNnObe f8C29LOPZMqje7iAT91823MGI9NML9qGYON/ZLc4uCB9no+o6ZOTQHqX1xxSWv5D 66KGiRnUC/RAq6RbTVn3NxFgvb3k0rejbQbxW5KCri1E4sTw+pZ5bIRUJcXi+J+Z Tg88lVbmqXfwPQKCAQEA94yShDr0UC+au/R7hCXpVnB6r5YAN+KDj/sAsNwE0hDx LIoE31gU5ZbRbylQhne/QNU1NK93C8gAYEAzyYiC4mPLWYUZNAAhbjdW47iirfUH PhChX6vGOOeTU7wPZD2J7ZdczjUelLcqYar/Zc/Fl1wgOfK86bRBO733+fgbLhZm PlnCcKx5fqVDuybu/0qaqeUn1sVgs59nezURCA5gL8YxKO973GjhOU2KDmNXqfnD 49wWPk7YXzldEpW3SACdNW8futnqJFwHaKAUvLBwh/BHYmV9atScq8AnRZxERoD6 govcyg3aDvJomC/OlvvSY+BGszHl5KzTDBg3NGlH4QKCAQA/71lU5xQfqVg3K0MF ZhYHPUP/iYFw/6FSFarsUp0Higa+lzPOQHI+WHjl5a8zgDO1OQwAq6wnGnq1w0A3 2hYcClOI0O2e5KaCLuJj4fSJxRKdqGR6okosG05uLqs63+3mCPVfOc3CEyaI+Wzf SArYeT2LzvP7JSbNXq+3GpEdjcpZYpWJ7uimCmBKGz7B9runykUMBme0tbRx1X72 J6YHxaWYa2XI2IGi8O7UyTyaMzR2XOeLCPMC+yYQlNIhijkwVCyE974dhhCwOvJA nB9Oeh5Rf+a6zw2BjyKYKBCQY1yPbrutDvpYBfhQoot9Wyph3NLScj5yjri8VvAI eSO9AoIBAQDyUx5YUgHgpoJtRZ+8PGQBZHm5L5HJhvfUs96I9Z4lZSXnCmEJyOWn LIob8c0n4hU1EXdbbl+7eRQgG3oGKyF0XXhuaP3vHprIBW6tm9kCGORTliZOaZdW 0Mj9GUv2de1r8anwJMFvIMXsuO08rsGzsIt7DrNYa0YSMkeDwPenRfDHXOYH2fjf RKjlP3fQr/iLL/YuMGaNxzIeyWPZ2WTUUC0bllNxMTZmztuMkPNb7fhhs0hLecXM fE2nbwUaGwMZaails1+5G3HvEAlChJ1GN9XnYxrtfqq93tYELWBiNcv1LaMAFvj8 S+j1+iUKGGhwVmhqh75q5do3+VF3XlAh -----END PRIVATE KEY-----",
"type": "securestring",
"metadata": {
"description": "Provide your SSL Certificate key"
}
@@ -144,7 +142,7 @@
"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/JFrogDev/JFrog-Cloud-Installers/refactoring-rt7/JFrogContainerRegistry/AzureResourceManager/"
"defaultValue": "https://raw.githubusercontent.com/jfrog/JFrog-Cloud-Installers/master/AzureResourceManager/JCR/"
},
"_artifactsLocationSasToken": {
"type": "securestring",
@@ -190,7 +188,7 @@
"osType": {
"publisher": "jfrog",
"offer": "jfrogcontainerregistry-vm",
"sku": "artifactory-jcr-private",
"sku": "artifactory-jcr",
"version": "[parameters('artifactoryVersion')]"
},
"imageReference": "[variables('osType')]",
@@ -216,7 +214,7 @@
"type": "Microsoft.Network/networkSecurityGroups",
"location": "[parameters('location')]",
"name": "[variables('nsgName')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"securityRules": [
{
@@ -296,9 +294,9 @@
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"addressSpace": {
@@ -320,14 +318,14 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-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'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]"
],
"properties": {
"ipConfigurations": [
@@ -353,7 +351,7 @@
"sku": {
"name": "Standard"
},
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"properties": {
"publicIPAllocationMethod": "Static",
"dnsSettings": {
@@ -365,12 +363,12 @@
"type": "Microsoft.Network/loadBalancers",
"name": "[variables('lbName')]",
"location": "[parameters('location')]",
"apiVersion": "2018-07-01",
"apiVersion": "2020-03-01",
"sku": {
"name": "Standard"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]"
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('pipPrimaryName'))]"
],
"tags":{
"displayName": "Load Balancer"
@@ -471,7 +469,7 @@
}
},
{
"apiVersion": "2018-07-01",
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
@@ -487,7 +485,7 @@
{
"type": "Microsoft.Resources/deployments",
"name": "deploySQLDB",
"apiVersion": "2018-07-01",
"apiVersion": "2019-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
@@ -522,13 +520,13 @@
"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'))]"
"[resourceId('Microsoft.Network/loadBalancers/', variables('lbName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Resources/deployments/', 'deploySQLDB')]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
],
"plan": {
"name": "artifactory-jcr-private",
"name": "artifactory-jcr",
"publisher": "jfrog",
"product": "jfrogcontainerregistry-vm"
},

View File

@@ -21,7 +21,13 @@
"value": "GEN-UNIQUE"
},
"masterKey": {
"value": "35767fa0164bac66b6cccb8880babefb"
"value": "GENERATE_MASTER_KEY"
},
"certificate": {
"value": "-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----"
},
"certificateKey": {
"value": "-----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----"
}
}
}

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

View File

@@ -43,7 +43,7 @@
"type": "Microsoft.Sql/servers",
"kind": "v12.0",
"location": "[variables('db_location')]",
"apiVersion": "2019-06-01-preview",
"apiVersion": "2020-02-02-preview",
"tags": {
"displayName": "artifactoryDB"
},
@@ -57,9 +57,9 @@
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallrules",
"location": "[variables('db_location')]",
"apiVersion": "2019-06-01-preview",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('db_server'))]"
"[resourceId('Microsoft.Sql/servers/', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
@@ -71,7 +71,7 @@
"type": "databases",
"kind": "v12.0,user",
"location": "[variables('db_location')]",
"apiVersion": "2019-06-01-preview",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[parameters('db_server')]"
],
@@ -90,7 +90,7 @@
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:sqlserver://', reference(concat('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
"value": "[concat('jdbc:sqlserver://', reference(resourceId('Microsoft.Sql/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':1433')]"
}
}
}

View File

@@ -0,0 +1,51 @@
#!/bin/bash
# Upgrade version for every release
ARTIFACTORY_VERSION=7.7.3
UBUNTU_CODENAME=$(cat /etc/lsb-release | grep "^DISTRIB_CODENAME=" | sed "s/DISTRIB_CODENAME=//")
export DEBIAN_FRONTEND=noninteractive
# install the wget and curl
apt-get update
apt-get -y install wget curl>> /tmp/install-curl.log 2>&1
#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"
# install the Artifactory JCR and Nginx
echo "deb https://jfrog.bintray.com/artifactory-debs ${UBUNTU_CODENAME} main" | tee -a /etc/apt/sources.list
curl --retry 5 https://bintray.com/user/downloadSubjectPublicKey?username=jfrog | apt-key add -
apt-get update
apt-get -y install nginx>> /tmp/install-nginx.log 2>&1
apt-get -y install jfrog-artifactory-jcr=${ARTIFACTORY_VERSION} >> /tmp/install-artifactory.log 2>&1
# Add callhome metadata (allow us to collect information)
mkdir -p /var/opt/jfrog/artifactory/etc/info
cat <<EOF >/var/opt/jfrog/artifactory/etc/info/installer-info.json
{
"productId": "ARM_artifactory-jcr/1.0.0",
"features": [
{
"featureId": "Partner/ACC-007221"
}
]
}
EOF
#Install database drivers (for Java 11, path is different for RT6 and RT7)
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/mysql-connector-java-5.1.38.jar https://bintray.com/artifact/download/bintray/jcenter/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar >> /tmp/install-databse-driver.log 2>&1
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/mssql-jdbc-7.4.1.jre11.jar https://bintray.com/artifact/download/bintray/jcenter/com/microsoft/sqlserver/mssql-jdbc/7.4.1.jre11/mssql-jdbc-7.4.1.jre11.jar >> /tmp/install-databse-driver.log 2>&1
curl --retry 5 -L -o /opt/jfrog/artifactory/app/artifactory/tomcat/lib/postgresql-9.4.1212.jar https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar >> /tmp/install-databse-driver.log 2>&1
#Configuring nginx
rm /etc/nginx/sites-enabled/default
printf "\nartifactory.ping.allowUnauthenticated=true" >> /var/opt/jfrog/artifactory/etc/artifactory/artifactory.system.properties
chown artifactory:artifactory -R /var/opt/jfrog/artifactory/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/*
# Remove Artifactory service from boot up run
systemctl disable artifactory
systemctl disable nginx

View File

@@ -0,0 +1,175 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"type": "string",
"defaultValue": "xray",
"minLength": 1
},
"db_password": {
"type": "securestring"
},
"db_server": {
"type": "string",
"defaultValue": "xraypostgressrv",
"minLength": 1
},
"db_name": {
"type": "string",
"defaultValue": "xrayrtdb",
"minLength": 1
},
"db_location": {
"type": "string",
"defaultValue": ""
},
"skuCapacity": {
"type": "int",
"defaultValue": 2
},
"skuFamily": {
"type": "string",
"defaultValue": "Gen5"
},
"skuName": {
"type": "string",
"defaultValue": "GP_Gen5_2"
},
"skuSizeMB": {
"type": "int",
"defaultValue": 5120
},
"skuTier": {
"type": "string",
"defaultValue": "GeneralPurpose"
},
"version": {
"type": "string",
"defaultValue": "9.6"
},
"backupRetentionDays": {
"type": "int",
"defaultValue": 7
},
"geoRedundantBackup": {
"type": "string",
"defaultValue": "Disabled"
},
"databases": {
"type": "object",
"defaultValue":
{
"name": "xray",
"charset": "UTF8",
"collation": "English_United States.1252"
}
},
"sslEnforcement": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Disabled",
"metadata": {
"description": "SSL Enforcement"
}
},
"publicNetworkAccess": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Enabled",
"metadata": {
"description": "Public Network Access"
}
}
},
"variables": {
"db_location": "[if(equals(parameters('db_location'), ''), resourceGroup().location, parameters('db_location'))]"
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"location": "[variables('db_location')]",
"name": "[parameters('db_server')]",
"properties": {
"version": "[parameters('version')]",
"administratorLogin": "[parameters('db_user')]",
"administratorLoginPassword": "[parameters('db_password')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"sslEnforcement": "[parameters('sslEnforcement')]",
"storageProfile": {
"storageMB": "[parameters('skuSizeMB')]",
"backupRetentionDays": "[parameters('backupRetentionDays')]",
"geoRedundantBackup": "[parameters('geoRedundantBackup')]"
}
},
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('skuCapacity')]",
"size": "[parameters('skuSizeMB')]",
"family": "[parameters('skuFamily')]"
},
"resources": [
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallRules",
"apiVersion": "2017-12-01",
"location": "[variables('db_location')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/databases",
"apiversion": "2017-12-01",
"name": "[concat(parameters('db_server'), '/', parameters('databases').properties[0].name)]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"charset": "[parameters('databases').properties[0].charset]",
"collation": "[parameters('databases').properties[0].collation]"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/databases",
"apiversion": "2017-12-01",
"name": "[concat(parameters('db_server'), '/', parameters('databases').properties[1].name)]",
"condition": "[greater(length(parameters('databases').properties), 0)]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"charset": "[parameters('databases').properties[1].charset]",
"collation": "[parameters('databases').properties[1].collation]"
}
}
]
}
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[concat('jdbc:postgresql://', reference(concat('Microsoft.DBforPostgreSQL/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':5432')]"
},
"dbServerName": {
"type": "string",
"value": "[parameters('db_server')]"
},
"xrayConnString": {
"type": "string",
"value": "[concat('postgres://', reference(concat('Microsoft.DBforPostgreSQL/servers/', parameters('db_server'))).fullyQualifiedDomainName, ':5432')]"
}
}
}

View File

@@ -0,0 +1,31 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"value": "DB-USERNAME"
},
"db_password": {
"value": "GENERATE-PASSWORD"
},
"db_server": {
"value": "DB-SERVERNSME"
},
"databases": {
"value": {
"properties": [
{
"name": "artdb",
"charset": "UTF8",
"collation": "English_United States.1252"
},
{
"name": "xray",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
}
}
}

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,323 @@
{
"$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": "vmCredential",
"label": "VM Credential",
"bladeTitle": "VM Credential",
"subLabel": {
"preValidation": "Provide VM credentials",
"postValidation": "Great - let's move on!"
},
"elements": [
{
"name": "virtualMachine",
"type": "Microsoft.Common.Section",
"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
}
],
"visible": true
},
{
"name": "vnet",
"type": "Microsoft.Network.VirtualNetworkCombo",
"toolTip": "Provide Virtual Network information",
"label": {
"virtualNetwork": "Virtual Network",
"subnets": "Subnets"
},
"defaultValue": {
"name": "vmx-vnet",
"addressPrefixSize": "/16"
},
"constraints": {
"minAddressPrefixSize": "/24"
},
"subnets": {
"subnet1": {
"label": "Subnet",
"defaultValue": {
"name": "vmx-subnet",
"addressPrefixSize": "/24"
},
"constraints": {
"minAddressPrefixSize": "/29",
"minAddressCount": 8,
"requireContiguousAddresses": true
}
}
}
},
{
"name": "vmSku",
"type": "Microsoft.Compute.SizeSelector",
"label": "Virtual machine size",
"toolTip": "The size of the virtual machine for Xray",
"recommendedSizes": [
"Standard_D4s_v3"
],
"constraints": {
"allowedSizes": [
"Standard_A4_v2",
"Standard_A4",
"Standard_D4s_v3",
"Standard_D8s_v3",
"Standard_D16s_v3",
"Standard_D32s_v3",
"Standard_DS3_v2",
"Standard_D3_v2",
"Standard_DC4s"
]
},
"osPlatform": "Linux",
"count": 1
}
]
},
{
"name": "xrayConfig",
"label": "Xray settings",
"subLabel": {
"preValidation": "Configure Xray Deployment",
"postValidation": "Done!"
},
"bladeTitle": "Xray Settings",
"elements": [
{
"name": "xrayVersion",
"type": "Microsoft.Common.DropDown",
"label": "Xray-vm image version to deploy.",
"defaultValue": "3.8.5",
"toolTip": "Version of Xray to deploy",
"constraints": {
"allowedValues": [
{
"label": "3.6.2",
"value": "0.0.3"
},
{
"label": "3.8.2",
"value": "0.0.4"
},
{
"label": "3.8.5",
"value": "0.0.5"
}
],
"required": true
},
"visible": true
},
{
"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": "masterKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Xray master Key",
"confirmPassword": "Confirm master Key"
},
"toolTip": "Master key for Xray instance. Generate master.key using command '$openssl rand -hex 16'",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{12,32}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-32 characters long."
},
"options": {
"hideConfirmation": true
}
},
{
"name": "joinKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Artifactory join Key",
"confirmPassword": "Confirm join Key"
},
"toolTip": "Join key from Artifactory cluster. You can copy Join key from the Artifactory UI, Security -> Settings -> Connection details",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{12,32}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-32 characters long."
},
"options": {
"hideConfirmation": true
}
},
{
"name": "artifactoryURL",
"type": "Microsoft.Common.TextBox",
"label": "Provide artifactory URL to connect Xray instance",
"defaultValue": "https://myorgartifactory.com",
"toolTip": "Provide Artifactory URL",
"constraints": {
"required": true,
"regex": "^(https?)://[^\\s/$.?#].[^\\s]*$",
"validationMessage": "URL is not valid"
}
}
]
},
{
"name": "databaseConfig",
"label": "Database Configuration",
"subLabel": {
"preValidation": "Configure the Database",
"postValidation": "Done"
},
"bladeTitle": "Database Credential",
"elements": [
{
"name": "infoMessage",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "You can deploy a new Postgresql server or use your existing Postgres server and database. Please make sure Postgresql instance is set up correctly before Xray deployment. Check README.md https://github.com/jfrog/JFrog-Cloud-Installers/blob/arm-xray/AzureResourceManager/Xray/README.md#postgresql-deployment. You can use Postgresql template from here https://github.com/jfrog/JFrog-Cloud-Installers/tree/arm-xray/AzureResourceManager/Postgresql"
}
},
{
"name": "db_type",
"type": "Microsoft.Common.DropDown",
"label": "Database options",
"toolTip": "Deploy a new DB instance or use an existing DB",
"constraints": {
"required": true,
"allowedValues": [
{
"label": "Deploy a new Postgresql instance",
"value": "Postgresql_deploy.json"
},
{
"label": "Use existing Postgresql instance",
"value": "Postgresql_existing.json"
}
]
},
"visible": true
},
{
"name": "db_server",
"type": "Microsoft.Common.TextBox",
"label": "Database server name. Skip if a new deployment is selected",
"toolTip": "Database server name",
"constraints": {
"required": false,
"regex": "^[a-z0-9A-Z]{1,15}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-15 characters long."
}
},
{
"name": "manual_db_url",
"type": "Microsoft.Common.TextBox",
"label": "Database connection string. Skip if a new deployment is selected",
"toolTip": "Jdbc connection string for MSSQL or Postgresql",
"constraints": {
"required": false,
"regex": "..*",
"validationMessage": "DB connection string is not valid"
}
},
{
"name": "db_user",
"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": "db_password",
"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
}
]
}
],
"outputs": {
"location": "[location()]",
"adminUsername": "[steps('vmCredential').virtualMachine.adminUsername]",
"adminPassword": "[steps('vmCredential').virtualMachine.adminPassword.password]",
"virtualNetworkName": "[steps('vmCredential').vnet.name]",
"virtualNetworkNewOrExisting": "[steps('vmCredential').vnet.newOrExisting]",
"virtualNetworkAddressPrefix": "[first(steps('vmCredential').vnet.addressPrefixes)]",
"virtualNetworkResourceGroup": "[steps('vmCredential').vnet.resourceGroup]",
"virtualMachineSize": "[steps('vmCredential').vmSku]",
"subnetName": "[steps('vmCredential').vnet.subnets.subnet1.name]",
"subnetAddressPrefix": "[steps('vmCredential').vnet.subnets.subnet1.addressPrefix]",
"xrayVersion": "[steps('xrayConfig').xrayVersion]",
"clusterName": "[steps('xrayConfig').clusterName]",
"artifactoryURL": "[steps('xrayConfig').artifactoryURL]",
"masterKey": "[steps('xrayConfig').masterKey]",
"joinKey": "[steps('xrayConfig').joinKey]",
"db_type": "[steps('databaseConfig').db_type]",
"db_server": "[steps('databaseConfig').db_server]",
"manual_db_url": "[steps('databaseConfig').manual_db_url]",
"db_user": "[steps('databaseConfig').db_user]",
"db_password": "[steps('databaseConfig').db_password]"
}
}
}

View File

@@ -0,0 +1,403 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for the resources."
}
},
"clusterName": {
"type": "string",
"defaultValue": "xray",
"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."
}
},
"xrayVersion": {
"type": "string",
"defaultValue": "0.0.5",
"allowedValues": [
"0.0.3",
"0.0.4",
"0.0.5"
],
"metadata": {
"description": "Xray-vm image version to deploy."
}
},
"artifactoryURL": {
"type": "string",
"metadata": {
"description": "Artifactory URL"
}
},
"masterKey": {
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Master key for Artifactory cluster. Generate master.key using command '$openssl rand -hex 16'"
}
},
"joinKey": {
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Join key for Artifactory cluster. Generate join.key using command '$openssl rand -hex 16'"
}
},
"adminUsername": {
"type": "string",
"defaultValue": "testadmin",
"metadata": {
"description": "Username for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"virtualNetworkName": {
"type": "string",
"metadata": {
"description": "New or Existing VNet Name"
}
},
"virtualNetworkNewOrExisting": {
"type": "string",
"metadata": {
"description": "Boolean indicating whether the VNet is new or existing"
}
},
"virtualNetworkAddressPrefix": {
"type": "string",
"metadata": {
"description": "VNet address prefix"
}
},
"virtualNetworkResourceGroup": {
"type": "string",
"metadata": {
"description": "Resource group of the VNet"
}
},
"virtualMachineSize": {
"type": "string",
"metadata": {
"description": "The size of the VM"
}
},
"subnetName": {
"type": "string",
"metadata": {
"description": "New or Existing subnet Name"
}
},
"subnetAddressPrefix": {
"type": "string",
"metadata": {
"description": "Subnet address prefix"
}
},
"db_type": {
"type": "string",
"defaultValue": "Postgresql_deploy.json",
"allowedValues": [
"Postgresql_deploy.json",
"Postgresql_existing.json"
],
"metadata": {
"description": "Deploy new Postgresql, MSSQL or use existing DB"
}
},
"manual_db_url": {
"type": "string",
"metadata": {
"description": "DB server URL, if existing DB server is used instead of a new deployment (jdbc:sqlserver://.. or jdbc:postgresql://..)"
}
},
"db_server": {
"type": "string",
"metadata": {
"description": "DB server name, if pre-existing DB is used"
}
},
"db_user": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Database Admin user name"
}
},
"db_password": {
"type": "securestring",
"minLength": 1,
"metadata": {
"description": "Database Admin password"
}
},
"databases": {
"type": "object",
"defaultValue": {
"properties": [
{
"name": "xray",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
},
"_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))]",
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'sawinvm')]",
"publicIPAddressName": "[concat(uniqueString(resourceGroup().id),'IP')]",
"clusterName": "[parameters('clusterName')]",
"nicName": "[concat(variables('clusterName'),'Nic')]",
"ipConfigName": "[concat(variables('namingInfix'), 'ipconfig')]",
"vnetId": {
"new": "[resourceId('Microsoft.Network/virtualNetworks',parameters('virtualNetworkName'))]",
"existing": "[resourceId(parameters('virtualNetworkResourceGroup'),'Microsoft.Network/virtualNetworks',parameters('virtualNetworkName'))]"
},
"subnetId": "[concat(variables('vnetId')[parameters('virtualNetworkNewOrExisting')],'/subnets/',parameters('subnetName'))]",
"publicIPAddressType": "Dynamic",
"db_server": "[parameters('db_server')]",
"db_user": "[concat(parameters('db_user'), '@', parameters('db_server'))]",
"actual_db_user": "[parameters('db_user')]",
"db_password": "[parameters('db_password')]",
"db_location": "[parameters('location')]",
"db_name": "[parameters('databases').properties[0].name]",
"masterKey": "[parameters('masterKey')]",
"joinKey": "[parameters('joinKey')]",
"osType": {
"publisher": "jfrog",
"offer": "x-ray-vm",
"sku": "x-ray-vm",
"version": "[parameters('xrayVersion')]"
},
"imageReference": "[variables('osType')]",
"dbTemplate": "[parameters('db_type')]",
"dbTemplateLocation": "[uri(parameters('_artifactsLocation'), concat('nested/', variables('dbTemplate'), parameters('_artifactsLocationSasToken')))]",
"artifactoryURL": "[parameters('artifactoryURL')]"
},
"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": []
}
}
},
{
"condition": "[equals(parameters('virtualNetworkNewOrExisting'),'new')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-05-01",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('virtualNetworkAddressPrefix')]"
]
},
"subnets": [
{
"name": "[parameters('subnetName')]",
"properties": {
"addressPrefix": "[parameters('subnetAddressPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('publicIPAddressName')]",
"apiVersion": "2020-05-01",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"apiVersion": "2020-05-01",
"location": "[parameters('location')]",
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
},
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
],
"enableIPForwarding": true
},
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]"
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-11-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"properties": {}
},
{
"type": "Microsoft.Resources/deployments",
"name": "deploySQLDB",
"apiVersion": "2019-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('dbTemplateLocation')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"db_user": {
"value": "[parameters('db_user')]"
},
"db_password": {
"value": "[variables('db_password')]"
},
"db_server": {
"value": "[variables('db_server')]"
},
"db_location": {
"value": "[variables('db_location')]"
},
"databases": {
"value": "[parameters('databases')]"
},
"manual_db_url": {
"value": "[parameters('manual_db_url')]"
}
}
}
},
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "[concat(variables('namingInfix'), 'xrayScaleset')]",
"location": "[parameters('location')]",
"apiVersion": "2018-10-01",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"plan": {
"name": "x-ray-vm",
"publisher": "jfrog",
"product": "x-ray-vm"
},
"sku": {
"name": "[parameters('virtualMachineSize')]",
"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\nXRAY_VERSION=', parameters('xrayVersion'),'\nARTIFACTORY_URL=',variables('artifactoryURL'),'\nDB_SERVER=',variables('db_server'),'\nDB_NAME=',variables('db_name'),'\nDB_ADMIN_USER=',variables('db_user'),'\nACTUAL_DB_ADMIN_USER=',variables('actual_db_user'),'\nDB_ADMIN_PASSWD=',variables('db_password'),'\nMASTER_KEY=',variables('masterKey'),'\nJOIN_KEY=',variables('joinKey'),'\n'))]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "[variables('nicName')]",
"properties": {
"primary": true,
"ipConfigurations": [
{
"name": "[concat(variables('ipConfigName'),'1')]",
"properties": {
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
]
}
}
]
},
"extensionProfile": {
"extensions": [
{
"name": "extension1",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": false,
"settings": {
"fileUris": [
"[uri(parameters('_artifactsLocation'), concat('scripts/install_xray.sh', parameters('_artifactsLocationSasToken')))]"
]
},
"protectedSettings": {
"commandToExecute": "./install_xray.sh >> /opt/installation_log1.txt"
}
}
}
]
}
}
}
}
]
}

View File

@@ -0,0 +1,161 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"type": "string",
"defaultValue": "xray",
"minLength": 1
},
"db_password": {
"type": "securestring"
},
"db_server": {
"type": "string",
"defaultValue": "xraypostgressrv",
"minLength": 1
},
"db_location": {
"type": "string"
},
"skuCapacity": {
"type": "int",
"defaultValue": 2
},
"skuFamily": {
"type": "string",
"defaultValue": "Gen5"
},
"skuName": {
"type": "string",
"defaultValue": "GP_Gen5_2"
},
"skuSizeMB": {
"type": "int",
"defaultValue": 5120
},
"skuTier": {
"type": "string",
"defaultValue": "GeneralPurpose"
},
"version": {
"type": "string",
"defaultValue": "9.6"
},
"backupRetentionDays": {
"type": "int",
"defaultValue": 7
},
"geoRedundantBackup": {
"type": "string",
"defaultValue": "Disabled"
},
"databases": {
"type": "object"
},
"sslEnforcement": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Disabled",
"metadata": {
"description": "SSL Enforcement"
}
},
"publicNetworkAccess": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Enabled",
"metadata": {
"description": "Public Network Access"
}
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"name": "[parameters('db_server')]",
"properties": {
"version": "[parameters('version')]",
"administratorLogin": "[parameters('db_user')]",
"administratorLoginPassword": "[parameters('db_password')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"sslEnforcement": "[parameters('sslEnforcement')]",
"storageProfile": {
"storageMB": "[parameters('skuSizeMB')]",
"backupRetentionDays": "[parameters('backupRetentionDays')]",
"geoRedundantBackup": "[parameters('geoRedundantBackup')]"
}
},
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('skuCapacity')]",
"size": "[parameters('skuSizeMB')]",
"family": "[parameters('skuFamily')]"
},
"resources": [
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallRules",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/databases",
"apiversion": "2017-12-01",
"name": "[concat(parameters('db_server'), '/', parameters('databases').properties[0].name)]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"charset": "[parameters('databases').properties[0].charset]",
"collation": "[parameters('databases').properties[0].collation]"
}
}
]
}
],
"outputs": {
"dbServerName": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"manual_db_url": {
"type": "string",
"value": "[parameters('manual_db_url')]"
}
}
}

View File

@@ -0,0 +1,54 @@
{
"$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": "xraypostgressrv",
"minLength": 1
},
"db_location": {
"type": "string"
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[parameters('manual_db_url')]"
},
"db_user": {
"type": "string",
"value": "[parameters('db_user')]"
},
"db_server": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_location": {
"type": "string",
"value": "[parameters('db_location')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
}
}
}

View File

@@ -0,0 +1,42 @@
#!/bin/bash
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=//")
ACTUAL_DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ACTUAL_DB_ADMIN_USER=" | sed "s/ACTUAL_DB_ADMIN_USER=//")
DB_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//")
DB_SERVER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_SERVER=" | sed "s/DB_SERVER=//")
MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//")
JOIN_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^JOIN_KEY=" | sed "s/JOIN_KEY=//")
ARTIFACTORY_URL=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_URL=" | sed "s/ARTIFACTORY_URL=//")
export DEBIAN_FRONTEND=noninteractive
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository ppa:rmescandon/yq -y
sudo apt update -y
sudo apt install yq -y
# Create master.key on each node
sudo mkdir -p /opt/jfrog/xray/var/etc/security/
cat <<EOF >/opt/jfrog/xray/var/etc/security/master.key
${MASTER_KEY}
EOF
# Xray should have the same join key as the Artifactory instance
# Both application should be deployed in the same Virtual Networks
HOSTNAME=$(hostname -i)
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.url postgres://${DB_SERVER}.postgres.database.azure.com:5432/${DB_NAME}?sslmode=disable
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.username ${DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.actualUsername ${ACTUAL_DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.password ${DB_PASSWORD}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.rabbitMq.password JFXR_RABBITMQ_COOKIE
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.jfrogUrl ${ARTIFACTORY_URL}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.security.joinKey ${JOIN_KEY}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.node.ip ${HOSTNAME}
chown xray:xray -R /opt/jfrog/xray/var/etc/security/* && chown xray:xray -R /opt/jfrog/xray/var/etc/security/
# Enable and start Xray service
sudo systemctl enable xray.service
sudo systemctl start xray.service
sudo systemctl restart xray.service

View File

@@ -0,0 +1,91 @@
# Setup JFrog Xray
The recommended way of deploying is through the Azure marketplace.
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fjfrog%2FJFrog-Cloud-Installers%2Farm-xray%2FAzureResourceManager%2FXray%2Fazuredeploy_xray_vmss.json" target="_blank">
<img src="https://aka.ms/deploytoazurebutton"/>
</a>
This template can help you setup [JFrog Xray](https://jfrog.com/xray/) on Azure.
## Prerequisites
1. JFrog Xray is an addition to JFrog Artifactory.
* To be able to use it, you need to have an Artifactory instance deployed in Azure with the appropriate license. If you do not have an Xray compatible license, you can [get a free trial](https://jfrog.com/xray/free-trial/).
2. Deployed Postgresql instance (if "existing DB" is selected as a parameter).
## Postgresql deployment
You can deploy a compatible Postgresql instance using this link:
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fjfrog%2FJFrog-Cloud-Installers%2Farm-xray%2FAzureResourceManager%2FPostgresql%2FazurePostgresDBDeploy.json" target="_blank">
<img src="https://aka.ms/deploytoazurebutton"/>
</a>
In the Databases field, use the object:
```
{
"properties": [
{
"name": "xray",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
```
## Installation
1. Click "Deploy to Azure" button. If you don't have an Azure subscription, it will guide you on how to signup for a free trial.
2. Fill out the form. Make sure to use the Artifactory Join key, which you can copy from the Artifactory UI, Security -> Settings -> Connection details
3. Click Review + Create, then click Create to start the deployment
4. Once deployment is done, access Xray thru Artifactory UI, Security & Compliance menu
### Note:
1. This template only supports Xray versions 3.2.x and above.
2. Input values for 'adminUsername' and 'adminPassword' parameters needs to follow azure VM access rules.
### Steps to upgrade JFrog Xray version
ARM templates uses a debian installation and you can follow the [official instructions](https://www.jfrog.com/confluence/display/JFROG/Upgrading+Xray#UpgradingXray-InteractiveScriptUpgrade(recommended).1) but for your convenience, you can use this method.
SSH to the Xray VM and CD to the /opt/ folder. Create an empty file upgrade.sh
``touch upgrade.sh``
Make the file executable:
```chmod +x upgrade.sh```
Open the file
```vi upgrade.sh```
Paste the commands below (check the version of Xray you want to upgrade to):
```
cd /opt/
echo "### Stopping Xray service before upgrade ###"
systemctl stop xray.service
XRAY_VERSION=3.6.2
wget -O jfrog-xray-${XRAY_VERSION}-deb.tar.gz https://api.bintray.com/content/jfrog/jfrog-xray/xray-deb/${XRAY_VERSION}/jfrog-xray-${XRAY_VERSION}-deb.tar.gz?bt_package=jfrog-xray
tar -xvf jfrog-xray-${XRAY_VERSION}-deb.tar.gz
rm jfrog-xray-${XRAY_VERSION}-deb.tar.gz
cd jfrog-xray-${XRAY_VERSION}-deb
echo "### Run Xray installation script ###"
echo "y" | ./install.sh
echo "### Start Xray service ###"
systemctl start xray.service
```
Run the script
```./upgrade.sh```
The script will upgrade existing 3.x version of Xray to the given version. Check /var/opt/jfrog/xray/console.log to make sure that the service was properly started. Look for the message:
```All services started successfully in 10.743 seconds```
and check the application version in the log.

View File

@@ -0,0 +1,63 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"value": "GEN-UNIQUE"
},
"adminUsername": {
"value": "GEN-UNIQUE"
},
"adminPassword": {
"value": "GEN-UNIQUE"
},
"virtualNetworkName": {
"value": "existing-vm-network-name"
},
"subnetName": {
"value": "existing-subnet-name"
},
"virtualNetworkNewOrExisting": {
"value": "existing"
},
"virtualNetworkAddressPrefix": {
"value": "10.0.0.0/16"
},
"virtualNetworkResourceGroup": {
"value": "resource-group-name"
},
"virtualMachineSize": {
"value": "Standard_D4s_v3"
},
"subnetAddressPrefix": {
"value": "10.0.1.0/24"
},
"xrayVersion": {
"value": "0.0.4"
},
"artifactoryURL": {
"value": "http://artifactory-url.cloudapp.azure.com"
},
"masterKey": {
"value": "GEN-UNIQUE"
},
"joinKey": {
"value": "GEN-UNIQUE"
},
"db_type": {
"value": "Postgresql_existing.json"
},
"db_user": {
"value": "GEN-UNIQUE"
},
"db_password": {
"value": "GEN-UNIQUE"
},
"manual_db_url": {
"value": "jdbc:postgresql://postgressrvr.postgres.database.azure.com:5432"
},
"db_server": {
"value": "postgressrvr"
}
}
}

View File

@@ -0,0 +1,403 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for the resources."
}
},
"clusterName": {
"type": "string",
"defaultValue": "xray",
"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."
}
},
"xrayVersion": {
"type": "string",
"defaultValue": "0.0.5",
"allowedValues": [
"0.0.3",
"0.0.4",
"0.0.5"
],
"metadata": {
"description": "Xray-vm image version to deploy."
}
},
"artifactoryURL": {
"type": "string",
"metadata": {
"description": "Artifactory URL"
}
},
"masterKey": {
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Master key for Artifactory cluster. Generate master.key using command '$openssl rand -hex 16'"
}
},
"joinKey": {
"type": "securestring",
"maxLength": 64,
"metadata": {
"description": "Join key for Artifactory cluster. Generate join.key using command '$openssl rand -hex 16'"
}
},
"adminUsername": {
"type": "string",
"defaultValue": "testadmin",
"metadata": {
"description": "Username for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"virtualNetworkName": {
"type": "string",
"metadata": {
"description": "New or Existing VNet Name"
}
},
"virtualNetworkNewOrExisting": {
"type": "string",
"metadata": {
"description": "Boolean indicating whether the VNet is new or existing"
}
},
"virtualNetworkAddressPrefix": {
"type": "string",
"metadata": {
"description": "VNet address prefix"
}
},
"virtualNetworkResourceGroup": {
"type": "string",
"metadata": {
"description": "Resource group of the VNet"
}
},
"virtualMachineSize": {
"type": "string",
"metadata": {
"description": "The size of the VM"
}
},
"subnetName": {
"type": "string",
"metadata": {
"description": "New or Existing subnet Name"
}
},
"subnetAddressPrefix": {
"type": "string",
"metadata": {
"description": "Subnet address prefix"
}
},
"db_type": {
"type": "string",
"defaultValue": "Postgresql_deploy.json",
"allowedValues": [
"Postgresql_deploy.json",
"Postgresql_existing.json"
],
"metadata": {
"description": "Deploy new Postgresql, MSSQL or use existing DB"
}
},
"manual_db_url": {
"type": "string",
"metadata": {
"description": "DB server URL, if existing DB server is used instead of a new deployment (jdbc:sqlserver://.. or jdbc:postgresql://..)"
}
},
"db_server": {
"type": "string",
"metadata": {
"description": "DB server name, if pre-existing DB is used"
}
},
"db_user": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Database Admin user name"
}
},
"db_password": {
"type": "securestring",
"minLength": 1,
"metadata": {
"description": "Database Admin password"
}
},
"databases": {
"type": "object",
"defaultValue": {
"properties": [
{
"name": "xray",
"charset": "UTF8",
"collation": "English_United States.1252"
}
]
}
},
"_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/master/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": ""
}
},
"variables": {
"namingInfix": "[toLower(substring(concat(parameters('clusterName'), uniqueString(resourceGroup().id)), 0, 9))]",
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'sawinvm')]",
"publicIPAddressName": "[concat(uniqueString(resourceGroup().id),'IP')]",
"clusterName": "[parameters('clusterName')]",
"nicName": "[concat(variables('clusterName'),'Nic')]",
"ipConfigName": "[concat(variables('namingInfix'), 'ipconfig')]",
"vnetId": {
"new": "[resourceId('Microsoft.Network/virtualNetworks',parameters('virtualNetworkName'))]",
"existing": "[resourceId(parameters('virtualNetworkResourceGroup'),'Microsoft.Network/virtualNetworks',parameters('virtualNetworkName'))]"
},
"subnetId": "[concat(variables('vnetId')[parameters('virtualNetworkNewOrExisting')],'/subnets/',parameters('subnetName'))]",
"publicIPAddressType": "Dynamic",
"db_server": "[parameters('db_server')]",
"db_user": "[concat(parameters('db_user'), '@', parameters('db_server'))]",
"actual_db_user": "[parameters('db_user')]",
"db_password": "[parameters('db_password')]",
"db_location": "[parameters('location')]",
"db_name": "[parameters('databases').properties[0].name]",
"masterKey": "[parameters('masterKey')]",
"joinKey": "[parameters('joinKey')]",
"osType": {
"publisher": "jfrog",
"offer": "x-ray-vm",
"sku": "x-ray-vm",
"version": "[parameters('xrayVersion')]"
},
"imageReference": "[variables('osType')]",
"dbTemplate": "[parameters('db_type')]",
"dbTemplateLocation": "[uri(parameters('_artifactsLocation'), concat('nested/', variables('dbTemplate'), parameters('_artifactsLocationSasToken')))]",
"artifactoryURL": "[parameters('artifactoryURL')]"
},
"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": []
}
}
},
{
"condition": "[equals(parameters('virtualNetworkNewOrExisting'),'new')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-05-01",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('virtualNetworkAddressPrefix')]"
]
},
"subnets": [
{
"name": "[parameters('subnetName')]",
"properties": {
"addressPrefix": "[parameters('subnetAddressPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('publicIPAddressName')]",
"apiVersion": "2020-05-01",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"apiVersion": "2020-05-01",
"location": "[parameters('location')]",
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
},
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
],
"enableIPForwarding": true
},
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]"
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-11-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"properties": {}
},
{
"type": "Microsoft.Resources/deployments",
"name": "deploySQLDB",
"apiVersion": "2019-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('dbTemplateLocation')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"db_user": {
"value": "[parameters('db_user')]"
},
"db_password": {
"value": "[variables('db_password')]"
},
"db_server": {
"value": "[variables('db_server')]"
},
"db_location": {
"value": "[variables('db_location')]"
},
"databases": {
"value": "[parameters('databases')]"
},
"manual_db_url": {
"value": "[parameters('manual_db_url')]"
}
}
}
},
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "[concat(variables('namingInfix'), 'xrayScaleset')]",
"location": "[parameters('location')]",
"apiVersion": "2018-10-01",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"plan": {
"name": "x-ray-vm",
"publisher": "jfrog",
"product": "x-ray-vm"
},
"sku": {
"name": "[parameters('virtualMachineSize')]",
"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\nXRAY_VERSION=', parameters('xrayVersion'),'\nARTIFACTORY_URL=',variables('artifactoryURL'),'\nDB_SERVER=',variables('db_server'),'\nDB_NAME=',variables('db_name'),'\nDB_ADMIN_USER=',variables('db_user'),'\nACTUAL_DB_ADMIN_USER=',variables('actual_db_user'),'\nDB_ADMIN_PASSWD=',variables('db_password'),'\nMASTER_KEY=',variables('masterKey'),'\nJOIN_KEY=',variables('joinKey'),'\n'))]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "[variables('nicName')]",
"properties": {
"primary": true,
"ipConfigurations": [
{
"name": "[concat(variables('ipConfigName'),'1')]",
"properties": {
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
]
}
}
]
},
"extensionProfile": {
"extensions": [
{
"name": "extension1",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": false,
"settings": {
"fileUris": [
"[uri(parameters('_artifactsLocation'), concat('scripts/install_xray.sh', parameters('_artifactsLocationSasToken')))]"
]
},
"protectedSettings": {
"commandToExecute": "./install_xray.sh >> /opt/installation_log1.txt"
}
}
}
]
}
}
}
}
]
}

View File

@@ -0,0 +1,161 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"db_user": {
"type": "string",
"defaultValue": "xray",
"minLength": 1
},
"db_password": {
"type": "securestring"
},
"db_server": {
"type": "string",
"defaultValue": "xraypostgressrv",
"minLength": 1
},
"db_location": {
"type": "string"
},
"skuCapacity": {
"type": "int",
"defaultValue": 2
},
"skuFamily": {
"type": "string",
"defaultValue": "Gen5"
},
"skuName": {
"type": "string",
"defaultValue": "GP_Gen5_2"
},
"skuSizeMB": {
"type": "int",
"defaultValue": 5120
},
"skuTier": {
"type": "string",
"defaultValue": "GeneralPurpose"
},
"version": {
"type": "string",
"defaultValue": "9.6"
},
"backupRetentionDays": {
"type": "int",
"defaultValue": 7
},
"geoRedundantBackup": {
"type": "string",
"defaultValue": "Disabled"
},
"databases": {
"type": "object"
},
"sslEnforcement": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Disabled",
"metadata": {
"description": "SSL Enforcement"
}
},
"publicNetworkAccess": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Enabled",
"metadata": {
"description": "Public Network Access"
}
},
"db_edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"name": "[parameters('db_server')]",
"properties": {
"version": "[parameters('version')]",
"administratorLogin": "[parameters('db_user')]",
"administratorLoginPassword": "[parameters('db_password')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"sslEnforcement": "[parameters('sslEnforcement')]",
"storageProfile": {
"storageMB": "[parameters('skuSizeMB')]",
"backupRetentionDays": "[parameters('backupRetentionDays')]",
"geoRedundantBackup": "[parameters('geoRedundantBackup')]"
}
},
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]",
"capacity": "[parameters('skuCapacity')]",
"size": "[parameters('skuSizeMB')]",
"family": "[parameters('skuFamily')]"
},
"resources": [
{
"name": "[uniqueString(parameters('db_server'), 'AllowAllWindowsAzureIps' )]",
"type": "firewallRules",
"apiVersion": "2017-12-01",
"location": "[parameters('db_location')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/databases",
"apiversion": "2017-12-01",
"name": "[concat(parameters('db_server'), '/', parameters('databases').properties[0].name)]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('db_server'))]"
],
"properties": {
"charset": "[parameters('databases').properties[0].charset]",
"collation": "[parameters('databases').properties[0].collation]"
}
}
]
}
],
"outputs": {
"dbServerName": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_edition": {
"type": "string",
"value": "[parameters('db_edition')]"
},
"manual_db_url": {
"type": "string",
"value": "[parameters('manual_db_url')]"
}
}
}

View File

@@ -0,0 +1,54 @@
{
"$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": "xraypostgressrv",
"minLength": 1
},
"db_location": {
"type": "string"
},
"databases": {
"type": "object"
},
"manual_db_url": {
"type": "string"
}
},
"variables": {
},
"resources": [
],
"outputs": {
"jdbcConnString": {
"type": "string",
"value": "[parameters('manual_db_url')]"
},
"db_user": {
"type": "string",
"value": "[parameters('db_user')]"
},
"db_server": {
"type": "string",
"value": "[parameters('db_server')]"
},
"db_location": {
"type": "string",
"value": "[parameters('db_location')]"
},
"databases": {
"type": "object",
"value": "[parameters('databases')]"
}
}
}

View File

@@ -0,0 +1,42 @@
#!/bin/bash
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=//")
ACTUAL_DB_USER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ACTUAL_DB_ADMIN_USER=" | sed "s/ACTUAL_DB_ADMIN_USER=//")
DB_PASSWORD=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_ADMIN_PASSWD=" | sed "s/DB_ADMIN_PASSWD=//")
DB_SERVER=$(cat /var/lib/cloud/instance/user-data.txt | grep "^DB_SERVER=" | sed "s/DB_SERVER=//")
MASTER_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^MASTER_KEY=" | sed "s/MASTER_KEY=//")
JOIN_KEY=$(cat /var/lib/cloud/instance/user-data.txt | grep "^JOIN_KEY=" | sed "s/JOIN_KEY=//")
ARTIFACTORY_URL=$(cat /var/lib/cloud/instance/user-data.txt | grep "^ARTIFACTORY_URL=" | sed "s/ARTIFACTORY_URL=//")
export DEBIAN_FRONTEND=noninteractive
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository ppa:rmescandon/yq -y
sudo apt update -y
sudo apt install yq -y
# Create master.key on each node
sudo mkdir -p /opt/jfrog/xray/var/etc/security/
cat <<EOF >/opt/jfrog/xray/var/etc/security/master.key
${MASTER_KEY}
EOF
# Xray should have the same join key as the Artifactory instance
# Both application should be deployed in the same Virtual Networks
HOSTNAME=$(hostname -i)
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.url postgres://${DB_SERVER}.postgres.database.azure.com:5432/${DB_NAME}?sslmode=disable
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.username ${DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.actualUsername ${ACTUAL_DB_USER}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.database.password ${DB_PASSWORD}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.rabbitMq.password JFXR_RABBITMQ_COOKIE
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.jfrogUrl ${ARTIFACTORY_URL}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.security.joinKey ${JOIN_KEY}
yq w -i /var/opt/jfrog/xray/etc/system.yaml shared.node.ip ${HOSTNAME}
chown xray:xray -R /opt/jfrog/xray/var/etc/security/* && chown xray:xray -R /opt/jfrog/xray/var/etc/security/
# Enable and start Xray service
sudo systemctl enable xray.service
sudo systemctl start xray.service
sudo systemctl restart xray.service

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# Upgrade version for every release
XRAY_VERSION=3.8.5
export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get upgrade -y
# Download Xray
cd /opt/
wget -O jfrog-xray-${XRAY_VERSION}-deb.tar.gz 'https://bintray.com/jfrog/jfrog-xray/download_file?agree=true&artifactPath=/jfrog/jfrog-xray/xray-deb/'${XRAY_VERSION}'/jfrog-xray-'${XRAY_VERSION}'-deb.tar.gz&callback_id=&product=org.grails.taglib.NamespacedTagDispatcher' \
>> /var/log/download-xray.log 2>&1
tar -xvf jfrog-xray-${XRAY_VERSION}-deb.tar.gz
rm jfrog-xray-${XRAY_VERSION}-deb.tar.gz
cd jfrog-xray-${XRAY_VERSION}-deb
# Generate txt file with the parameters to use in the interactive installation script
cat <<EOF >/opt/jfrog-xray-${XRAY_VERSION}-deb/input.txt
/var/opt/jfrog/xray
http://
Y
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
replace_with_host_ip
N
n
postgres://{postgres_server_name}.postgres.database.azure.com:5432/xray?sslmode=disable
xray@postgres_server_name
password
EOF
# 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
# Add 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/1.0.0
EOF
# Remove Xray service from boot up run
sudo systemctl disable xray.service

View File

@@ -1,39 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"value": "GEN-UNIQUE"
},
"adminUsername": {
"value": "GEN-UNIQUE"
},
"adminPassword": {
"value": "GEN-PASSWORD"
},
"DB_Admin_User": {
"value": "GEN-UNIQUE"
},
"DB_Admin_Password": {
"value": "GEN-PASSWORD"
},
"DB_Name": {
"value": "GEN-UNIQUE"
},
"masterKey": {
"value": "35767fa0164bac66b6cccb8880babefb"
},
"joinKey": {
"value": "3143bf2aa4db9c00077e0443c84d252e"
},
"artifactoryLicense1": {
"value": "GEN-UNIQUE"
},
"artifactoryLicense2": {
"value": "GEN-UNIQUE"
},
"artifactoryLicense3": {
"value": "GEN-UNIQUE"
}
}
}

View File

@@ -0,0 +1,8 @@
# JFrog welcomes community contribution!
Before we can accept your contribution, process your GitHub pull requests, and thank you full-heartedly, we request that you will fill out and submit JFrog's Contributor License Agreement (CLA).
[Click here](https://secure.echosign.com/public/hostedForm?formid=5IYKLZ2RXB543N) to submit the JFrog CLA.
This should only take a minute to complete and is a one-time process.
*Thanks for Your Contribution to the Community!* :-)

View File

@@ -1,14 +1,12 @@
# JFrog Artifactory Enterprise Operator
# JFrog Unified Platform On Openshift
This code base is intended to deploy Artifactory Enterprise (HA) as an operator to an Openshift4 cluster.
This code base is intended to deploy JFrog Unified Platform products as either helm or an operator to an Openshift4 cluster.
You can run the operator either through the operator-sdk, operator.yaml, or the OperatorHub OLM (CSV).
Openshift OperatorHub has the latest official supported Cluster Service Version (CSV) for the OLM catalog.
Openshift OperatorHub has the latest official supported version to deploy via the GUI.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Optionally you can deploy into Openshift4 as helm.
## Prerequisites
@@ -18,14 +16,15 @@ Available on AWS, GCP, or Azure. Follow the Cloud installer guide available here
[Openshift 4 Installers](https://cloud.redhat.com/openshift/install)
Or run it locally using CodeReadyContainers.
Or run it locally using CodeReadyContainers or your own on-perm solution.
[Code Ready Container Installer](https://cloud.redhat.com/openshift/install/crc/installer-provisioned)
Note if you are going to use CodeReadyContainers to test this Operator you will need to ensure:
Note if you are going to use CRC / On-prem to run the Operators you will need to ensure:
```
- create at least one Persistent volume of 200Gi per Artifactory node used in HA configuration
- create at least 3 or more additional Persistent volumes 100Gi in size or more for Postgresql, Rabbitmq, and other components used.
```
###### Openshift 4 Command Line Tools
@@ -36,9 +35,31 @@ Download and install the Openshift command line tool: oc
## Next Steps
To install JFrog Artifactory Enterprise as an Openshift 4 operator please use the console's OperatorHub to install the official operator. This is the easiest way to install it.
To install JFrog Operators please use the web console's OperatorHub to install the official operators. This is the easiest way to install it.
If you wish to install the operator locally please refer to the instructions that can be found in the README under artifactory-ha-operator.
If you wish to install the operator(s) locally please refer to the instructions that can be found in the README under artifactory-ha-operator.
## Helm Deployments
The necessary helm fixes for it to work in Openshift have been patched for each product in the following subfolders:
Artifactory HA Helm Chart:
```
openshift-artifactory-ha
```
Xray Helm Chart:
```
openshift-xray
```
However to use helm you will need to apply RunAsAny shown below:
```
oc patch scc restricted --patch '{"fsGroup":{"type":"RunAsAny"},"runAsUser":{"type":"RunAsAny"},"seLinuxContext":{"type":"RunAsAny"}}' --type=merge
```
Once your cluster has been patched you can then deploy via helm using the openshift charts shown above.
## Contributing
Please read [CONTRIBUTING.md](JFrog-Cloud-Installers/Openshift4/artifactory-ha-operator/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

View File

@@ -7,4 +7,4 @@ scorecard:
- olm:
cr-manifest:
- "deploy/crds/charts.helm.k8s.io_v1alpha1_openshiftartifactoryha_cr.yaml"
csv-path: "deploy/olm-catalog/artifactory-ha-operator/1.0.0/artifactory-ha-operator.v1.0.0.clusterserviceversion.yaml"
csv-path: "deploy/olm-catalog/artifactory-ha-operator/1.0.2/artifactory-ha-operator.v1.0.2.clusterserviceversion.yaml"

View File

@@ -1,6 +1,12 @@
# JFrog Openshift Artifactory-ha Chart Changelog
All changes to this chart will be documented in this file.
## [3.0.5] - July 16, 2020
* Updating to latest jfrog/artifactory-ha helm chart version 3.0.5 artifactory version 7.6.3
## [2.6.0] - June 29, 2020
* Updating to latest jfrog/artifactory-ha helm chart version 2.6.0 artifactory version 7.6.1
## [2.4.6] - May 12, 2020
* Updating to latest jfrog/artifactory-ha helm chart version 2.4.6 artifactory version 7.4.3

View File

@@ -1,62 +1,8 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via slack, issue, email, or any other method with the owners of this repository before making a change.
Note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
Ensure any install or build dependencies are removed before the end of the layer when doing a build.
# JFrog welcomes community contribution!
Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
Before we can accept your contribution, process your GitHub pull requests, and thank you full-heartedly, we request that you will fill out and submit JFrog's Contributor License Agreement (CLA).
Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is SemVer.
[Click here](https://secure.echosign.com/public/hostedForm?formid=5IYKLZ2RXB543N) to submit the JFrog CLA.
This should only take a minute to complete and is a one-time process.
You may merge the Pull Request in once you have the sign-off of one other developer.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment include:
```
Using welcoming and inclusive language
Being respectful of differing viewpoints and experiences
Gracefully accepting constructive criticism
Focusing on what is best for the company
Showing empathy towards other colleagues
```
Examples of unacceptable behavior by participants include:
```
The use of sexualized language or imagery and unwelcome sexual attention or advances
Trolling, insulting/derogatory comments, and personal or political attacks
Public or private harassment
Publishing others' private information, such as a physical or electronic address, without explicit permission
Other conduct which could reasonably be considered inappropriate in a professional setting
```
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project. Examples of representing a project include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
Attribution
This Code of Conduct is adapted from the [Contributor Covenant version 1.4] (http://contributor-covenant.org/version/1/4)
*Thanks for Your Contribution to the Community!* :-)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
packageName: openshiftartifactoryha-operator
channels:
- name: alpha
currentCSV: artifactory-ha-operator.v1.0.0
currentCSV: artifactory-ha-operator.v1.0.2

View File

@@ -20,7 +20,7 @@ spec:
name: volume
image:
repository: registry.connect.redhat.com/jfrog/artifactory-pro
version: 7.4.3
version: 7.6.1
joinKey: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
masterKey: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
node:

View File

@@ -1,6 +1,12 @@
# JFrog Openshift Artifactory-ha Chart Changelog
All changes to this chart will be documented in this file.
## [3.0.5] - Jul 16, 2020
* Updating to latest jfrog/artifactory helm chart version 3.0.5 artifactory version 7.6.3
## [2.6.0] - June 29, 2020
* Updating to latest jfrog/artifactory helm chart version 2.6.0 artifactory version 7.6.1
## [2.4.6] - May 12, 2020
* Updating to latest jfrog/artifactory-ha helm chart version 2.4.6 artifactory version 7.4.3

View File

@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: 7.4.3
appVersion: 7.6.3
description: Openshift JFrog Artifactory HA subcharting Artifactory HA to work in Openshift environment
home: https://www.jfrog.com/artifactory/
icon: https://raw.githubusercontent.com/jfrog/charts/master/stable/artifactory-ha/logo/artifactory-logo.png
@@ -16,4 +16,4 @@ name: openshift-artifactory-ha
sources:
- https://bintray.com/jfrog/product/JFrog-Artifactory-Pro/view
- https://github.com/jfrog/charts
version: 2.4.6
version: 3.0.5

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
dependencies:
- name: artifactory-ha
repository: https://charts.jfrog.io/
version: 2.4.6
digest: sha256:e0c6b67c9745748aba555b2383d832fee3a977fcde31c5a4f3a5f73f4a357a92
generated: "2020-05-12T11:37:46.61737-07:00"
version: 3.0.5
digest: sha256:59deb56ee27e8a629a22f48cc051453e774999228ece09c77584d95c8c54ce6d
generated: "2020-07-16T14:29:16.129919-07:00"

View File

@@ -1,4 +1,4 @@
dependencies:
- name: artifactory-ha
version: 2.4.6
version: 3.0.5
repository: https://charts.jfrog.io/

View File

@@ -34,7 +34,7 @@ artifactory-ha:
## Change to use RH UBI images
image:
repository: registry.connect.redhat.com/jfrog/artifactory-pro
version: 7.4.3
version: 7.6.3
node:
replicaCount: 2
waitForPrimaryStartup:

View File

@@ -1,17 +1,8 @@
# JFrog Openshift Artifactory-Xray Chart Changelog
All changes to this chart will be documented in this file.
## [2.4.0] - April 14, 2020
* Updating to latest jfrog/artifactory-ha helm chart version 2.4.0 adding new requirements.yaml entry for xray helm charts to combine together into one umbrella chart
## [4.1.2] July 28, 2020
* Updating to Xray chart version 4.1.2 and Xray app version 3.6.2
## [2.3.0] - April 13, 2020
* Updating to latest jfrog/artifactory-ha helm chart version 2.3.0
## [2.2.9] - April 11, 2020
* Fixed issues with master key
## [2.1.9] - March 17, 2020
* Updated Artifactory version to 7.3.2
## [2.0.35] - March 09, 2020
* Updated Artifactory version to 7.2.1
## [3.5.1] June 29, 2020
* Updating to Xray chart version 3.5.1 and Xray app version 3.5.2

View File

@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: 3.3.0
appVersion: 3.6.2
description: Universal component scan for security and license inventory and impact analysis
sources:
- https://bintray.com/jfrog/product/xray/view
@@ -13,4 +13,4 @@ maintainers:
- email: johnp@jfrog.com
name: John Peterson
name: openshift-xray
version: 3.3.1
version: 4.1.2

View File

@@ -0,0 +1,509 @@
# JFrog Xray HA on Kubernetes Helm Chart
## Openshift
The Xray chart has been made a subchart of this chart.
Note due to this change we now reference values through the subchart name as shown below:
original:
```
xray.jfrogUrl
```
now:
```
xray.xray.jfrogUrl
```
This is due to helm referencing the value through the subchart named xray now.
## Prerequisites Details
* Kubernetes 1.12+
## Chart Details
This chart will do the following:
* Optionally deploy PostgreSQL
* Deploy RabbitMQ (optionally as an HA cluster)
* Deploy JFrog Xray micro-services
## Requirements
- A running Kubernetes cluster
- Dynamic storage provisioning enabled
- Default StorageClass set to allow services using the default StorageClass for persistent storage
- A running Artifactory
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed and setup to use the cluster
- [Helm](https://helm.sh/) v2 or v3 installed
## Install JFrog Xray
### Add JFrog Helm repository
Before installing JFrog helm charts, you need to add the [JFrog helm repository](https://charts.jfrog.io/) to your helm client
```bash
helm repo add jfrog https://charts.jfrog.io
```
### Install Chart
#### Artifactory Connection Details
In order to connect Xray to your Artifactory installation, you have to use a Join Key, hence it is *MANDATORY* to provide a Join Key and Jfrog Url to your Xray installation. Here's how you do that:
Retrieve the connection details of your Artifactory installation, from the UI - https://www.jfrog.com/confluence/display/JFROG/General+Security+Settings#GeneralSecuritySettings-ViewingtheJoinKey.
#### Initiate Installation
Provide join key and jfrog url as a parameter to the Xray chart installation:
```bash
helm upgrade --install --set xray.joinKey=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY> \
--set xray.jfrogUrl=<YOUR_PREVIOUSLY_RETIREVED_BASE_URL> --namespace xray jfrog/xray
```
Alternatively, you can create a secret containing the join key manually and pass it to the template at install/upgrade time.
```bash
# Create a secret containing the key. The key in the secret must be named join-key
kubectl create secret generic my-secret --from-literal=join-key=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY>
# Pass the created secret to helm
helm upgrade --install --set xray.joinKeySecretName=my-secret --namespace xray jfrog/xray
```
**NOTE:** In either case, make sure to pass the same join key on all future calls to `helm install` and `helm upgrade`! This means always passing `--set xray.joinKey=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY>`. In the second, this means always passing `--set xray.joinKeySecretName=my-secret` and ensuring the contents of the secret remain unchanged.
### System Configuration
Xray uses a common system configuration file - `system.yaml`. See [official documentation](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) on its usage.
## Status
See the status of your deployed **helm** releases
```bash
helm status xray
```
## Upgrade
To upgrade an existing Xray, you still use **helm**
```bash
# Update existing deployed version to 2.1.2
helm upgrade --set common.xrayVersion=2.1.2 jfrog/xray
```
If Xray was installed without providing a value to postgresql.postgresqlPassword (a password was autogenerated), follow these instructions:
1. Get the current password by running:
```bash
POSTGRES_PASSWORD=$(kubectl get secret -n <namespace> <myrelease>-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
```
2. Upgrade the release by passing the previously auto-generated secret:
```bash
helm upgrade <myrelease> jfrog/xray --set postgresql.postgresqlPassword=${POSTGRES_PASSWORD}
```
If Xray was installed without providing a value to rabbitmq.rabbitmqPassword/rabbitmq-ha.rabbitmqPassword (a password was autogenerated), follow these instructions:
1. Get the current password by running:
```bash
RABBITMQ_PASSWORD=$(kubectl get secret -n <namespace> <myrelease>-rabbitmq -o jsonpath="{.data.rabbitmq-password}" | base64 --decode)
```
2. Upgrade the release by passing the previously auto-generated secret:
```bash
helm upgrade <myrelease> jfrog/xray --set rabbitmq.rabbitmqPassword=${RABBITMQ_PASSWORD}/rabbitmq-ha.rabbitmqPassword=${RABBITMQ_PASSWORD}
```
If Xray was installed with all of the default values (e.g. with no user-provided values for rabbit/postgres), follow these steps:
1. Retrieve all current passwords (rabbitmq/postgresql) as explained in the above section.
2. Upgrade the release by passing the previously auto-generated secrets:
```bash
helm upgrade --install xray --namespace xray jfrog/xray --set rabbitmq-ha.rabbitmqPassword=<rabbit-password> --set postgresql.postgresqlPassword=<postgresql-password>
```
## Remove
Removing a **helm** release is done with
```bash
# Remove the Xray services and data tools
#On helm v2:
helm delete --purge xray
#On helm v3:
helm delete xray --namespace xray
# Remove the data disks
kubectl delete pvc -l release=xray
```
### Deploying Xray for small/medium/large instllations
In the chart directory, we have added three values files, one for each installation type - small/medium/large. These values files are recommendations for setting resources requests and limits for your installation. The values are derived from the following [documentation](https://www.jfrog.com/confluence/display/EP/Installing+on+Kubernetes#InstallingonKubernetes-Systemrequirements). You can find them in the corresponding chart directory - values-small.yaml, values-medium.yaml and values-large.yaml
### Create a unique Master Key
JFrog Xray requires a unique master key to be used by all micro-services in the same cluster. By default the chart has one set in values.yaml (`xray.masterKey`).
**This key is for demo purpose and should not be used in a production environment!**
You should generate a unique one and pass it to the template at install/upgrade time.
```bash
# Create a key
export MASTER_KEY=$(openssl rand -hex 32)
echo ${MASTER_KEY}
# Pass the created master key to helm
helm upgrade --install --set xray.masterKey=${MASTER_KEY} --namespace xray jfrog/xray
```
Alternatively, you can create a secret containing the master key manually and pass it to the template at install/upgrade time.
```bash
# Create a key
export MASTER_KEY=$(openssl rand -hex 32)
echo ${MASTER_KEY}
# Create a secret containing the key. The key in the secret must be named master-key
kubectl create secret generic my-secret --from-literal=master-key=${MASTER_KEY}
# Pass the created secret to helm
helm upgrade --install xray --set xray.masterKeySecretName=my-secret --namespace xray jfrog/xray
```
**NOTE:** In either case, make sure to pass the same master key on all future calls to `helm install` and `helm upgrade`! In the first case, this means always passing `--set xray.masterKey=${MASTER_KEY}`. In the second, this means always passing `--set xray.masterKeySecretName=my-secret` and ensuring the contents of the secret remain unchanged.
## Special deployments
This is a list of special use cases for non-standard deployments
### High Availability
For **high availability** of Xray, set the replica count to be equal or higher than **2**. Recommended is **3**.
> It is highly recommended to also set **RabbitMQ** to run as an HA cluster.
```bash
# Start Xray with 3 replicas per service and 3 replicas for RabbitMQ
helm upgarde --install xray --namespace xray --set server.replicaCount=3 jfrog/xray
```
### External Databases
There is an option to use external PostgreSQL database for your Xray.
#### PostgreSQL
##### PostgreSQL without TLS
To use an external **PostgreSQL**, you need to disable the use of the bundled **PostgreSQL** and set a custom **PostgreSQL** connection URL.
For this, pass the parameters: `postgresql.enabled=false` and `database.url=${XRAY_POSTGRESQL_CONN_URL}`.
**IMPORTANT:** Make sure the DB is already created before deploying Xray services
```bash
# Passing a custom PostgreSQL to Xray
# Example
export POSTGRESQL_HOST=custom-postgresql-host
export POSTGRESQL_PORT=5432
export POSTGRESQL_USER=xray
export POSTGRESQL_PASSWORD=password2_X
export POSTGRESQL_DATABASE=xraydb
export XRAY_POSTGRESQL_CONN_URL="postgres://${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DATABASE}?sslmode=disable"
helm upgrade --install xray --namespace xray \
--set postgresql.enabled=false \
--set database.url="${XRAY_POSTGRESQL_CONN_URL}" \
--set database.user="${POSTGRESQL_USER}" \
--set database.password="${POSTGRESQL_PASSWORD}" \
jfrog/xray
```
##### PostgreSQL with TLS
If external **PostgreSQL** is set with TLS, you need to disable the use of the bundled **PostgreSQL**, set a custom **PostgreSQL** connection URL and provide a secret with **PostgreSQL** TLS certificates.
Create the Kubernetes secret (assuming the local files are `client-cert.pem client-key.pem server-ca.pem`)
```bash
kubectl create secret generic postgres-tls --from-file=client-key.pem --from-file=client-cert.pem --from-file=server-ca.pem
```
**IMPORTANT:** `PostgreSQL` connection URL needs to have listed TLS files with the path `/var/opt/jfrog/xray/data/tls/`
and `sslmode==verify-ca` otherwise Xray will fail to connect to Postgres.
```bash
# Passing a custom PostgreSQL with TLS to Xray
# Example
export POSTGRESQL_HOST=custom-postgresql-host
export POSTGRESQL_PORT=5432
export POSTGRESQL_USER=xray
export POSTGRESQL_PASSWORD=password2_X
export POSTGRESQL_DATABASE=xraydb
export POSTGRESQL_SERVER_CA=server-ca.pem
export POSTGRESQL_CLIENT_CERT=client-key.pem
export POSTGRESQL_CLIENT_KEY=client-cert.pem
export POSTGRESQL_TLS_SECRET=postgres-tls
export XRAY_POSTGRESQL_CONN_URL="postgres://${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DATABASE}?sslrootcert=/var/opt/jfrog/xray/data/tls/${POSTGRESQL_SERVER_CA}&sslkey=/var/opt/jfrog/xray/data/tls/${POSTGRESQL_CLIENT_KEY}&sslcert=/var/opt/jfrog/xray/data/tls/${POSTGRESQL_CLIENT_CERT}&sslmode=verify-ca"
helm upgrade --install xray --namespace xray \
--set postgresql.enabled=false \
--set database.url="${XRAY_POSTGRESQL_CONN_URL}" \
--set database.user="${POSTGRESQL_USER}" \
--set database.password="${POSTGRESQL_PASSWORD}" \
jfrog/xray
```
### Custom init containers
There are cases where a special, unsupported init processes is needed like checking something on the file system or testing something before spinning up the main container.
For this, there is a section for writing custom init containers before and after the predefined init containers in the [values.yaml](values.yaml) . By default it's commented out
```yaml
common:
## Add custom init containers executed before predefined init containers
customInitContainersBegin: |
## Init containers template goes here ##
## Add custom init containers executed after predefined init containers
customInitContainers: |
## Init containers template goes here ##
```
## Configuration
The following table lists the configurable parameters of the xray chart and their default values.
| Parameter | Description | Default |
|------------------------------|--------------------------------------------------|------------------------------------|
| `imagePullSecrets` | Docker registry pull secret | |
| `imagePullPolicy` | Container pull policy | `IfNotPresent` |
| `initContainerImage` | Init container image | `alpine:3.6` |
| `xray.jfrogUrl` | Main Artifactory URL, without the `/artifactory` prefix .Mandatory | |
| `xray.persistence.mountPath` | Xray persistence mount path | `/var/opt/jfrog/xray` |
| `xray.masterKey` | Xray Master Key (Can be generated with `openssl rand -hex 32`) | `` |
| `xray.masterKeySecretName` | Xray Master Key secret name | |
| `xray.joinKey` | Xray Join Key to connect to Artifactory . Mandatory | `` |
| `xray.joinKeySecretName` | Xray Join Key secret name | |
| `xray.systemYaml` | Xray system configuration (`system.yaml`) as described here - https://www.jfrog.com/confluence/display/JFROG/Xray+System+YAML | |
| `xray.autoscaling.enabled` | Enable Xray Pods autoscaling using `HorizontalPodAutoscaler` | `false` |
| `xray.autoscaling.minReplicas` | Minimum number of Xray replicas | `1` |
| `xray.autoscaling.maxReplicas` | Maximum number of Xray replicas | `1` |
| `xray.autoscaling.targetCPUUtilizationPercentage` | CPU usage percentage that will trigger autoscaling | `50` |
| `xray.autoscaling.targetMemoryUtilizationPercentage` | Memory usage percentage that will trigger autoscaling | `75` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created| `true` |
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template |
| `rbac.create` | Specifies whether RBAC resources should be created | `true` |
| `rbac.role.rules` | Rules to create | `[]` |
| `postgresql.enabled` | Use enclosed PostgreSQL as database | `true` |
| `postgresql.image.registry` | PostgreSQL Docker image registry | `docker.bintray.io` |
| `postgresql.image.repository` | PostgreSQL Docker image repository | `bitnami/postgresql` |
| `postgresql.image.tag` | PostgreSQL Docker image tag | `9.6.15-debian-9-r91` |
| `postgresql.postgresqlUsername` | PostgreSQL database user | `xray` |
| `postgresql.postgresqlPassword` | PostgreSQL database password | ` ` |
| `postgresql.postgresqlDatabase` | PostgreSQL database name | `xraydb` |
| `postgresql.postgresqlExtendedConf.listenAddresses` | PostgreSQL listen address | `"'*'"` |
| `postgresql.postgresqlExtendedConf.maxConnections` | PostgreSQL max_connections parameter | `500` |
| `postgresql.service.port` | PostgreSQL database port | `5432` |
| `postgresql.persistence.enabled` | PostgreSQL use persistent storage | `true` |
| `postgresql.persistence.size` | PostgreSQL persistent storage size | `50Gi` |
| `postgresql.persistence.existingClaim` | PostgreSQL name of existing Persistent Volume Claim to use | ` ` |
| `postgresql.resources.requests.memory` | PostgreSQL initial memory request | |
| `postgresql.resources.requests.cpu` | PostgreSQL initial cpu request | |
| `postgresql.resources.limits.memory` | PostgreSQL memory limit | |
| `postgresql.resources.limits.cpu` | PostgreSQL cpu limit | |
| `postgresql.nodeSelector` | PostgreSQL node selector | `{}` |
| `postgresql.affinity` | PostgreSQL node affinity | `{}` |
| `postgresql.tolerations` | PostgreSQL node tolerations | `[]` |
| `database.url` | External database connection URL | |
| `database.user` | External database username | |
| `database.password` | External database password | |
| `database.secrets.user.name` | External database username `Secret` name | |
| `database.secrets.user.key` | External database username `Secret` key | |
| `database.secrets.password.name` | External database password `Secret` name | |
| `database.secrets.password.key` | External database password `Secret` key | |
| `database.secrets.url.name` | External database url `Secret` name | |
| `database.secrets.url.key` | External database url `Secret` key | |
| `rabbitmq.enabled` | RabbitMQ enabled uses rabbitmq | `false` |
| `rabbitmq.replicas` | RabbitMQ replica count | `1` |
| `rabbitmq.rbacEnabled` | If true, create & use RBAC resources | `true` |
| `rabbitmq.rabbitmq.username` | RabbitMQ application username | `guest` |
| `rabbitmq.rabbitmq.password` | RabbitMQ application password | |
| `rabbitmq.rabbitmq.existingPasswordSecret` | RabbitMQ existingPasswordSecret | |
| `rabbitmq.rabbitmq.erlangCookie` | RabbitMQ Erlang cookie | `XRAYRABBITMQCLUSTER`|
| `rabbitmq.service.nodePort` | RabbitMQ node port | `5672` |
| `rabbitmq.persistence.enabled` | If `true`, persistent volume claims are created | `true` |
| `rabbitmq.persistence.accessMode` | RabbitMQ persistent volume claims access mode | `ReadWriteOnce` |
| `rabbitmq.persistence.size` | RabbitMQ Persistent volume size | `20Gi` |
| `rabbitmq-ha.enabled` | RabbitMQ enabled uses rabbitmq-ha | `true` |
| `rabbitmq-ha.replicaCount` | RabbitMQ Number of replica | `1` |
| `rabbitmq-ha.rabbitmqUsername` | RabbitMQ application username | `guest` |
| `rabbitmq-ha.rabbitmqPassword` | RabbitMQ application password | ` ` |
| `rabbitmq-ha.existingSecret` | RabbitMQ existingSecret | ` ` |
| `rabbitmq-ha.rabbitmqErlangCookie` | RabbitMQ Erlang cookie | `XRAYRABBITMQCLUSTER`|
| `rabbitmq-ha.rabbitmqMemoryHighWatermark` | RabbitMQ Memory high watermark | `500MB` |
| `rabbitmq-ha.persistentVolume.enabled` | If `true`, persistent volume claims are created | `true` |
| `rabbitmq-ha.persistentVolume.size` | RabbitMQ Persistent volume size | `20Gi` |
| `rabbitmq-ha.rbac.create` | If true, create & use RBAC resources | `true` |
| `rabbitmq-ha.nodeSelector` | RabbitMQ node selector | `{}` |
| `rabbitmq-ha.tolerations` | RabbitMQ node tolerations | `[]` |
| `common.xrayVersion` | Xray image tag | `.Chart.AppVersion` |
| `common.preStartCommand` | Xray Custom command to run before startup. Runs BEFORE any microservice-specific preStartCommand | |
| `common.xrayUserId` | Xray User Id | `1035` |
| `common.xrayGroupId` | Xray Group Id | `1035` |
| `common.persistence.enabled` | Xray common persistence volume enabled | `false` |
| `common.persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
| `common.persistence.storageClass` | Storage class of backing PVC | `nil (uses default storage class annotation)` |
| `common.persistence.accessMode` | Xray common persistence volume access mode | `ReadWriteOnce` |
| `common.persistence.size` | Xray common persistence volume size | `50Gi` |
| `xray.systemYaml` | Xray system configuration (`system.yaml`) | `see values.yaml` |
| `common.customInitContainersBegin` | Custom init containers to run before existing init containers | ` ` |
| `common.customInitContainers` | Custom init containers to run after existing init containers | ` ` |
| `common.xrayConfig` | Additional xray yaml configuration to be written to xray_config.yaml file | See [values.yaml](stable/xray/values.yaml) |
| `database.url` | Xray external PostgreSQL URL | ` ` |
| `global.postgresqlTlsSecret` | Xray external PostgreSQL TLS files secret | ` ` |
| `analysis.name` | Xray Analysis name | `xray-analysis` |
| `analysis.image` | Xray Analysis container image | `docker.bintray.io/jfrog/xray-analysis` |
| `analysis.updateStrategy` | Xray Analysis update strategy | `RollingUpdate` |
| `analysis.podManagementPolicy` | Xray Analysis pod management policy | `Parallel` |
| `analysis.internalPort` | Xray Analysis internal port | `7000` |
| `analysis.externalPort` | Xray Analysis external port | `7000` |
| `analysis.livenessProbe` | Xray Analysis livenessProbe | See `values.yaml` |
| `analysis.readinessProbe` | Xray Analysis readinessProbe | See `values.yaml` |
| `analysis.persistence.size` | Xray Analysis storage size limit | `10Gi` |
| `analysis.resources` | Xray Analysis resources | `{}` |
| `analysis.preStartCommand` | Xray Analysis Custom command to run before startup. Runs AFTER the `common.preStartCommand` | |
| `analysis.nodeSelector` | Xray Analysis node selector | `{}` |
| `analysis.affinity` | Xray Analysis node affinity | `{}` |
| `analysis.tolerations` | Xray Analysis node tolerations | `[]` |
| `analysis.annotations` | Xray Analysis annotations | `{}` |
| `indexer.name` | Xray Indexer name | `xray-indexer` |
| `indexer.image` | Xray Indexer container image | `docker.bintray.io/jfrog/xray-indexer` |
| `indexer.annotations` | Xray Indexer annotations | `{}` |
| `indexer.updateStrategy` | Xray Indexer update strategy | `RollingUpdate` |
| `indexer.podManagementPolicy` | Xray Indexer pod management policy | `Parallel` |
| `indexer.internalPort` | Xray Indexer internal port | `7002` |
| `indexer.externalPort` | Xray Indexer external port | `7002` |
| `indexer.livenessProbe` | Xray Indexer livenessProbe | See `values.yaml` |
| `indexer.readinessProbe` | Xray Indexer readinessProbe | See `values.yaml` |
| `indexer.customVolumes` | Custom volumes | |
| `indexer.customVolumeMounts` | Custom Server volumeMounts | |
| `indexer.persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
| `indexer.persistence.storageClass` | Storage class of backing PVC | `nil (uses default storage class annotation)` |
| `indexer.persistence.enabled` | Xray Indexer persistence volume enabled | `false` |
| `indexer.persistence.accessMode` | Xray Indexer persistence volume access mode | `ReadWriteOnce` |
| `indexer.persistence.size` | Xray Indexer persistence volume size | `50Gi` |
| `indexer.resources` | Xray Indexer resources | `{}` |
| `indexer.preStartCommand` | Xray Indexer Custom command to run before startup. Runs AFTER the `common.preStartCommand` | |
| `indexer.nodeSelector` | Xray Indexer node selector | `{}` |
| `indexer.affinity` | Xray Indexer node affinity | `{}` |
| `indexer.tolerations` | Xray Indexer node tolerations | `[]` |
| `persist.name` | Xray Persist name | `xray-persist` |
| `persist.image` | Xray Persist container image | `docker.bintray.io/jfrog/xray-persist` |
| `persist.annotations` | Xray Persist annotations | `{}` |
| `persist.updateStrategy` | Xray Persist update strategy | `RollingUpdate` |
| `persist.podManagementPolicy` | Xray Persist pod management policy | `Parallel` |
| `persist.internalPort` | Xray Persist internal port | `7003` |
| `persist.externalPort` | Xray Persist external port | `7003` |
| `persist.livenessProbe` | Xray Persist livenessProbe | See `values.yaml` |
| `persist.readinessProbe` | Xray Persist readinessProbe | See `values.yaml` |
| `persist.persistence.size` | Xray Persist storage size limit | `10Gi` |
| `persist.preStartCommand` | Xray Persist Custom command to run before startup. Runs AFTER the `common.preStartCommand` | |
| `persist.resources` | Xray Persist resources | `{}` |
| `persist.nodeSelector` | Xray Persist node selector | `{}` |
| `persist.affinity` | Xray Persist node affinity | `{}` |
| `persist.tolerations` | Xray Persist node tolerations | `[]` |
| `server.name` | Xray server name | `xray-server` |
| `server.image` | Xray server container image | `docker.bintray.io/jfrog/xray-server` |
| `server.annotations` | Xray server annotations | `{}` |
| `server.customVolumes` | Custom volumes | |
| `server.customVolumeMounts` | Custom Server volumeMounts | |
| `server.replicaCount` | Xray services replica count | `1` |
| `server.updateStrategy` | Xray server update strategy | `RollingUpdate` |
| `server.podManagementPolicy` | Xray server pod management policy | `Parallel` |
| `server.internalPort` | Xray server internal port | `8000` |
| `server.externalPort` | Xray server external port | `80` |
| `server.service.name` | Xray server service name | `xray` |
| `server.service.type` | Xray server service type | `ClusterIP` |
| `server.service.annotations` | Xray server service annotations | `{}` |
| `server.livenessProbe` | Xray server livenessProbe | See `values.yaml` |
| `server.readinessProbe` | Xray server readinessProbe | See `values.yaml` |
| `server.preStartCommand` | Xray server Custom command to run before startup. Runs AFTER the `common.preStartCommand` | |
| `server.resources` | Xray server resources | `{}` |
| `server.nodeSelector` | Xray server node selector | `{}` |
| `server.affinity` | Xray server node affinity | `{}` |
| `server.tolerations` | Xray server node tolerations | `[]` |
| `router.name` | Router name | `router` |
| `router.image.repository` | Container image | `docker.bintray.io/jfrog/router` |
| `router.image.version` | Container image tag | `.Chart.AppVersion` |
| `router.image.pullPolicy` | Container pull policy | `IfNotPresent` |
| `router.internalPort` | Router internal port | `8082` |
| `router.externalPort` | Router external port | `8082` |
| `router.resources.requests.memory` | Router initial memory request | |
| `router.resources.requests.cpu` | Router initial cpu request | |
| `router.resources.limits.memory` | Router memory limit | |
| `router.resources.limits.cpu` | Router cpu limit | |
| `router.livenessProbe.enabled` | Enable Router livenessProbe | `true` |
| `router.livenessProbe.config` | Router livenessProbe configuration | See `values.yaml` |
| `router.readinessProbe.enabled` | Enable Router readinessProbe | `true` |
| `router.readinessProbe.config` | Router readinessProbe configuration | See `values.yaml` |
| `router.persistence.accessMode` | Router persistence access mode | `ReadWriteOnce` |
| `router.persistence.mountPath` | Router persistence mount path | `/var/opt/jfrog/router` |
| `router.persistence.size` | Router persistence size | `5Gi` |
| `router.readinessProbe.config` | Router readinessProbe configuration | See `values.yaml` |
| `router.readinessProbe.config` | Router readinessProbe configuration | See `values.yaml` |
| `router.nodeSelector` | Router node selector | `{}` |
| `router.affinity` | Router node affinity | `{}` |
| `router.tolerations` | Router node tolerations | `[]` |
| `filebeat.enabled` | Enable a filebeat container to send your logs to a log management solution like ELK | `false` |
| `filebeat.name` | filebeat container name | `xray-filebeat` |
| `filebeat.image.repository` | filebeat Docker image repository | `docker.elastic.co/beats/filebeat` |
| `filebeat.image.version` | filebeat Docker image version | `7.5.1` |
| `filebeat.logstashUrl` | The URL to the central Logstash service, if you have one | `logstash:5044` |
| `filebeat.livenessProbe.exec.command` | liveness probe exec command | see [values.yaml](stable/xray/values.yaml) |
| `filebeat.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 10 |
| `filebeat.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 180 |
| `filebeat.livenessProbe.periodSeconds` | How often to perform the probe | 10 |
| `filebeat.readinessProbe.exec.command` | readiness probe exec command | see [values.yaml](stable/xray/values.yaml) |
| `filebeat.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 10 |
| `filebeat.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | 180 |
| `filebeat.readinessProbe.periodSeconds` | How often to perform the probe | 10 |
| `filebeat.resources.requests.memory` | Filebeat initial memory request | |
| `filebeat.resources.requests.cpu` | Filebeat initial cpu request | |
| `filebeat.resources.limits.memory` | Filebeat memory limit | |
| `filebeat.resources.limits.cpu` | Filebeat cpu limit | |
| `filebeat.filebeatYml` | Filebeat yaml configuration file | see [values.yaml](stable/xray/values.yaml) |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
### Custom volumes
If you need to use a custom volume in a custom init or sidecar container, you can use this option.
For this, there is a section for defining custom volumes in the [values.yaml](values.yaml). By default it's commented out
```yaml
server:
## Add custom volumes
customVolumes: |
## Custom volume comes here ##
```
## Useful links
- https://www.jfrog.com/confluence/display/XRAY/Xray+High+Availability
- https://www.jfrog.com/confluence/display/EP/Getting+Started
- https://www.jfrog.com/confluence/

View File

@@ -1,6 +1,6 @@
dependencies:
- name: xray
repository: https://charts.jfrog.io/
version: 3.3.1
digest: sha256:22010f573f0dfaf95a05835e6b712ef74438aa7c5f39674cd8fd27390bc99d7e
generated: "2020-05-21T13:54:18.60088-07:00"
version: 4.1.2
digest: sha256:79e535f41be683f61d7f181a094d91f2688df43b7c3511be0c5c3216a6ce342b
generated: "2020-07-28T11:11:46.534466-07:00"

View File

@@ -1,4 +1,4 @@
dependencies:
- name: xray
version: 3.3.1
version: 4.1.2
repository: https://charts.jfrog.io/

View File

@@ -1,5 +1,6 @@
# Openshift Jfrog Xray
xray:
unifiedUpgradeAllowed: true
replicaCount: 1
xray:
masterKey: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@@ -31,7 +32,7 @@ xray:
name: xray-analysis
image:
repository: registry.connect.redhat.com/jfrog/xray-analysis
version: 3.3.0
version: 3.6.2
updateStrategy: RollingUpdate
podManagementPolicy: Parallel
preStartCommand:
@@ -39,14 +40,14 @@ xray:
name: xray-indexer
image:
repository: registry.connect.redhat.com/jfrog/xray-indexer
version: 3.3.0
version: 3.6.2
updateStrategy: RollingUpdate
podManagementPolicy: Parallel
persist:
name: xray-persist
image:
repository: registry.connect.redhat.com/jfrog/xray-persist
version: 3.3.0
version: 3.6.2
updateStrategy: RollingUpdate
podManagementPolicy: Parallel
persistence:
@@ -56,7 +57,7 @@ xray:
name: xray-server
image:
repository: registry.connect.redhat.com/jfrog/xray-server
version: 3.3.0
version: 3.6.2
updateStrategy: RollingUpdate
podManagementPolicy: Parallel
replicaCount: 1
@@ -64,7 +65,7 @@ xray:
name: router
image:
repository: registry.connect.redhat.com/jfrog/xray-router
version: 1.2.1
version: 1.4.2
imagePullPolicy: IfNotPresent
rabbitmq-ha:
enabled: true

View File

@@ -1,6 +1,12 @@
# JFrog Openshift Xray Chart Changelog
All changes to this chart will be documented in this file.
## [3.6.2] - July 28, 2020
* Deploying JFrog Xray 3.6.2 as an Operator into Openshift
## [3.5.2] - June 29, 2020
* Deploying JFrog Xray 3.5.2 as an Operator into Openshift
## [3.3.0] - May 22, 2020
* Deploying JFrog Xray 3.3.0 as an Operator initial version of Jfrog Xray supported

View File

@@ -1,62 +1,8 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via slack, issue, email, or any other method with the owners of this repository before making a change.
Note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
Ensure any install or build dependencies are removed before the end of the layer when doing a build.
# JFrog welcomes community contribution!
Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
Before we can accept your contribution, process your GitHub pull requests, and thank you full-heartedly, we request that you will fill out and submit JFrog's Contributor License Agreement (CLA).
Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is SemVer.
[Click here](https://secure.echosign.com/public/hostedForm?formid=5IYKLZ2RXB543N) to submit the JFrog CLA.
This should only take a minute to complete and is a one-time process.
You may merge the Pull Request in once you have the sign-off of one other developer.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment include:
```
Using welcoming and inclusive language
Being respectful of differing viewpoints and experiences
Gracefully accepting constructive criticism
Focusing on what is best for the company
Showing empathy towards other colleagues
```
Examples of unacceptable behavior by participants include:
```
The use of sexualized language or imagery and unwelcome sexual attention or advances
Trolling, insulting/derogatory comments, and personal or political attacks
Public or private harassment
Publishing others' private information, such as a physical or electronic address, without explicit permission
Other conduct which could reasonably be considered inappropriate in a professional setting
```
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project. Examples of representing a project include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
Attribution
This Code of Conduct is adapted from the [Contributor Covenant version 1.4] (http://contributor-covenant.org/version/1/4)
*Thanks for Your Contribution to the Community!* :-)

View File

@@ -1,4 +1,4 @@
packageName: openshiftxray-operator
channels:
- name: alpha
currentCSV: xray-operator.v1.0.0
currentCSV: xray-operator.v1.0.2

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More