diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-27 23:17:14 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-29 00:45:48 +0300 |
commit | 5a792fee1335ea60ca6930dddb6080bcf869213d (patch) | |
tree | fa084df3b07301fd72c8c210fbf9b23e90df0f53 | |
parent | rename the project to "cgitize" (diff) | |
download | cgitize-5a792fee1335ea60ca6930dddb6080bcf869213d.tar.gz cgitize-5a792fee1335ea60ca6930dddb6080bcf869213d.zip |
further renaming work
-rw-r--r-- | .ci/docker/docker-compose.yml | 6 | ||||
-rwxr-xr-x | .ci/local/test.sh | 22 | ||||
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | cgitize/cgit.py | 4 | ||||
-rw-r--r-- | cgitize/main.py | 10 | ||||
-rw-r--r-- | cgitize/repo.py | 4 | ||||
-rw-r--r-- | cgitize/utils.py | 4 | ||||
-rw-r--r-- | examples/cgitize.conf (renamed from examples/cgit-repos.conf) | 4 | ||||
-rw-r--r-- | systemd/cgit-repos.service | 13 | ||||
-rw-r--r-- | systemd/cgitize.service | 13 | ||||
-rw-r--r-- | systemd/cgitize.timer (renamed from systemd/cgit-repos.timer) | 0 |
12 files changed, 52 insertions, 52 deletions
diff --git a/.ci/docker/docker-compose.yml b/.ci/docker/docker-compose.yml index e3bda62..6054764 100644 --- a/.ci/docker/docker-compose.yml +++ b/.ci/docker/docker-compose.yml @@ -11,6 +11,6 @@ services: dockerfile: Dockerfile image: client volumes: - - ./client/etc/:/etc/cgit-repos:ro - - "$SSH_AUTH_SOCK:/var/run/cgit-repos/ssh-agent.sock" - - ./client/output:/var/tmp/cgit-repos/output + - ./client/etc/:/etc/cgitize:ro + - "$SSH_AUTH_SOCK:/var/run/cgitize/ssh-agent.sock" + - ./client/output:/var/tmp/cgitize/output diff --git a/.ci/local/test.sh b/.ci/local/test.sh index 69a6458..43b9bbb 100755 --- a/.ci/local/test.sh +++ b/.ci/local/test.sh @@ -3,9 +3,9 @@ set -o errexit -o nounset -o pipefail readonly local_repo_path="$HOME/test_repo" -readonly cgit_repos_conf_path="$HOME/etc/cgit-repos/cgit-repos.conf" -readonly my_repos_path="$HOME/etc/cgit-repos/my_repos.py" -readonly output_path="$HOME/var/cgit-repos/output" +readonly cgitize_conf_path="$HOME/etc/cgitize/cgitize.conf" +readonly my_repos_path="$HOME/etc/cgitize/my_repos.py" +readonly output_path="$HOME/var/cgitize/output" setup_local_repo() { echo @@ -27,17 +27,17 @@ setup_local_repo() { popd > /dev/null } -setup_cgit_repos_conf() { +setup_cgitize_conf() { echo echo ---------------------------------------------------------------------- - echo cgit-repos.conf + echo cgitize.conf echo ---------------------------------------------------------------------- local conf_dir - conf_dir="$( dirname -- "$cgit_repos_conf_path" )" + conf_dir="$( dirname -- "$cgitize_conf_path" )" mkdir -p -- "$conf_dir" - cat <<EOF | tee "$cgit_repos_conf_path" + cat <<EOF | tee "$cgitize_conf_path" [DEFAULT] my_repos = $( basename -- "$my_repos_path" ) @@ -65,14 +65,14 @@ MY_REPOS = ( EOF } -setup_cgit_repos() { - setup_cgit_repos_conf +setup_cgitize() { + setup_cgitize_conf setup_my_repos_py } setup() { setup_local_repo - setup_cgit_repos + setup_cgitize } run() { @@ -81,7 +81,7 @@ run() { echo Pulling repository from upstream echo ---------------------------------------------------------------------- - python3 -m cgitize.main --config "$cgit_repos_conf_path" + python3 -m cgitize.main --config "$cgitize_conf_path" } verify() { @@ -2,7 +2,7 @@ FROM alpine:3.10 RUN apk add --no-cache git openssh-client python3 -ARG ssh_sock_dir=/var/run/cgit-repos +ARG ssh_sock_dir=/var/run/cgitize ARG ssh_sock_path="$ssh_sock_dir/ssh-agent.sock" ENV SSH_AUTH_SOCK "$ssh_sock_path" @@ -1,42 +1,42 @@ cgitize ======= -[![Test](https://github.com/egor-tensin/cgit-repos/workflows/Test/badge.svg)](https://github.com/egor-tensin/cgit-repos/actions?query=workflow%3ATest) +[![Test](https://github.com/egor-tensin/cgitize/workflows/Test/badge.svg)](https://github.com/egor-tensin/cgitize/actions?query=workflow%3ATest) Mirror your git repositories and make them cgit-ready. Usage ----- -Adjust the config in [examples/cgit-repos.conf] and pass it using the +Adjust the config in [examples/cgitize.conf] and pass it using the `--config` parameter: - > python3 -m cgitize.main --config path/to/cgit-repos.conf + > python3 -m cgitize.main --config path/to/cgitize.conf The repository list is stored in my_repos.py (the `my_repos` setting in the config). See [examples/my_repos.py] for an example. -cgit/repos/main.py calls git, which might call ssh internally. +cgitize/main.py calls git, which might call ssh internally. Make sure the required keys are loaded to a ssh-agent. -[examples/cgit-repos.conf]: examples/cgit-repos.conf +[examples/cgitize.conf]: examples/cgitize.conf [examples/my_repos.py]: examples/my_repos.py ### Docker The image is **egortensin/cgitize**. -The container reads the config from */etc/cgit-repos/cgit-repos.conf* and -writes the repositories to */var/tmp/cgit-repos/output*. +The container reads the config from */etc/cgitize/cgitize.conf* and +writes the repositories to */var/tmp/cgitize/output*. If SSH is required, the socket should be mapped to -*/var/run/cgit-repos/ssh-agent.sock*. +*/var/run/cgitize/ssh-agent.sock*. For example: > docker run -it --rm \ - -v "/path/to/config:/etc/cgit-repos:ro" \ - -v "$SSH_AUTH_SOCK:/var/run/cgit-repos/ssh-agent.sock" \ - -v "/path/to/output:/var/tmp/cgit-repos/output" \ + -v "/path/to/config:/etc/cgitize:ro" \ + -v "$SSH_AUTH_SOCK:/var/run/cgitize/ssh-agent.sock" \ + -v "/path/to/output:/var/tmp/cgitize/output" \ egortensin/cgitize ### my_repos.py diff --git a/cgitize/cgit.py b/cgitize/cgit.py index 778b1c9..6e287e9 100644 --- a/cgitize/cgit.py +++ b/cgitize/cgit.py @@ -1,6 +1,6 @@ # Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cgit repos" project. -# For details, see https://github.com/egor-tensin/cgit-repos. +# This file is part of the "cgitize" project. +# For details, see https://github.com/egor-tensin/cgitize. # Distributed under the MIT License. from enum import Enum diff --git a/cgitize/main.py b/cgitize/main.py index 650c079..920b769 100644 --- a/cgitize/main.py +++ b/cgitize/main.py @@ -1,6 +1,6 @@ # Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cgit repos" project. -# For details, see https://github.com/egor-tensin/cgit-repos. +# This file is part of the "cgitize" project. +# For details, see https://github.com/egor-tensin/cgitize. # Distributed under the MIT License. from argparse import ArgumentParser @@ -16,9 +16,9 @@ from cgitize.repo import BitbucketRepo, GithubRepo, Repo import cgitize.utils as utils -DEFAULT_OUTPUT_DIR = '/var/tmp/cgit-repos/output' -DEFAULT_CONFIG_PATH = '/etc/cgit-repos/cgit-repos.conf' -DEFAULT_MY_REPOS_PATH = '/etc/cgit-repos/my_repos.py' +DEFAULT_OUTPUT_DIR = '/var/tmp/cgitize/output' +DEFAULT_CONFIG_PATH = '/etc/cgitize/cgitize.conf' +DEFAULT_MY_REPOS_PATH = '/etc/cgitize/my_repos.py' @contextmanager diff --git a/cgitize/repo.py b/cgitize/repo.py index 4b3072c..02e283b 100644 --- a/cgitize/repo.py +++ b/cgitize/repo.py @@ -1,6 +1,6 @@ # Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cgit repos" project. -# For details, see https://github.com/egor-tensin/cgit-repos. +# This file is part of the "cgitize" project. +# For details, see https://github.com/egor-tensin/cgitize. # Distributed under the MIT License. import abc diff --git a/cgitize/utils.py b/cgitize/utils.py index 84337e8..5ff8475 100644 --- a/cgitize/utils.py +++ b/cgitize/utils.py @@ -1,6 +1,6 @@ # Copyright (c) 2018 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cgit repos" project. -# For details, see https://github.com/egor-tensin/cgit-repos. +# This file is part of the "cgitize" project. +# For details, see https://github.com/egor-tensin/cgitize. # Distributed under the MIT License. import contextlib diff --git a/examples/cgit-repos.conf b/examples/cgitize.conf index 94f73cd..a6ed701 100644 --- a/examples/cgit-repos.conf +++ b/examples/cgitize.conf @@ -2,10 +2,10 @@ [DEFAULT] -# /etc/cgit-repos/my_repos.py by default. +# /etc/cgitize/my_repos.py by default. my_repos = /path/to/my_repos.py -# /var/tmp/cgit-repos/output by default. +# /var/tmp/cgitize/output by default. output = /path/to/output/ # URL to clone from the output directory. diff --git a/systemd/cgit-repos.service b/systemd/cgit-repos.service deleted file mode 100644 index 12793d9..0000000 --- a/systemd/cgit-repos.service +++ /dev/null @@ -1,13 +0,0 @@ -# Adjust as you see fit. - -[Unit] -Description=Pull cgit repositories -Wants=ssh-agent.service - -[Service] -Type=simple -WorkingDirectory=%h/workspace/personal/cgit-repos -ExecStartPre=/usr/bin/truncate --size=0K -- %h/var/cgit-repos/cgit-repos.log -ExecStart=/usr/bin/python3 -m cgit.repos.main --config %h/etc/cgit-repos/cgit-repos.conf -StandardOutput=file:%h/var/cgit-repos/cgit-repos.log -StandardError=inherit diff --git a/systemd/cgitize.service b/systemd/cgitize.service new file mode 100644 index 0000000..0b517fc --- /dev/null +++ b/systemd/cgitize.service @@ -0,0 +1,13 @@ +# Adjust as you see fit. + +[Unit] +Description=Pull cgit repositories +Wants=ssh-agent.service + +[Service] +Type=simple +WorkingDirectory=%h/workspace/personal/cgitize +ExecStartPre=/usr/bin/truncate --size=0K -- %h/var/cgitize/cgitize.log +ExecStart=/usr/bin/python3 -m cgitize.main --config %h/etc/cgitize/cgitize.conf +StandardOutput=file:%h/var/cgitize/cgitize.log +StandardError=inherit diff --git a/systemd/cgit-repos.timer b/systemd/cgitize.timer index de56c5a..de56c5a 100644 --- a/systemd/cgit-repos.timer +++ b/systemd/cgitize.timer |