From e231346fdd87520b0cd154aaab8a366f49a9a953 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 13 Oct 2026 00:32:55 +0500 Subject: reshuffle Docker-related files * The root docker-compose.yml was not used anywhere but the tests, so its contents was moved there. * Some more refactoring and shortening of paths in t/i/docker. * Removed .dockerignore files - I don't think they're needed, since I always use explicit COPY instructions with paths, etc., but I may as well be quite wrong on this one. * Removed examples/docker/ - don't think this one was used at all? --- test/integration/docker/.dockerignore | 5 ----- test/integration/docker/.gitignore | 2 ++ test/integration/docker/cgitize/.gitignore | 1 - test/integration/docker/cgitize/etc/cgitize.toml | 4 ---- test/integration/docker/docker-compose.yml | 27 ++++++++++++------------ test/integration/docker/etc/cgitize.toml | 4 ++++ test/integration/docker/git_server/Dockerfile | 6 +++--- test/integration/docker/test.sh | 8 +++---- 8 files changed, 27 insertions(+), 30 deletions(-) delete mode 100644 test/integration/docker/.dockerignore create mode 100644 test/integration/docker/.gitignore delete mode 100644 test/integration/docker/cgitize/.gitignore delete mode 100644 test/integration/docker/cgitize/etc/cgitize.toml create mode 100644 test/integration/docker/etc/cgitize.toml (limited to 'test/integration/docker') diff --git a/test/integration/docker/.dockerignore b/test/integration/docker/.dockerignore deleted file mode 100644 index a4e3191..0000000 --- a/test/integration/docker/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -* - -!/git_server/** -/git_server/Dockerfile -!/ssh/** diff --git a/test/integration/docker/.gitignore b/test/integration/docker/.gitignore new file mode 100644 index 0000000..c0680ca --- /dev/null +++ b/test/integration/docker/.gitignore @@ -0,0 +1,2 @@ +output/ +ssh_keys/ diff --git a/test/integration/docker/cgitize/.gitignore b/test/integration/docker/cgitize/.gitignore deleted file mode 100644 index ea1472e..0000000 --- a/test/integration/docker/cgitize/.gitignore +++ /dev/null @@ -1 +0,0 @@ -output/ diff --git a/test/integration/docker/cgitize/etc/cgitize.toml b/test/integration/docker/cgitize/etc/cgitize.toml deleted file mode 100644 index f20ba77..0000000 --- a/test/integration/docker/cgitize/etc/cgitize.toml +++ /dev/null @@ -1,4 +0,0 @@ -[repositories.test_repo] - -name = "test_repo" -clone_url = "root@git_server:~/test_repo" diff --git a/test/integration/docker/docker-compose.yml b/test/integration/docker/docker-compose.yml index 703dbd0..75391b8 100644 --- a/test/integration/docker/docker-compose.yml +++ b/test/integration/docker/docker-compose.yml @@ -1,21 +1,22 @@ services: - git_server: - build: - context: . - dockerfile: git_server/Dockerfile cgitize: - extends: - file: ../../../docker-compose.yml - service: cgitize + build: + context: ../../.. + dockerfile: docker/Dockerfile environment: SCHEDULE: once volumes: - - ./cgitize/etc:/etc/cgitize:ro + - ./etc:/etc/cgitize:ro - "$SSH_AUTH_SOCK:/ssh-agent.sock" - - ./cgitize/output:/mnt/cgitize + - ./output:/mnt/cgitize frontend: - extends: - file: ../../../docker-compose.yml - service: frontend + build: + context: ../../../docker/frontend + ports: + - '127.0.0.1:80:80' volumes: - - ./cgitize/output:/mnt/cgitize:ro + - ./output:/mnt/cgitize:ro + git_server: + build: + context: . + dockerfile: git_server/Dockerfile diff --git a/test/integration/docker/etc/cgitize.toml b/test/integration/docker/etc/cgitize.toml new file mode 100644 index 0000000..f20ba77 --- /dev/null +++ b/test/integration/docker/etc/cgitize.toml @@ -0,0 +1,4 @@ +[repositories.test_repo] + +name = "test_repo" +clone_url = "root@git_server:~/test_repo" diff --git a/test/integration/docker/git_server/Dockerfile b/test/integration/docker/git_server/Dockerfile index 8e4b841..97306f9 100644 --- a/test/integration/docker/git_server/Dockerfile +++ b/test/integration/docker/git_server/Dockerfile @@ -9,9 +9,9 @@ RUN apk add -q --no-cache bash git openssh-server tini && \ WORKDIR /root -COPY ["ssh/server_key", "/etc/ssh/ssh_host_ed25519_key"] -COPY ["ssh/server_key.pub", "/etc/ssh/ssh_host_ed25519_key.pub"] -COPY ["ssh/client_key.pub", "./.ssh/authorized_keys"] +COPY ["ssh_keys/server_key", "/etc/ssh/ssh_host_ed25519_key"] +COPY ["ssh_keys/server_key.pub", "/etc/ssh/ssh_host_ed25519_key.pub"] +COPY ["ssh_keys/client_key.pub", "./.ssh/authorized_keys"] RUN chmod 0600 -- /etc/ssh/ssh_host_ed25519_key && \ chmod 0700 -- ./.ssh/ && \ diff --git a/test/integration/docker/test.sh b/test/integration/docker/test.sh index 7915ca1..ae43b71 100755 --- a/test/integration/docker/test.sh +++ b/test/integration/docker/test.sh @@ -12,10 +12,10 @@ readonly script_name # This is still required with older Compose versions to use TARGETARCH: export DOCKER_BUILDKIT=1 -readonly ssh_dir="$script_dir/ssh" +readonly ssh_dir="$script_dir/ssh_keys" readonly client_key_password='password' -readonly output_dir="$script_dir/cgitize/output" -readonly frontend_host=localhost +readonly output_dir="$script_dir/output" +readonly frontend_host=127.0.0.1 dump() { local prefix="${FUNCNAME[0]}" @@ -219,7 +219,7 @@ verify_git() { echo Checking the pulled repository echo ---------------------------------------------------------------------- - pushd -- "$script_dir/cgitize/output/test_repo.git" > /dev/null + pushd -- "$script_dir/output/test_repo.git" > /dev/null git log --oneline popd > /dev/null } -- cgit v1.3