From: Shane Date: Sun, 11 Jan 2026 02:40:15 +0000 (+0000) Subject: scripting setup /srv/git/ repos on helio-web X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=e75934d48b9eeebace130ec7253821c90b10a51f;p=nutratech%2Fvps-root.git scripting setup /srv/git/ repos on helio-web --- diff --git a/.env b/.env index cc0a371..22eca3c 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ VPS_HOST=dev.nutra.tk VPS_USER=gg export SUDO_USER=gg - +export OWNER="Shane J" diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..7a54737 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +source .env + diff --git a/Makefile b/Makefile index 4b15fcd..496d8e7 100644 --- a/Makefile +++ b/Makefile @@ -144,3 +144,22 @@ ifdef SUDO_USER else python3 scripts/update_repo_metadata.py $(or $(CSV),scripts/repo_metadata.csv) endif + +.PHONY: git/init-remote +git/init-remote: ##H @Remote Initialize a new bare repository on VPS (usage: make git/init-remote REPO=projects/new-repo.git) +ifndef REPO,OWNER,DESC + $(error REPO/OWNER/DESC are undefined: '$(REPO)/$$OWNER/$(DESC)'). Usage: make git/init-remote REPO=projects/new-repo.git OWNER="Shane" DESC="New repository") +endif + @echo "Initializing bare repository $(REPO) on $(VPS_HOST)..." + ssh $(VPS) "mkdir -p /srv/git/$(REPO) && cd /srv/git/$(REPO) && git init --bare && touch git-daemon-export-ok" +ifdef OWNER + @echo "Setting owner to $(OWNER)..." + ssh $(VPS) "git config --file /srv/git/$(REPO)/config gitweb.owner '$(OWNER)'" +endif +ifdef DESC + @echo "Setting description to $(DESC)..." + ssh $(VPS) "echo '$(DESC)' > /srv/git/$(REPO)/description" +endif + @echo "Repository created. You can now push to it:" + @echo " git remote add origin $(VPS_USER)@$(VPS_HOST):/srv/git/$(REPO)" + @echo " git push -u origin main"