Skip to content

Commit

Permalink
feat: add integration environment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lwih committed Dec 20, 2024
1 parent 217019f commit 860cafe
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci/templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
environment:
- ENV_DB_URL=jdbc:postgresql://db:5432/{{ rapportnav_psql_db }}?user={{ rapportnav_psql_user }}&password={{ rapportnav_psql_pwd }}
- MONITORFISH_API_KEY={{ rapportnav_monitorfish_api_key }}
- SPRING_PROFILES_ACTIVE=prod
- SPRING_PROFILES_ACTIVE=prod // THIS HAS TO CHANGE !!!!!!!!!!
ports:
- 80:80
# volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import fr.gouv.dgampa.rapportnav.infrastructure.utils.GsonSerializer
import org.n52.jackson.datatype.jts.JtsModule
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Repository
import org.springframework.web.util.UriUtils
import java.net.URI
Expand All @@ -26,17 +27,15 @@ import java.time.Instant
@Repository
class APIEnvMissionRepository(
private val mapper: ObjectMapper,
private val clientFactory: HttpClientFactory
private val clientFactory: HttpClientFactory,
@Value("\${monitorenv.host}") private val host: String,
) : IEnvMissionRepository {
private val logger: Logger = LoggerFactory.getLogger(APIEnvMissionRepository::class.java);

private val gson = GsonSerializer().create()

private val client = clientFactory.create();

// TODO set as env var when available
private val host = "https://monitorenv.din.developpement-durable.gouv.fr"

override fun findMissionById(missionId: Int): MissionEntity? {
val url = URI.create("$host/api/v1/missions/$missionId")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,14 @@ import java.net.http.HttpResponse
@Repository
class APIFishActionRepository(
private val mapper: ObjectMapper,
private val clientFactory: HttpClientFactory
private val clientFactory: HttpClientFactory,
@Value("\${monitorfish.host}") private val host: String,
@Value("\${MONITORFISH_API_KEY}") private var monitorFishApiKey: String,
) : IFishActionRepository {
private val logger: Logger = LoggerFactory.getLogger(APIFishActionRepository::class.java)

private val gson = GsonSerializer().create()


@Value("\${MONITORFISH_API_KEY}")
private lateinit var monitorFishApiKey: String

// TODO set as env var when available
private val host = "https://monitorfish.din.developpement-durable.gouv.fr"

override fun findFishActions(missionId: Int): List<MissionAction> {
logger.info("Fetching Fish Actions for Mission id=$missionId")
val request = HttpRequest.newBuilder()
Expand Down
34 changes: 34 additions & 0 deletions infra/configurations/backend/application-integration.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
################
################
# Spring
#spring.datasource.url=
################
################
# Logging
logging.level.org.springframework.web=DEBUG
logging.level.org.springframework.security=DEBUG
################
################
# DSI proxy
host.proxy.host=172.27.229.197
host.proxy.port=8090
################
################
#Sentry
sentry.enabled=true
sentry.dsn=https://8857258f9f1549968b13e15759bdf2bc@sentry.incubateur.net/121
sentry.traces-sample-rate=1.0
sentry.environment=production
################
################
#AEM Export
rapportnav.aem.template.path=/template_export_aem_PAM.xlsx
rapportnav.aem.tmp_xlsx.path=tmp_AEM_PAM.xlsx
rapportnav.aem.tmp_ods.path=tmp_AEM_PAM.ods
#AEM Export
rapportnav.rapport-patrouille.template.path=/template_export_rapport_patrouille_PAM.docx
rapportnav.rapport-patrouille.tmp_docx.path=tmp_rapport_patrouille_PAM.docx
rapportnav.rapport-patrouille.tmp_odt.path=tmp_rapport_patrouille_PAM.odt
# MonitorEnv & MonitorFish
monitorfish.host=http://monitorfish-test.csam.e2.rie.gouv.fr
monitorenv.host=http://monitorenv-test.csam.e2.rie.gouv.fr
3 changes: 3 additions & 0 deletions infra/configurations/backend/application-local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ rapportnav.aem.tmp_ods.path=tmp_AEM_PAM.ods
rapportnav.rapport-patrouille.template.path=/template_export_rapport_patrouille_PAM.docx
rapportnav.rapport-patrouille.tmp_docx.path=tmp_rapport_patrouille_PAM.docx
rapportnav.rapport-patrouille.tmp_odt.path=tmp_rapport_patrouille_PAM.odt
# MonitorEnv & MonitorFish
monitorfish.host=https://monitorfish.din.developpement-durable.gouv.fr
monitorenv.host=https://monitorenv.din.developpement-durable.gouv.fr
3 changes: 3 additions & 0 deletions infra/configurations/backend/application-prod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ rapportnav.aem.tmp_ods.path=tmp_AEM_PAM.ods
rapportnav.rapport-patrouille.template.path=/template_export_rapport_patrouille_PAM.docx
rapportnav.rapport-patrouille.tmp_docx.path=tmp_rapport_patrouille_PAM.docx
rapportnav.rapport-patrouille.tmp_odt.path=tmp_rapport_patrouille_PAM.odt
# MonitorEnv & MonitorFish
monitorfish.host=https://monitorfish.din.developpement-durable.gouv.fr
monitorenv.host=https://monitorenv.din.developpement-durable.gouv.fr

0 comments on commit 860cafe

Please sign in to comment.