-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Docker approach to test the client #64
Conversation
… URL http://jenkins_server:port/swarm/swarm-client.jar
…rm client that downloads the client from Jenkins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My recommendation would be to actually implement autotests using Docker Fixtures (embedded in JTH) or testcontainers, but it's aa pretty big effort
rm -rf /var/lib/apt/lists/* && \ | ||
rm -rf /var/cache/oracle-jdk8-installer | ||
ADD client/target/swarm-client.jar swarm-client.jar | ||
RUN curl -o http://jenkins:8080/swarm/swarm-client.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs the Jenkins image to be running when you build the image. IMHO it is not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the contrary: the purpose of this is to test the ability to download the Swarm client from Jenkins, so a Jenkins server must be up and running with the Swarm plugin (see the other PR I did)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sylv704 After playing with that a bit, I feel that the current Swarm client retrieval is not ideal. I would propose to do one o the following:
- Revert the ADD => RUN change for download of the client
- Modify the code to retrieve Swarm client when starting the container instead of bundling client when building it
The latter option would be preferable IMO.
This is up to you but I would instead do the contrary so that we can test that we can download the Swarm client from the server (see PR #62). |
So yes, I stick to the "Modify the code to retrieve Swarm client when starting the container instead of bundling client when building it" proposal. Do you agree @sylv704 ? |
Yes, I agree |
FYI, #81 implements an integration testing suite for this plugin by downloading the Swarm Client from the server (as suggested above) but without using Docker. |
Closing in favor of #81. |
Following the pull request to be able to download the Swarm client from a Jenkins server where the Swarm plug-in has been installed, here is an improvement of the way the Swarm plug-in can be tested in Docker. The PR consists in the following:
Makefile
to automate the build and run phases with the items previously detailed. Existing targets:build
: compile the plugin (mvn clean package
)install
: install the plugin-in Jenkinsrun
: starts the containers (docker-compose up
)stop
: stops the containers (docker-compose stop
)clean
:stop
+ cleans the Jenkins home directory so that the next installation will proceed again with a clean Jenkins serverdeepclean
:clean
+ destroys the containers (docker-compose down
)