diff options
author | Janis Altherr <jaltherr@gitlab.com> | 2023-06-08 09:54:32 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2023-06-08 09:54:32 +0300 |
commit | 3cbfc605d0ede7e0a79d912fac01d610089f7eef (patch) | |
tree | ab4c8aea756d110ec1e676ee6088327809803b2e /test/gitlabstub | |
parent | 5a6388a4479dcfbd522a55b525127f9096e79cdc (diff) |
Use pages root directory from API
Diffstat (limited to 'test/gitlabstub')
-rw-r--r-- | test/gitlabstub/api_responses.go | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/test/gitlabstub/api_responses.go b/test/gitlabstub/api_responses.go index 02b396cb..87233969 100644 --- a/test/gitlabstub/api_responses.go +++ b/test/gitlabstub/api_responses.go @@ -47,6 +47,7 @@ type Response struct { httpsOnly bool pathOnDisk string // base directory is gitlab-pages/shared/pages uniqueHost string + rootDirectory string } func (responses Responses) virtualDomain(wd string) api.VirtualDomain { @@ -78,6 +79,7 @@ func (response Response) lookupPath(prefix, wd string) api.LookupPath { AccessControl: response.accessControl, HTTPSOnly: response.httpsOnly, UniqueHost: response.uniqueHost, + RootDirectory: response.rootDirectory, Source: api.Source{ Type: "zip", Path: sourcePath, @@ -315,9 +317,36 @@ var apiResponses = APIResponses{ pathOnDisk: "group/project", }, }, - // NOTE: before adding more domains here, you can: - // use an existing project or generate a new zip archive. - // To generate a new zip archive run the following command, where PROJECT_SUBDIR - // is a project folder within `gitlab-pages/shared/pages` - // `make zip PROJECT_SUBDIR=group/serving` + "custom-root.gitlab-example.com": { + "/": { + pathOnDisk: "group.customroot/customroot", + rootDirectory: "foo", + }, + }, + "custom-root-legacy.gitlab-example.com": { + "/": { + pathOnDisk: "group/project", + }, + }, + "custom-root-explicit-public.gitlab-example.com": { + "/": { + pathOnDisk: "group/project", + rootDirectory: "public", + }, + }, + "custom-root-no-subdir.gitlab-example.com": { + "/": { + pathOnDisk: "group.customroot/nosubdir", + rootDirectory: "/", + }, + }, + "custom-root-wrong-dir.gitlab-example.com": { + "/": { + pathOnDisk: "group/project", + rootDirectory: "foo", + }, + }, + // NOTE: before adding more domains here, generate the zip archive by running (per project) + // make zip PROJECT_SUBDIR=group/project2/public + // make zip PROJECT_SUBDIR=group/customroot/foo } |