Skip to content

Commit

Permalink
Upgrade platform chart to 11.0.1. Us the new sizing files from within…
Browse files Browse the repository at this point in the history
… this chart (#13)
  • Loading branch information
eldada authored Feb 15, 2025
1 parent 2ea25dd commit 8acccc4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 61 deletions.
2 changes: 1 addition & 1 deletion 3.artifactory-install/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
variable "chart_version" {
default = "107.98.13"
default = "107.104.7"
}
2 changes: 1 addition & 1 deletion 6.artifactory-aws-install/artifactory.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "null_resource" "shell" {
command = "rm -rf artifactory-*.tgz"
}
provisioner "local-exec" {
command = "helm fetch artifactory --version ${var.artifactory_chart_version} --repo https://charts.jfrog.io --untar"
command = "helm fetch artifactory --version ${var.artifactory_chart_version} --repo ${var.jfrog_charts_repository} --untar"
}
}

Expand Down
6 changes: 5 additions & 1 deletion 6.artifactory-aws-install/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ variable "namespace" {
default = "jfrog"
}

variable "jfrog_charts_repository" {
default = "https://charts.jfrog.io"
}

variable "artifactory_chart_version" {
default = "107.98.12"
default = "107.104.7"
}

variable "deploy_metrics_server" {
Expand Down
57 changes: 2 additions & 55 deletions 7.jfrog-platform-aws-install/jfrog-platform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,16 @@ provider "kubernetes" {
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
}

## Until sizing specs are part of the jfrog-platform chart, we pull them from the individual charts that are inside the platform chart
# Fetch the JFrog Platform Helm chart and untar it to the current directory so we can use the sizing files to create the final values files
# Fetch the JFrog Platform Helm chart and untar it to the current directory so we can use the sizing yaml files
resource "null_resource" "fetch_platform_chart" {
provisioner "local-exec" {
command = "rm -rf jfrog-platform-*.tgz"
}
provisioner "local-exec" {
command = "helm fetch jfrog-platform --version ${var.jfrog_platform_chart_version} --repo https://charts.jfrog.io --untar"
command = "helm fetch jfrog-platform --version ${var.jfrog_platform_chart_version} --repo ${var.jfrog_charts_repository} --untar"
}
}

################### Artifactory sizing
## Prepare the final values files for the JFrog Platform sizing
data "local_file" "artifactory_sizing" {
filename = "${path.module}/jfrog-platform/charts/artifactory/sizing/artifactory-${var.sizing}.yaml"
depends_on = [null_resource.fetch_platform_chart]
}

# Inject two spaces before all lines and load into a variable
locals {
indented_artifactory_sizing = join("\n", [for line in split("\n", data.local_file.artifactory_sizing.content) : " ${line}"])
}

# Create the new artifactory sizing YAML string
locals {
new_artifactory_sizing = <<-EOT
artifactory:
${local.indented_artifactory_sizing}
EOT
}

# Write the new Artifactory YAML to a file
resource "local_file" "new_artifactory_sizing" {
filename = "${path.module}/jfrog-artifactory-${var.sizing}-adjusted.yaml"
content = trimspace(local.new_artifactory_sizing)
}

################### Xray sizing
## Prepare the final values files for the JFrog Platform sizing
data "local_file" "xray_sizing" {
filename = "${path.module}/jfrog-platform/charts/xray/sizing/xray-${var.sizing}.yaml"
depends_on = [null_resource.fetch_platform_chart]
}

# Inject two spaces before all lines and load into a variable
locals {
indented_xray_sizing = join("\n", [for line in split("\n", data.local_file.xray_sizing.content) : " ${line}"])
}

# Create the new Xray sizing YAML string
locals {
new_xray_sizing = <<-EOT
xray:
${local.indented_xray_sizing}
EOT
}

# Write the new Xray YAML to a file
resource "local_file" "new_xray_sizing" {
filename = "${path.module}/jfrog-xray-${var.sizing}-adjusted.yaml"
content = trimspace(local.new_xray_sizing)
}

# Create an empty artifactory-license.yaml if missing
resource "local_file" "empty_license" {
count = fileexists("${path.module}/artifactory-license.yaml") ? 0 : 1
Expand Down
3 changes: 1 addition & 2 deletions 7.jfrog-platform-aws-install/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ output "_05_setting_cluster_kubectl_context" {
}

# Output the command to install Artifactory with Helm
# TODO: Fix Xray sizing breaking the template
output "_06_jfrog_platform_install_command" {
description = "The Helm command to install the JFrog Platform (after setting up kubectl context)"
value = "helm upgrade --install jfrog jfrog/jfrog-platform --version ${var.jfrog_platform_chart_version} --namespace ${var.namespace} --create-namespace -f ${path.module}/jfrog-values.yaml -f ${path.module}/artifactory-license.yaml -f ${path.module}/jfrog-artifactory-${var.sizing}-adjusted.yaml -f ${path.module}/jfrog-custom.yaml --timeout 600s"
value = "helm upgrade --install jfrog jfrog/jfrog-platform --version ${var.jfrog_platform_chart_version} --namespace ${var.namespace} --create-namespace -f ${path.module}/jfrog-values.yaml -f ${path.module}/artifactory-license.yaml -f ${path.module}/jfrog-platform/sizing/platform-${var.sizing}.yaml -f ${path.module}/jfrog-custom.yaml --timeout 600s"
}
6 changes: 5 additions & 1 deletion 7.jfrog-platform-aws-install/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,12 @@ variable "namespace" {
default = "jfrog"
}

variable "jfrog_charts_repository" {
default = "https://charts.jfrog.io"
}

variable "jfrog_platform_chart_version" {
default = "11.0.0"
default = "11.0.1"
}

variable "deploy_metrics_server" {
Expand Down

0 comments on commit 8acccc4

Please sign in to comment.