0

I’m making integration test repo which stays inside the Docker image running on the AWS instance. Actually, whenever i wanna update the integration test scripts from GitHub to AWS instance, i need to ssh manually to instance then type the command git pull to get the latest code from GitHub repo contains the test scripts. My intention is whenever there’s a merge action in GitHub repo (master branch) , i want Jenkins to automatically update it to the integration test repo in my AWS instance, so that the testing won’t be obsoleted somehow (in holidays and no one in charges for update the scripts).

So, could anyone give me recommendation and idea to make it ?

Thanks a lot

Dinh Luong
  • 158
  • 1
  • 15

1 Answers1

1

What do you think about cron on the docker container? Inside that cron command you'd git fetch remote repository and check if there are any changes that should be applied. If so the same cron command could perform git pull.

That'd require to write some script that's going to be executed in crontab. Please also remember about monitoring it somehow - cron that's not monitored does not execute ;).

Marcin Pietraszek
  • 3,134
  • 1
  • 19
  • 31
  • In regarding to this https://stackoverflow.com/questions/37458287/how-to-run-a-cron-job-inside-a-docker-container, so it means all i need is to re-build a new Docker Image which contains the `crontab` which defines the task (e.g `git fetch` the remote repo and then `git pull` the repo ) & scheduling time for it to run ? – Dinh Luong Sep 10 '18 at 08:24
  • That's an option. In case of any problems with forcing cron to run inside docker container you could have a volume that's exposed to the container that resides on host machine and cron on host machine that performs that pull. – Marcin Pietraszek Sep 10 '18 at 08:41