There was a case that the test that passed locally did not pass on CircleCi, so I connected it to the CircleCi container with ssh and debugged. Generally, it is as Official, but I think that there may be some supplements, so I will leave the procedure at that time. I will. It's a windows environment, so don't be afraid.
--It is assumed that ssh cannot be used. --If you haven't done so already, please refer to here. --It is assumed that you also have an account on github and CircleCi.
To connect to CircleCi with ssh, you need to be able to connect to github with ssh. I think you should set it referring to here.
Access CircleCi and select "Rerun Job With SSH" for the Job you want to debug. You should select Job instead of WorkFlow.
The Enable SSH step is added to start the workflow as shown below. The port number and host ip address are displayed in the white frame below, so use this to connect to the container with ssh.
Connect to the container with ssh based on the information displayed earlier. If you are asked if you want to connect on the way, just answer yes.
ssh -p <port> <ip address>
Now that you are connected to the container, you should be able to get various information necessary for debugging. You can also download the container files and directories by using the following scp while returning to local.
scp -r -P <port> root@<ip address>:<The path of the directory you want to copy> <Local download destination path>
Even if I use Docker, the results on CircleCi may be different from those on Local and CircleCi, and I debug at that time. In the first place, I would like to learn about Docker and OS so that debugging is not necessary.
Recommended Posts