Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Prepare for supporting a path prefix
Browse files Browse the repository at this point in the history
Still not part of a tagged Woodpecker CI release.
Preparing for the next one.

Related to woodpecker-ci/woodpecker#1714
  • Loading branch information
spantaleev committed Apr 29, 2023
1 parent 095f7a6 commit f907c76
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 9 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ devture_woodpecker_ci_server_version: v0.15.7

devture_woodpecker_ci_server_identifier: devture-woodpecker-ci-server

devture_woodpecker_ci_server_scheme: https

# devture_woodpecker_ci_server_hostname is the fully-qualified domain name of your Woodpecker CI host (e.g. `woodpecker.DOMAIN`)
devture_woodpecker_ci_server_hostname: ''

Expand All @@ -33,9 +35,14 @@ devture_woodpecker_ci_server_https_bind_port: ''
devture_woodpecker_ci_server_container_add_host_domain_name: ''
devture_woodpecker_ci_server_container_add_host_ip_address: ''

# devture_woodpecker_ci_server_config_host controls WOODPECKER_HOST - Server fully qualified url of the user-facing hostname.
# devture_woodpecker_ci_server_config_host controls WOODPECKER_HOST - Server fully qualified url, without the root path prefix.
# See: https://woodpecker-ci.org/docs/administration/server-config#woodpecker_host
devture_woodpecker_ci_server_config_host: "https://{{ devture_woodpecker_ci_server_hostname }}"
# See: devture_woodpecker_ci_server_config_root_url
devture_woodpecker_ci_server_config_host: "{{ devture_woodpecker_ci_server_scheme }}://{{ devture_woodpecker_ci_server_hostname }}"

# devture_woodpecker_ci_server_config_root_url controls WOODPECKER_ROOT_URL - path prefix.
# See: https://woodpecker-ci.org/docs/administration/server-config#woodpecker_root_url
devture_woodpecker_ci_server_config_root_url: "{{ devture_woodpecker_ci_server_path_prefix }}"

# devture_woodpecker_ci_server_config_open controls WOODPECKER_OPEN - whether user registration is allowed
# See: https://woodpecker-ci.org/docs/administration/server-config#woodpecker_open
Expand Down
8 changes: 0 additions & 8 deletions tasks/validate_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,3 @@
msg: >-
devture_woodpecker_ci_server_container_labels_traefik_path_prefix (`{{ devture_woodpecker_ci_server_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/ci`).
when: "devture_woodpecker_ci_server_container_labels_traefik_path_prefix != '/' and devture_woodpecker_ci_server_container_labels_traefik_path_prefix[-1] == '/'"

- name: Fail if devture_woodpecker_ci_server_container_labels_traefik_path_prefix specifies a subpath
ansible.builtin.fail:
msg: >-
devture_woodpecker_ci_server_container_labels_traefik_path_prefix (`{{ devture_woodpecker_ci_server_container_labels_traefik_path_prefix }}`) specifies a subpath,
but Woodpecker CI does not support this yet.
See: https://github.com/woodpecker-ci/woodpecker/issues/1636
when: "devture_woodpecker_ci_server_container_labels_traefik_path_prefix != '/'"
2 changes: 2 additions & 0 deletions templates/env.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
WOODPECKER_HOST={{ devture_woodpecker_ci_server_config_host }}

WOODPECKER_ROOT_URL={{ devture_woodpecker_ci_server_config_root_url }}

WOODPECKER_OPEN={{ devture_woodpecker_ci_server_config_open | to_json }}

WOODPECKER_SERVER_ADDR={{ devture_woodpecker_ci_server_config_server_addr }}
Expand Down

0 comments on commit f907c76

Please sign in to comment.