Maybe, if you ask more specific questions? It's hard to see what exactly
didn't work on your end, and I doubt that:

- Nobody does this
- It doesn't work in general

I recommend doing this all the time for Maven and Flyway:
https://blog.jooq.org/using-testcontainers-to-generate-jooq-code/

And I'm sure it'll work for Gradle and Liquibase too. I have tasks open to
do this myself for jOOQ's MCVE and demo projects, e.g.
https://github.com/jOOQ/jOOQ-mcve/issues/41

But didn't get around to it yet.

On Thu, Feb 22, 2024 at 10:01 AM Pasha Finkelshtein <
pavel.finkelsht...@gmail.com> wrote:

> I tried, no luck yet :)
>
> But I believe it's just something nobody did - launch a container for
> build, not for tests.
> Also, LiquibaseDatabase won't work for me, because I use `CALL` in my
> migrations, which creates a lot of entities in the DB...
>
> On Thu, 22 Feb 2024, 09:58 Lukas Eder, <lukas.e...@gmail.com> wrote:
>
>> Well, surely testscontainers folks will be able to help with
>> testcontainers specific issues?
>>
>> On Thu, Feb 22, 2024 at 9:44 AM Pasha Finkelshtein <
>> pavel.finkelsht...@gmail.com> wrote:
>>
>>> Certainly it should work, but I can't start test containers within the
>>> Gradle build :(
>>> doLast should not be even needed — Ryuk will take care of shutting the
>>> container down
>>> Also, we need to run Liquibase migrations, so I think bringing container
>>> up should be a separate task too
>>>
>>>
>>> [image: facebook] <https://fb.com/asm0dey>
>>> [image: twitter] <https://twitter.com/asm0di0>
>>> [image: linkedin] <https://linkedin.com/in/asm0dey>
>>> [image: instagram] <https://instagram.com/asm0dey>
>>>
>>> Pasha Finkelshteyn
>>>
>>> Developer Advocate for Data Engineering
>>>
>>> JetBrains
>>>
>>>
>>>
>>> asm0...@jetbrains.com
>>> https://linktr.ee/asm0dey
>>>
>>> Find out more <https://jetbrains.com>
>>>
>>>
>>>
>>> On Thu, 22 Feb 2024 at 08:46, Lukas Eder <lukas.e...@gmail.com> wrote:
>>>
>>>> Hi Pasha,
>>>>
>>>> I haven't tried yet, but it seems that Task.doFirst() and Task.doLast()
>>>> could help here?
>>>>
>>>> E.g.
>>>>
>>>> tasks.named("jooqCodegen") {
>>>>     doFirst {
>>>>         // Start testcontainers
>>>>     }
>>>>     doLast {
>>>>         // Stop testcontainers
>>>>     }
>>>> }
>>>>
>>>>
>>>> You might add some additional logic to coordinate liquibase with
>>>> jooqCodegen
>>>>
>>>> I hope this helps
>>>>
>>>> On Thu, Feb 22, 2024 at 8:41 AM Pasha Finkelshtein <
>>>> pavel.finkelsht...@gmail.com> wrote:
>>>>
>>>>> Hi everybody!
>>>>>
>>>>> I wanna do the following during my Gradle build:
>>>>>
>>>>>
>>>>>    1. Launch docker (test?) container with postgres
>>>>>    2. Run my Liquibase migrations on it
>>>>>    3. Regenerate jOOQ code from the database
>>>>>    4. Bring the container down
>>>>>
>>>>> However, I didn't find a working way to launch a (test)container
>>>>> during the build. Did anybody succeed in doing this?
>>>>>
>>>>> Best,
>>>>> Pasha
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "jOOQ User Group" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to jooq-user+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/jooq-user/3422abd2-8312-4fc4-8476-82b6bf3b25ebn%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/jooq-user/3422abd2-8312-4fc4-8476-82b6bf3b25ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "jOOQ User Group" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/jooq-user/WYKlwguBHwE/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> jooq-user+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO5wcrgPJj9vKNS4Pr33E-0xhnTDKAn7kWwir-ma7XM1eA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO5wcrgPJj9vKNS4Pr33E-0xhnTDKAn7kWwir-ma7XM1eA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "jOOQ User Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jooq-user+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jooq-user/CAO4yE_bi%3DiPeDNSj0fgxc-mcSiUfxSUHpennN%3DuM7FKJZ%3Dj%3DWQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jooq-user/CAO4yE_bi%3DiPeDNSj0fgxc-mcSiUfxSUHpennN%3DuM7FKJZ%3Dj%3DWQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "jOOQ User Group" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jooq-user/WYKlwguBHwE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> jooq-user+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO5LOu3f7h5s_vsmz59Vw4kbHwxbf656DK5d76fk%2BHZu3Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO5LOu3f7h5s_vsmz59Vw4kbHwxbf656DK5d76fk%2BHZu3Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jooq-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/CAO4yE_ZD0i7L8YxLt_EEMYkEpT2r_a73OvHczKUHRxyAjdMxKQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jooq-user/CAO4yE_ZD0i7L8YxLt_EEMYkEpT2r_a73OvHczKUHRxyAjdMxKQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO42j5qVaW9yW%3DE-i_cEX2enxdnNns7umSgKQbx%3DidK6pA%40mail.gmail.com.

Reply via email to