Hello to all,
I would like to configure a Jenkinsfile for a RoR project with a PostgreSQL
database, but the syntax and the documentation is driving me crazy.
As I understand, if I want my RoR app to run in a Docker container and my
Postgres Db to run in another container, I need to use something like this:
node {
docker.image('postgres:11.3').withRun("--env POSTGRES_USER=user --env
POSTGRES_PASSWORD=password -p 54321:5432") { c ->
docker.build('test-image', './ci').inside("--link ${c.id}")
}
}
but, if the pipeline syntax tells me that I need to declare an agent, like
this:
pipeline {
agent {
...
}
stages {
...
}
}
where do I need to declare the containers I'm creating?
Am I doing this wrong? Is it impossible to have it this way, in two
containers? Can someone, please, provide me with a full example of it?
Thank you in advance!
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/960edcc1-cd04-431a-8279-7d707062a3be%40googlegroups.com.