diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-07-31 10:16:38 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-07-31 10:17:44 +0300 |
commit | 9181b3a021acc7585cb6f9f20da6accfce0015e0 (patch) | |
tree | 0fcb4d5a99be02ac7a934817491f50d0d32d757d /.ci | |
parent | add some unit tests (diff) | |
download | cgitize-9181b3a021acc7585cb6f9f20da6accfce0015e0.tar.gz cgitize-9181b3a021acc7585cb6f9f20da6accfce0015e0.zip |
merge my_repos.py to the config
The config is also in the TOML format now. It's a bit messy for the
moment, but I'll fix it.
Diffstat (limited to '.ci')
-rw-r--r-- | .ci/docker/client/etc/cgitize.toml | 4 | ||||
-rw-r--r-- | .ci/docker/client/etc/my_repos.py | 6 | ||||
-rwxr-xr-x | .ci/local/test.sh | 43 |
3 files changed, 15 insertions, 38 deletions
diff --git a/.ci/docker/client/etc/cgitize.toml b/.ci/docker/client/etc/cgitize.toml new file mode 100644 index 0000000..bc46aca --- /dev/null +++ b/.ci/docker/client/etc/cgitize.toml @@ -0,0 +1,4 @@ +[repositories.test_repo] + +id = "test_repo" +clone_url = "root@server:~/test_repo" diff --git a/.ci/docker/client/etc/my_repos.py b/.ci/docker/client/etc/my_repos.py deleted file mode 100644 index 58cf542..0000000 --- a/.ci/docker/client/etc/my_repos.py +++ /dev/null @@ -1,6 +0,0 @@ -from cgitize.repo import Repo - - -MY_REPOS = ( - Repo('test_repo', clone_url='root@server:~/test_repo'), -) diff --git a/.ci/local/test.sh b/.ci/local/test.sh index 8ae7fe9..8826ff4 100755 --- a/.ci/local/test.sh +++ b/.ci/local/test.sh @@ -8,8 +8,7 @@ readonly script_dir upstream_repo_dir= readonly etc_dir="$script_dir/etc" -readonly cgitize_conf_path="$etc_dir/cgitize.conf" -readonly my_repos_path="$etc_dir/my_repos.py" +readonly cgitize_toml_path="$etc_dir/cgitize.toml" readonly output_dir="$script_dir/output" cleanup() { @@ -61,47 +60,27 @@ add_commits() { popd > /dev/null } -setup_cgitize_conf() { +setup_cgitize_toml() { echo echo ---------------------------------------------------------------------- - echo cgitize.conf + echo cgitize.toml echo ---------------------------------------------------------------------- local conf_dir - conf_dir="$( dirname -- "$cgitize_conf_path" )" + conf_dir="$( dirname -- "$cgitize_toml_path" )" mkdir -p -- "$conf_dir" - cat <<EOF | tee "$cgitize_conf_path" -[DEFAULT] + cat <<EOF | tee "$cgitize_toml_path" +output = "$output_dir" -my_repos = $( basename -- "$my_repos_path" ) -output = $output_dir -EOF -} - -setup_my_repos_py() { - echo - echo ---------------------------------------------------------------------- - echo my_repos.py - echo ---------------------------------------------------------------------- - - local conf_dir - conf_dir="$( dirname -- "$my_repos_path" )" - mkdir -p -- "$conf_dir" - - cat <<EOF | tee "$my_repos_path" -from cgitize.repo import Repo - - -MY_REPOS = ( - Repo('test_repo', clone_url='$upstream_repo_dir'), -) +[repositories.test_repo] +id = "test_repo" +clone_url = "$upstream_repo_dir" EOF } setup_cgitize() { - setup_cgitize_conf - setup_my_repos_py + setup_cgitize_toml } setup_bare() { @@ -127,7 +106,7 @@ cgitize() { echo Running cgitize echo ---------------------------------------------------------------------- - python3 -m cgitize.main --config "$cgitize_conf_path" --verbose + python3 -m cgitize.main --config "$cgitize_toml_path" --verbose } check_contains() { |