slim icon indicating copy to clipboard operation
slim copied to clipboard

slim ci-cd-integration

Open mercenarysre opened this issue 2 years ago • 4 comments

Integrating Slim across CI/CD environments is showcased in the repo, however, there should be demonstrated examples across CI/CD environments.

mercenarysre avatar Sep 16 '23 11:09 mercenarysre

Hello @kcq, about demonstrated examples of using Slim across CI/CD environments, I have uploaded a use case for Jenkins and Github Actions here--https://github.com/TomiwaAribisala-git/slim-ci-cd-integration, I look forward to your favorable response, thanks.

mercenarysre avatar Sep 23 '23 21:09 mercenarysre

Hello, I am trying to integrate slim into my Jenkins pipeline for my nodejs backend image as well. However, slim is trying to run the container on build command and my image doesn't run because it cannot connect to any database in pipeline. What do you suggest for this? Should I create database specificly for it to connect to during Jenkins pipeline?

Some details: I am not running a SaaS application or anything. I ship my database as another docker image so that the output image of my Jenkins nodejs pipeline and the database image can be run together using docker compose. It's not even only the 2 of them. I have several repositories and several Jenkins jobs to create images that will result in an application. And the containers have socket connections and api calls to each other etc. I know that docker compose file can be passed to slim but in a specific Jenkins job, it doesn't have access to all images so it can't run docker compose up [-d] successfully either. Should I make every image available to Jenkins so that it can successfully analyze them in pipeline or should I avoid trying to use slim in Jenkins for such a complicated case?

ybalcanci avatar Dec 15 '23 13:12 ybalcanci

Hello, I am trying to integrate slim into my Jenkins pipeline for my nodejs backend image as well. However, slim is trying to run the container on build command and my image doesn't run because it cannot connect to any database in pipeline. What do you suggest for this? Should I create database specificly for it to connect to during Jenkins pipeline?

Some details: I am not running a SaaS application or anything. I ship my database as another docker image so that the output image of my Jenkins nodejs pipeline and the database image can be run together using docker compose. It's not even only the 2 of them. I have several repositories and several Jenkins jobs to create images that will result in an application. And the containers have socket connections and api calls to each other etc. I know that docker compose file can be passed to slim but in a specific Jenkins job, it doesn't have access to all images so it can't run docker compose up [-d] successfully either. Should I make every image available to Jenkins so that it can successfully analyze them in pipeline or should I avoid trying to use slim in Jenkins for such a complicated case?

@ybalcanci If the database is the only "must have" dependency for your image than one of the options is to reference an existing database running somewhere using an environment variable (assuming your image supports passing the database connection string through an environment variable). For example, in some of my tests I have a SaaS hosted database and then I add an --env flag to the slim build command to pass the database connection string for it. If your image has other external container dependencies too (beyond just that database dependency) than you can try to use the same env var approach or you can try using the compose functionality in slim (yes, if you go this direction you'll need to make sure the images referenced in the compose file are accessible in your Jenkins job)

kcq avatar Dec 17 '23 17:12 kcq

@kcq I see, thanks for the clarification.

ybalcanci avatar Dec 17 '23 19:12 ybalcanci