testcontainers - Quarkus dynamic keys ? Is it possible? - Stack Overflow

I'm trying to configure my Quarkus application to map a volume during the test phase.datasource:de

I'm trying to configure my Quarkus application to map a volume during the test phase.

    datasource:
        devservices:
            enabled: true
            volumes:
                ${INIT_SQL_SCRIPTS_PATH}: /container-entrypoint-initdb.d

The ${INIT_SQL_SCRIPTS_PATH} property is defined in two places:

  • in a maven profile activated for the Windows OS
  • in Jenkins, as an environment property

Unfortunately, even if I see that the property is found (I ran mvn -X and the logs mention it), it's not injected in the volume mapping. The error that I see is:

2025-02-03 09:17:24,799 ERROR [tc.doc.io/gvenzl/oracle-free:23-slim-faststart] (build-61) Could not start container: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"invalid volume specification: 'C:\my_app\${INIT_SQL_SCRIPTS_PATH}:/container-entrypoint-initdb.d:rw,z'"}

Any suggestion ?

I'm trying to configure my Quarkus application to map a volume during the test phase.

    datasource:
        devservices:
            enabled: true
            volumes:
                ${INIT_SQL_SCRIPTS_PATH}: /container-entrypoint-initdb.d

The ${INIT_SQL_SCRIPTS_PATH} property is defined in two places:

  • in a maven profile activated for the Windows OS
  • in Jenkins, as an environment property

Unfortunately, even if I see that the property is found (I ran mvn -X and the logs mention it), it's not injected in the volume mapping. The error that I see is:

2025-02-03 09:17:24,799 ERROR [tc.doc.io/gvenzl/oracle-free:23-slim-faststart] (build-61) Could not start container: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"invalid volume specification: 'C:\my_app\${INIT_SQL_SCRIPTS_PATH}:/container-entrypoint-initdb.d:rw,z'"}

Any suggestion ?

Share Improve this question asked Feb 3 at 9:18 IonutIonut 1
Add a comment  | 

1 Answer 1

Reset to default 0

Quarkus doesn't replace the keys, only the values. My workaround was to use the resources plugin to replace the INIT_SQL_SCRIPTS_PATH placeholder with the proper path, depending on the environment.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745247334a4618469.html

相关推荐

  • testcontainers - Quarkus dynamic keys ? Is it possible? - Stack Overflow

    I'm trying to configure my Quarkus application to map a volume during the test phase.datasource:de

    6小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信