Docker image update
This commit is contained in:
		
							parent
							
								
									f572e9f10e
								
							
						
					
					
						commit
						75cb35b954
					
				
							
								
								
									
										
											BIN
										
									
								
								docker.tar.gz
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								docker.tar.gz
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -1,8 +1,11 @@ | ||||
| # python | ||||
| 20 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainOPNsense.py  | ||||
| 25 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainDocker.py  | ||||
| # 20 19 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainOPNsense.py  | ||||
| # 25 19 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainDocker.py  | ||||
| #*/3 * * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainDocker.py  | ||||
| #*/3 * * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainOPNsense.py  | ||||
| 
 | ||||
| # git push  | ||||
| # 30 19 * * * /bin/sh /etc/debmirror/gitPush.sh | ||||
| 30 */4 * * * /bin/sh /etc/debmirror/gitPush.sh | ||||
| #*/1 * * * * /bin/sh /etc/debmirror/gitPush.sh | ||||
| @ -3,14 +3,14 @@ | ||||
| services: | ||||
|   debmirup: | ||||
|     container_name: Debian_Mirrors_Updater | ||||
|     build: ./ | ||||
|     image: debmirrorupd:V2.0.1 | ||||
|     # build: ./ | ||||
|     image: yuruc3/debianrepolist:v0.3 | ||||
|     environment: | ||||
|       - DEBMIRRORURL=https://www.debian.org/mirror/list | ||||
|       - GITURLPROTO=https | ||||
|       - GITURL=tea.shupogaki.org | ||||
|       - GITREPOPATH=YuruC3/Debain-repos.git | ||||
|       - GITEA_TOKEN=<CHANGHE_ME> | ||||
|       - GITREPOPATH=YuruC3/Repo-IP-lists.git | ||||
|       - GITEA_TOKEN=0938a2033324b987bbcb2976b56d147a9a00d8a2 | ||||
|       - EXTRAREPOS=True | ||||
|       - SECURITYREPOS=True | ||||
|     restart: unless-stopped | ||||
|  | ||||
| @ -5,39 +5,74 @@ WORKPTH="/etc/debmirror/" | ||||
| REPO_DIR="$WORKPTH/Repo-IP-lists" | ||||
| REPO_URL="${GITURLPROTO}://${GITURL}/${GITREPOPATH}" | ||||
| 
 | ||||
| 
 | ||||
| # Clone repo only if it doesn't already exist | ||||
| # Clone repo if not exists | ||||
| if [ ! -d "$REPO_DIR/.git" ]; then | ||||
|     echo "[$(date)] Cloning repository..." | ||||
|     git clone "$REPO_URL" "$REPO_DIR" | ||||
| fi | ||||
| 
 | ||||
| 
 | ||||
| cd "$REPO_DIR" | ||||
| 
 | ||||
| git remote set-url origin "https://${GITEA_TOKEN}@${GITURL}/${GITREPOPATH}" | ||||
| 
 | ||||
| 
 | ||||
| git config user.name "UpdateBot" | ||||
| git config user.email "UpdateBot@localhost.local" | ||||
| 
 | ||||
| # stage files | ||||
| # Stage the files | ||||
| git add MirrorListV4 MirrorListV6 OPNS_MirrorListV4 OPNS_MirrorListV6 | ||||
| 
 | ||||
| # If anything to commit locally, commit it now | ||||
| # Only proceed if there are staged changes | ||||
| if ! git diff --quiet --cached; then | ||||
|     echo "[$(date)] Committing local changes before pulling" | ||||
|     git commit -m "Auto-commit before pull on $(date -Iseconds)" | ||||
| fi | ||||
| 
 | ||||
| # Now pull the latest | ||||
| git pull --rebase --autostash | ||||
| 
 | ||||
| # Commit and push only if there's anything new staged | ||||
| if git diff --quiet; then | ||||
|     echo "[$(date)] No changes to commit." | ||||
| else | ||||
|     git commit -a -m "Auto-update mirror list on $(date -Iseconds)" --quiet | ||||
|     echo "[$(date)] Committing and pushing changes..." | ||||
|     git commit -m "Auto-update mirror list on $(date -Iseconds)" | ||||
|     git pull --rebase --autostash | ||||
|     git push --quiet | ||||
|     echo "[$(date)] Changes pushed successfully." | ||||
|     echo "[$(date)] Changes pushed." | ||||
| else | ||||
|     echo "[$(date)] No changes to commit or push." | ||||
| fi | ||||
| 
 | ||||
| 
 | ||||
| # #!/bin/sh | ||||
| # set -e | ||||
| 
 | ||||
| # WORKPTH="/etc/debmirror/" | ||||
| # REPO_DIRd="$WORKPTH/Repo-IP-lists" | ||||
| # REPO_URL="${GITURLPROTO}://${GITURL}/${GITREPOPATH}" | ||||
| 
 | ||||
| 
 | ||||
| # # Clone repo only if it doesn't already exist | ||||
| # if [ ! -d "$REPO_DIR/.git" ]; then | ||||
| #     echo "[$(date)] Cloning repository..." | ||||
| #     git clone "$REPO_URL" "$REPO_DIR" | ||||
| # fi | ||||
| 
 | ||||
| 
 | ||||
| # cd "$REPO_DIR" | ||||
| 
 | ||||
| # git remote set-url origin "https://${GITEA_TOKEN}@${GITURL}/${GITREPOPATH}" | ||||
| 
 | ||||
| # git config user.name "UpdateBot" | ||||
| # git config user.email "UpdateBot@localhost.local" | ||||
| 
 | ||||
| # # stage files | ||||
| # git add MirrorListV4 MirrorListV6 OPNS_MirrorListV4 OPNS_MirrorListV6 | ||||
| 
 | ||||
| # # If anything to commit locally, commit it now | ||||
| # if ! git diff --quiet --cached; then | ||||
| #     echo "[$(date)] Committing local changes before pulling" | ||||
| #     git commit -m "Auto-commit before pull on $(date -Iseconds)" | ||||
| # fi | ||||
| 
 | ||||
| # # Now pull the latest | ||||
| # git pull --rebase --autostash | ||||
| 
 | ||||
| # # Commit and push only if there's anything new staged | ||||
| # if git diff --quiet; then | ||||
| #     echo "[$(date)] No changes to commit." | ||||
| # else | ||||
| #     git commit -a -m "Auto-update mirror list on $(date -Iseconds)" --quiet | ||||
| #     git push --quiet | ||||
| #     echo "[$(date)] Changes pushed successfully." | ||||
| # fi | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 YuruC3
						YuruC3