Skip to content

Commit

Permalink
Release/montee version 5.0.x et plugin jira (#4)
Browse files Browse the repository at this point in the history
* Variabilisation du servername de squashtm.
* Montée de version de 4.0.2 à 5.0.1
* ajout des plugins et du trustore Java des AC ANS
* Mise en place d'un template qui récupère le fichier log4j sur Artifactory et le surcharge dans l'application (numéro sur Artifactory qui dépend de la version majeure de squashtm).

---------

Co-authored-by: Karine <karine.guilloux.ext@sante.gouv.fr>
Co-authored-by: SBENIC <selsebil.ibn-charrada.ext@esante.gouv.fr>
  • Loading branch information
3 people authored Jul 11, 2023
1 parent 5ef2685 commit 5f4a427
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 6 deletions.
108 changes: 103 additions & 5 deletions squashtm-app/forge-squashtm-premium.nomad.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,44 @@ job "forge-squashtm-premium" {

task "squashtm" {
driver = "docker"
artifact {
source = "${repo_url}/artifactory/ext-tools/squash-tm/plugins/Jira_Cloud/${pluginjaxbapi}"
options {
archive = false
}
}

artifact {
source = "${repo_url}/artifactory/ext-tools/squash-tm/plugins/Jira_Cloud/${pluginjaxbimpl}"
options {
archive = false
}
}

artifact {
source = "${repo_url}/artifactory/ext-tools/squash-tm/plugins/Jira_Cloud/${pluginbugtrackerjiracloud}"
options {
archive = false
}
}

# Récupération du fichier log4j sur Artifactory
artifact {
source = "${repo_url}/artifactory/ext-tools/squash-tm/conf/5.0.x/log4j2.xml"
options {
archive = false
}
}

# Mise en place du trustore java avec les AC ANS
artifact {
source = "${repo_url}/artifactory/asip-ac/truststore/cacerts"
options {
archive = false
}
}

template {
data = <<EOH
SQTM_DB_TYPE=postgresql
Expand All @@ -51,6 +89,16 @@ EOH
change_mode = "restart"
}

# Ajout d'une configuration pour le proxy sortant
template {
data = <<EOH
JAVA_TOOL_OPTIONS="-Djava.awt.headless=true -Dhttps.proxyHost=${url_proxy_sortant_https_host} -Dhttps.proxyPort=${url_proxy_sortant_https_port} -Dhttp.proxyHost=${url_proxy_sortant_http_host} -Dhttp.proxyPort=${url_proxy_sortant_http_port} -Dhttp.nonProxyHosts=${url_proxy_sortant_no_proxy}"
EOH
destination = "local/java.env"
change_mode = "restart"
env = true
}

config {
image = "${image}:${tag}"
ports = ["http"]
Expand All @@ -64,16 +112,66 @@ EOH
propagation = "rshared"
}
}
}

# Fichier de configuration log4j2
mount {
type = "bind"
target = "/opt/squash-tm/conf/log4j2.xml"
source = "local/log4j2.xml"
readonly = false
bind_options {
propagation = "rshared"
}
}

mount {
type = "bind"
target = "/opt/squash-tm/plugins/${pluginjaxbapi}"
source = "local/${pluginjaxbapi}"
readonly = true
bind_options {
propagation = "rshared"
}
}

mount {
type = "bind"
target = "/opt/squash-tm/plugins/${pluginjaxbimpl}"
source = "local/${pluginjaxbimpl}"
readonly = true
bind_options {
propagation = "rshared"
}
}

mount {
type = "bind"
target = "/opt/squash-tm/plugins/${pluginbugtrackerjiracloud}"
source = "local/${pluginbugtrackerjiracloud}"
readonly = true
bind_options {
propagation = "rshared"
}
}
# Trustore java contenant les AC ANS
mount {
type = "bind"
target = "/opt/java/openjdk/lib/security/cacerts"
source = "local/cacerts"
readonly = true
bind_options {
propagation = "rshared"
}
}
}
resources {
cpu = 2000
cpu = 600
memory = 4096
}

service {
name = "$\u007BNOMAD_JOB_NAME\u007D"
tags = ["urlprefix-squash.asipsante.fr/"]
tags = ["urlprefix-${servername_squash}/"]
port = "http"
check {
name = "alive"
Expand All @@ -84,6 +182,6 @@ EOH
port = "http"
}
}
}
}
}
}
}
59 changes: 58 additions & 1 deletion squashtm-app/waypoint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,26 @@ app "forge/squashtm-app" {
image = var.image
tag = var.tag
datacenter = var.datacenter
pluginjaxbapi = var.pluginjaxbapi
pluginjaxbimpl = var.pluginjaxbimpl
pluginbugtrackerjiracloud = var.pluginbugtrackerjiracloud
servername_squash = var.servername_squash
url_proxy_sortant_http_host = var.url_proxy_sortant_http_host
url_proxy_sortant_https_host = var.url_proxy_sortant_https_host
url_proxy_sortant_http_port = var.url_proxy_sortant_http_port
url_proxy_sortant_https_port = var.url_proxy_sortant_https_port
url_proxy_sortant_no_proxy = var.url_proxy_sortant_no_proxy
repo_url = var.repo_url
})
}
}
}

variable "servername_squash" {
type = string
default = "squash.asipsante.fr"
}

variable "datacenter" {
type = string
default = "test"
Expand All @@ -45,5 +60,47 @@ variable "image" {

variable "tag" {
type = string
default = "4.0.2"
default = "5.0.1"
}
variable "pluginjaxbapi" {
type = string
default = "jaxb-api-2.2.2.jar"
}

variable "pluginjaxbimpl" {
type = string
default = "jaxb-impl-2.2.3.jar"
}

variable "pluginbugtrackerjiracloud" {
type = string
default = "bugtracker.jiracloud-5.0.0.RELEASE.jar"
}
variable "url_proxy_sortant_http_host" {
type = string
default = "c-ac-proxy01.asip.hst.fluxus.net"
}

variable "url_proxy_sortant_https_host" {
type = string
default = "c-ac-proxy01.asip.hst.fluxus.net"
}

variable "url_proxy_sortant_http_port" {
type = string
default = "3128"
}

variable "url_proxy_sortant_https_port" {
type = string
default = "3128"
}

variable "url_proxy_sortant_no_proxy" {
type = string
default = "\"*.asip.hst.fluxus.net|*.esante.gouv.fr|*.asipsante.fr\""
}
variable "repo_url" {
type = string
default = "https://repo.proxy.prod.forge.esante.gouv.fr"
}

0 comments on commit 5f4a427

Please sign in to comment.