Closed kashifch closed 5 years ago
Regarding your questions:
cypress/base:10
, I would suggest removing the Dockerfile from this repo, as it could lead to confusion.Additionally, using Dockerfiles as agents in Jenkins pipelines is currently not great. It requires that the Docker daemon runs on Jenkins master, and all of the containers get downloaded and cached on master. This isn't great for security, performance or disk space issues. It works fine when testing locally, but build-jenkins sometimes manages hundreds of connected ec2 workers and needs to be performant. We eventually want to move towards using Kubernetes to manage Jenkins and workers (this will be great for local development AND live deployment). For now, although it isn't great, I have to suggest the following:
jenkins-worker
(which has everything needed for running the platform, but is a rather large ec2 instance). We can always create a special worker for you that is small enough and only has docker or whatever you need installed.docker pull X; docker run Y;
. This is the tricky part, because if you are using the public image, your code won't be on the container, so you would need to get it onto the container and get the results off of it. Let me think about the best way to handle this. Unfortunately, we are just starting to incorporate Docker into our pipelines and we haven't worked all of the kinks out.Yes, this is the correct approach. In order to get the credentials into Jenkins, you will have to work with the Developer Experience team (or soon DevOps) to get them loaded into Jenkins
I would recommend archiving/publishing any resulting files from the test run. Does Cypress create a test report? Take screenshots? Generate logs? All of these can be helpful for people who need to debug the test run. You will likely later want to include this job in the release pipeline, which will require you to write Gomatic/Tubular scripts to query the status of this job to see if it is a pass or fail.
@estute
Thanks a lot for your detailed response, I will make the suggested changes
HI @estute
I have created a simple jenkinsfile for my cypress tests, can you take a look and suggest any enhancements/changes.
I tested it by setting up a local jenkins and it seems to be working fine.
There are some areas where I need some guidance
1) I have used a docker image for all pre-requisites of cypress installation, is that a good approach or do I need to figure out all pre-reqs and install these using a script/manually 2) For env vars I have used secret text option, is it a good approach 3) Do I need to perform some actions after the tests are run
Thanks, Kashif