![]() |
|
Git Pull Script — Repo Secrets Update Guide (DEV Environment) - Printable Version +- DevOps Discussion Forum (https://forums.geekssolutions.io) +-- Forum: Cloud Computing (https://forums.geekssolutions.io/forumdisplay.php?fid=10) +--- Forum: DevOps (https://forums.geekssolutions.io/forumdisplay.php?fid=14) +--- Thread: Git Pull Script — Repo Secrets Update Guide (DEV Environment) (/showthread.php?tid=20) |
Git Pull Script — Repo Secrets Update Guide (DEV Environment) - Amey Bhargave - 04-07-2026 ================================================================================ Git Pull Script — Repo Secrets Update Guide (DEV Environment) ================================================================================ ================================================================================ OVERVIEW ================================================================================ This guide explains the process for updating repository credentials (repo secrets) used in the automated git pull script running via cron jobs. ================================================================================ ISSUE ================================================================================ Developers' code changes are not getting updated in the DEV environment. Root cause is usually: - Expired / invalid repository credentials - Git pull cron job failing due to authentication issues ================================================================================ STEP-BY-STEP PROCEDURE ================================================================================ --- Step 1: Login to DEV Server (Linode) --- Login to the DEV server using SSH. ================================================================================ --- Step 2: Identify the Application Container --- All projects are running inside Docker containers. Code: docker ps -aFind the appropriate container for your application. ================================================================================ --- Step 3: Access the Container --- Exec into the application container: Code: docker exec -it <container_name> bash================================================================================ --- Step 4: Locate Git Pull Cron Job --- Check existing cron jobs: Code: crontab -lAlso check system cron directory: Code: ls -l /etc/cron.d/Look for file: git-pull-cron ================================================================================ --- Step 5: Verify Cron Script and Logs --- Read the cron configuration: Code: cat /etc/cron.d/git-pull-cronCheck logs for failures: Code: cat /var/log/git-pull.log? If logs show authentication errors → credentials need update. ================================================================================ --- Step 6: Update Git Credentials --- Open the git pull script: Code: vi /usr/local/bin/git-pull.shReplace old credentials with new ones. ================================================================================ --- Step 7: Generate New Repo Credentials (Azure DevOps) --- 1. Login to Azure DevOps 2. Navigate to the appropriate project 3. Open the required repository 4. Click on **Clone** Reference: https://prnt.sc/X5RGff0Z8pLG 5. Click on **Generate Credentials** Reference: https://prnt.sc/FA7t5X-oPgge 6. Copy the generated credentials ================================================================================ --- Step 8: Update Script with New Credentials --- Update credentials in: Code: /usr/local/bin/git-pull.shReference: https://prnt.sc/BSdafqM5zDdk Save the file. ================================================================================ --- Step 9: Re-run Script and Verify --- Manually execute the script: Code: bash /usr/local/bin/git-pull.shCheck logs: Code: cat /var/log/git-pull.logEnsure: - Git pull is successful - No authentication errors ================================================================================ TROUBLESHOOTING ================================================================================ --- Git pull still failing --- - Verify credentials are correct - Ensure repo URL is correct - Check network connectivity --- Cron not running --- Code: systemctl status cron--- Permission issues --- Code: chmod +x /usr/local/bin/git-pull.sh================================================================================ QUICK SUMMARY ================================================================================ Issue: Code not updating in DEV Cause: Expired repo credentials Fix: Update credentials in git-pull script Key Files: - /etc/cron.d/git-pull-cron - /usr/local/bin/git-pull.sh - /var/log/git-pull.log ================================================================================ |