Spring Cloud Config: Which searchPaths for profiles within subdirectories

35 views Asked by At

I have a GIT-Repo with many Projects within - Note: Can't change the structure of the GIT-Repo.

The following structure is given:

Project1 (directory)

  subdirectories  (directories)

     applicationname  (directory) (spring-applicationname)
       
       profile.yml (file) (spring.profile)  

Project2 (directory)

  subdirectories (directories)

     applicationname (directory) (spring-applicationname)
       
      profile.yml (file) (spring.profile)  

What I'm trying to achieve is for the Config Server to point to only one project, meaning the root of the Config Server should be, for example, Project1. Then there are many subdirectories and in one of them is the applicationname (as a directory) with the Profile.yml-File

From there, when making a query like this: config-server-url/applicationname/profile, the correct file should be returned.

I have tried the following searchPaths:

Project1/*/{application}/{profile}

{application}/{profile}

*/**

However, I am only getting an empty JSON in response.

{
    "name": "applicationname",
    "profiles": [
        "prod"
    ],
    "label": null,
    "version": "",
    "state": null,
    "propertySources": []
}

Is that even possible and what would the actual searchPath be?

I have tried the following searchPaths:

Project1/*/{application}/{profile}

{application}/{profile}

*/**
0

There are 0 answers