question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cron job for Git pull and Docker build

See original GitHub issue

I’m a dummy when it comes to Linux, so I’d really appreciate competent advice on how to set up the following in the most efficient way possible (cron job?) on my RasPi 4B with Raspian installed:

  1. In user pi’s home folder /GitHub/juice-shop check-out master dropping any local changes and then pull from remote
  2. If one or more commits without ci skip in the commit message were pulled
  3. Run shell script X (which I’ll build the Docker image and push from then)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bkimminichcommented, Jun 25, 2020

But then my RasPi would need to be callable from the evil Internet, and that’s not going to happen… 😉

I think its using a Pull Model not a Push, so you would not need to expose it to the internet.

You’re right, it doesn’t need to be callable, but https://help.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories still says “We recommend that you do not use self-hosted runners with public repositories.” - more due to risks of malicious forks, but the “Threat Model” here is just too unforeseeable to me. With a simple script that only pulls from the master branch of my own checked out repo, things should be safe pretty much all the time for my poor little RasPi.

0reactions
github-actions[bot]commented, Aug 11, 2021

This thread has been automatically locked because it has not had recent activity after it was closed. 🔒 Please open a new issue for regressions or related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

edwardsamuel/Docker-Cron-Job-Sample - GitHub
Run Cron Job inside Docker Container​​ To run a cron job inside a Docker container, you need to specify your cron job first...
Read more >
Git auto-pull using cronjob - Stack Overflow
So I have to create tasks as the root user. The crontab entry I tried: */1 * * * * su -s /bin/sh...
Read more >
Docker Cron Jobs: How to Run Cron Inside Containers
In this article, we'll walk through using the host's crontab, using cron within your containers, and separating cron from your application's ...
Read more >
Cron + Docker = The Easiest Job Scheduler You'll Ever Create
Use a Docker volume, which would allow for easier updating of the schedules and/or jobs. · Create an execution log file so you...
Read more >
Running A Cronjob Inside Docker Container In 5 Steps - Devtron
Create a script file(task file) · Create a cron job file · Create a docker file · Create a docker image from docker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found