Jenkins + Docker

I would like to create a continuous integration workflow using Jenkins + BitBucket + Docker + Python.

Here are all the steps that I imagine:

  • The user clicks on the python application code with the test module and the Docker file.
  • BitBucket connect work to jenkins
  • Jenkins clones the repository.
  • Jenkins creates a Docker file.
  • Jenkins launches a docker image that runs test cases. My test case is hooked.
  • If all the tests pass, Jenkins clicks the image on the Docker Hub.

Is this the right / good approach?
Does anyone have any experience with this? Does anyone have any links / documents to help me?

+5
source share
2 answers

This is a very good approach. You have already answered your question. Therefore, it is clear to you that this is an approach supported by Docker.

Hint: when you also want to host your application (perhaps at a later stage), it is recommended that you use OpenShift V3 from Red Hat Docu .

This platform also works with Docker. You can run Jenkins in a Docker container. You can configure this Jenkins to run build-test-deploy of your own application. The application will be deployed in another Docker container. This allows you to use webcams, scale your application and ensure its high availability.

0
source

Using Jenkins with Python and Git on Docker

This was a problem that I encountered, and I thought that I would try to solve it decisively. Jenkins is great, but when you want to move it to another system, you understand how much luggage you created by installing one service after another on which it relies. Separating this from Docker is a great choice, but the one that Jenkins does is very barefoot.

Dockerfile

My article explaining the docker file and how to use or expand it

I mention how to expand it towards the end, but the explicit solution would be to change the line that I mentioned:

ENV BASE_APKS="sudo openssl openssh-client zip ttf-dejavu maven ruby" \ 

to

 ENV BASE_APKS="sudo openssl openssh-client zip ttf-dejavu maven ruby python" \ 

And then rebuild with

 docker build -t mycompany/jenkins . 
0
source

Source: https://habr.com/ru/post/1236254/


All Articles