Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added proxy support #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ Simple master with reverse proxy
regex: "contrail-build-.*"
- name: "Aptly"
regex: "aptly-.*"
plugins:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugins don't work this way, why they were removed form example?

- name: slack
- name: extended-choice-parameter
- name: rebuild
- name: test-stability

Jenkins master with experimental plugin source support

Expand All @@ -102,6 +97,20 @@ Jenkins master with experimental plugin source support
enabled: true
update_site_url: 'http://updates.jenkins-ci.org/experimental/update-center.json'

Jenkins master with plugins proxy support

.. code-block:: yaml

jenkins:
master:
enabled: true
proxy:
host: proxy-host
port: 3128
no_proxy:
- localhost
- 127.0.0.1

SMTP server settings

.. code-block:: yaml
Expand Down
9 changes: 9 additions & 0 deletions jenkins/files/proxy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{%- from "jenkins/map.jinja" import master with context %}
<?xml version='1.1' encoding='UTF-8'?>
<proxy>
<name>{{ master.proxy.host }}</name>
<port>{{ master.proxy.port }}</port>
{%- if master.proxy.no_host is defined %}
<noProxyHost>{{ "\n".join(master.proxy.no_host) }}</noProxyHost>
{%- endif %}
</proxy>
27 changes: 24 additions & 3 deletions jenkins/master/service.sls
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ jenkins_{{ master.config }}:
- template: jinja
- require:
- pkg: jenkins_packages
- watch_in:
- service: jenkins_master_service

{%- if master.get('no_config', False) == False %}

{{ master.home }}/config.xml:
file.managed:
- source: salt://jenkins/files/config.xml
- template: jinja
- user: jenkins
- watch_in:
- service: jenkins_master_service

{%- endif %}

{%- if master.update_site_url is defined %}
Expand All @@ -37,6 +41,8 @@ jenkins_{{ master.config }}:
- user: jenkins
- require:
- pkg: jenkins_packages
- watch_in:
- service: jenkins_master_service

{%- endif %}

Expand All @@ -49,6 +55,22 @@ jenkins_{{ master.config }}:
- user: jenkins
- require:
- pkg: jenkins_packages
- watch_in:
- service: jenkins_master_service

{%- endif %}

{%- if master.proxy is defined %}

{{ master.home }}/proxy.xml:
file.managed:
- source: salt://jenkins/files/proxy.xml
- template: jinja
- user: jenkins
- require:
- pkg: jenkins_packages
- watch_in:
- service: jenkins_master_service

{%- endif %}

Expand All @@ -61,6 +83,8 @@ jenkins_{{ master.config }}:
- user: jenkins
- require:
- pkg: jenkins_packages
- watch_in:
- service: jenkins_master_service

{%- endif %}

Expand All @@ -81,9 +105,6 @@ jenkins_{{ master.config }}:
jenkins_master_service:
service.running:
- name: {{ master.service }}
- watch:
- file: jenkins_{{ master.config }}
- file: {{ master.home }}/hudson.model.UpdateCenter.xml

jenkins_service_running:
cmd.wait:
Expand Down