mirror of
https://github.com/daylinmorgan/git-server.git
synced 2024-12-21 19:30:45 -06:00
move soft serve update to sub-directory
This commit is contained in:
parent
7a28214f15
commit
dac5ec886f
5 changed files with 18 additions and 9 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
|||
soft/*
|
||||
gitea/*
|
||||
!gitea/gitea/
|
||||
|
||||
|
@ -6,3 +5,5 @@ gitea/gitea/*
|
|||
!gitea/gitea/templates/
|
||||
!gitea/gitea/public/
|
||||
|
||||
soft/*
|
||||
!soft/config/
|
||||
|
|
12
Makefile
12
Makefile
|
@ -1,9 +1,13 @@
|
|||
.PHONY: lint
|
||||
lint:
|
||||
black *.py
|
||||
prettier -w ./soft-serve.config.json
|
||||
black soft/config/*.py
|
||||
prettier -w ./soft/config/soft-serve.config.json
|
||||
|
||||
.PHONY: update-soft-serve
|
||||
update-soft-serve:
|
||||
sudo ./update-soft-serve-repos.py
|
||||
update-soft-serve: soft-repos
|
||||
docker compose restart soft-serve
|
||||
|
||||
.PHONY: soft-repos
|
||||
soft-repos:
|
||||
./soft/config/update-soft-serve-repos.py
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ services:
|
|||
restart: unless-stopped
|
||||
container_name: soft-serve
|
||||
volumes:
|
||||
- ./soft:/soft-serve
|
||||
- ./soft/data:/soft-serve
|
||||
ports:
|
||||
- 23231:23231
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"paths": {
|
||||
"src": "./gitea/git/repositories/daylin",
|
||||
"dest": "./soft/repos"
|
||||
"dest": "./soft/data/repos"
|
||||
},
|
||||
"repos": {
|
||||
"src": ["dotfiles", "git-server"],
|
|
@ -16,11 +16,15 @@ def get_name(config, repo):
|
|||
return name, dest
|
||||
|
||||
|
||||
def get_repo_path(config, repos):
|
||||
return Path(__file__).parent.parent.parent / config["paths"][repos]
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
config = get_config()
|
||||
|
||||
for repo in Path(config["paths"]["src"]).iterdir():
|
||||
for repo in get_repo_path(config, "src").iterdir():
|
||||
name, dest = get_name(config, repo)
|
||||
|
||||
if name not in config["repos"]["src"]:
|
||||
|
@ -32,7 +36,7 @@ def main():
|
|||
shutil.rmtree(dest)
|
||||
shutil.copytree(repo, dest)
|
||||
|
||||
for repo in Path(config["paths"]["dest"]).iterdir():
|
||||
for repo in get_repo_path(config, "dest").iterdir():
|
||||
name, dest = get_name(config, repo)
|
||||
|
||||
if name not in [*config["repos"]["src"], *config["repos"]["dest"]]:
|
Loading…
Reference in a new issue