Skip to content

Commit

Permalink
support for Gitlab Pages. closes #60
Browse files Browse the repository at this point in the history
  • Loading branch information
tobru committed Mar 11, 2016
1 parent ad29e01 commit 281c4d4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
## v1.8.0 [2016-03-11]

* Support for Gitlab Workhorse. Thanks to @tunasalat
* Support for Gitlab Pages
* Feature to create Custom Hooks. Thanks to @b4ldr
* Install `apt-transport-https` on Debian like OS

## v1.7.2 [2016-02-11]

Expand Down
11 changes: 11 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
$git_data_dir = $::gitlab::git_data_dir
$gitlab_git_http_server = $::gitlab::gitlab_git_http_server
$gitlab_ci = $::gitlab::gitlab_ci
$gitlab_pages = $::gitlab::gitlab_pages
$gitlab_rails = $::gitlab::gitlab_rails
$high_availability = $::gitlab::high_availability
$logging = $::gitlab::logging
Expand All @@ -26,6 +27,9 @@
$mattermost_nginx = $::gitlab::mattermost_nginx
$mattermost_nginx_eq_nginx = $::gitlab::mattermost_nginx_eq_nginx
$nginx = $::gitlab::nginx
$pages_external_url = $::gitlab::pages_external_url
$pages_nginx = $::gitlab::pages_nginx
$pages_nginx_eq_nginx = $::gitlab::pages_nginx_eq_nginx
$postgresql = $::gitlab::postgresql
$redis = $::gitlab::redis
$secrets = $::gitlab::secrets
Expand Down Expand Up @@ -54,6 +58,13 @@
$_real_mattermost_nginx = $mattermost_nginx
}

# replicate $nginx to $pages_nginx if $pages_nginx_eq_nginx true
if $pages_nginx_eq_nginx {
$_real_pages_nginx = $nginx
} else {
$_real_pages_nginx = $pages_nginx
}

file { $config_file:
ensure => file,
owner => $service_user,
Expand Down
26 changes: 25 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
# Default: undef
# Hash of 'gitlab_ci' config parameters.
#
# [*gitlab_pages*]
# Default: undef
# Hash of 'gitlab_pages' config parameters.
#
# [*gitlab_rails*]
# Default: undef
# Hash of 'gitlab_rails' config parameters.
Expand Down Expand Up @@ -146,6 +150,18 @@
# Default: undef
# Hash of 'nginx' config parameters.
#
# [*pages_external_url*]
# Default: undef
# External URL of Gitlab Pages.
#
# [*pages_nginx*]
# Default: undef
# Hash of 'pages_nginx' config parameters.
#
# [*pages_nginx_eq_nginx*]
# Default: false
# Replicate the Pages Nginx config from the Gitlab Nginx config.
#
# [*postgresql*]
# Default: undef
# Hash of 'postgresql' config parameters.
Expand Down Expand Up @@ -238,6 +254,7 @@
$git_data_dir = undef,
$gitlab_git_http_server = undef,
$gitlab_ci = undef,
$gitlab_pages = undef,
$gitlab_rails = undef,
$high_availability = undef,
$logging = undef,
Expand All @@ -248,6 +265,9 @@
$mattermost_nginx = undef,
$mattermost_nginx_eq_nginx = false,
$nginx = undef,
$pages_external_url = undef,
$pages_nginx = undef,
$pages_nginx_eq_nginx = false,
$postgresql = undef,
$redis = undef,
$secrets = undef,
Expand Down Expand Up @@ -283,6 +303,7 @@
if $git { validate_hash($git) }
if $git_data_dir { validate_absolute_path($git_data_dir) }
if $gitlab_git_http_server { validate_hash($gitlab_git_http_server) }
if $gitlab_pages { validate_hash($gitlab_pages) }
if $gitlab_workhorse { validate_hash($gitlab_workhorse) }
if $gitlab_ci { validate_hash($gitlab_ci) }
if $gitlab_rails { validate_hash($gitlab_rails) }
Expand All @@ -292,6 +313,9 @@
if $mattermost { validate_hash($mattermost) }
if $mattermost_external_url { validate_string($mattermost_external_url) }
if $mattermost_nginx { validate_hash($mattermost_nginx) }
validate_string($pages_external_url)
if $pages_nginx { validate_hash($pages_nginx) }
validate_bool($pages_nginx_eq_nginx)
if $postgresql { validate_hash($postgresql) }
if $redis { validate_hash($redis) }
if $secrets { validate_hash($secrets) }
Expand All @@ -311,7 +335,7 @@
contain gitlab::install
contain gitlab::config
contain gitlab::service

create_resources(gitlab::custom_hook, $custom_hooks)

}
24 changes: 24 additions & 0 deletions templates/gitlab.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,30 @@ mattermost['<%= k -%>'] = <%= decorate(@mattermost[k]) %>
<%- @_real_mattermost_nginx.keys.sort.each do |k| -%>
mattermost_nginx['<%= k -%>'] = <%= decorate(@_real_mattermost_nginx[k]) %>
<%- end end -%>
<%- if @pages_external_url -%>

####################
# GitLab Pages
####################

## Define to enable GitLab Pages
pages_external_url '<%= @pages_external_url %>'
<%- end -%>
<%- if @gitlab_pages -%>

<%- @gitlab_pages.keys.sort.each do |k| -%>
gitlab_pages['<%= k -%>'] = <%= decorate(@gitlab_pages[k]) %>
<%- end end -%>
<%- if @_real_pages_nginx -%>

######################
# GitLab Pages NGINX #
######################
## see: http://doc.gitlab.com/ee/pages/administration.html

<%- @_real_pages_nginx.keys.sort.each do |k| -%>
pages_nginx['<%= k -%>'] = <%= decorate(@_real_pages_nginx[k]) %>
<%- end end -%>
<%- if @manage_accounts -%>

###################
Expand Down

0 comments on commit 281c4d4

Please sign in to comment.