Added upstream support
diff --git a/gerrit/client/project.sls b/gerrit/client/project.sls
index a744b91..5b3b265 100644
--- a/gerrit/client/project.sls
+++ b/gerrit/client/project.sls
@@ -19,14 +19,6 @@
- source: salt://gerrit/files/projects.yaml
- template: jinja
-jeepyb_projects_yaml_env:
- environ.setenv:
- - name: PROJECTS_YAML
- - value: /srv/jeepyb/projects.yaml
- - update_minion: True
- - require:
- - file: /srv/jeepyb/projects.yaml
-
jeepyb_setup_projects:
environ.setenv:
- name: PROJECTS_YAML
@@ -34,7 +26,7 @@
- update_minion: True
- require:
- environ: jeepyb_projects_ini_env
- - environ: jeepyb_projects_yaml_env
+ - file: /srv/jeepyb/projects.yaml
{%- for project_name, project in client.project.iteritems() %}
@@ -44,11 +36,22 @@
- template: jinja
- defaults:
project_name: {{ project_name }}
+ - require:
+ - environ: jeepyb_setup_projects
+ - require_in:
+ - cmd: gerrit_client_enforce_projects
+{#
gerrit_client_project_{{ project_name }}:
gerrit.project_present:
- name: {{ project_name }}
+#}
{%- endfor %}
+gerrit_client_enforce_projects:
+ cmd.run:
+ - name: ./manage-projects -v
+ - cwd: {{ client.dir.base }}
+
{%- endif %}
diff --git a/gerrit/client/service.sls b/gerrit/client/service.sls
index 5412018..8ddc0ee 100644
--- a/gerrit/client/service.sls
+++ b/gerrit/client/service.sls
@@ -11,6 +11,7 @@
- {{ client.dir.acls }}
- {{ client.dir.cache }}
- {{ client.dir.git }}
+ - /etc/github
- makedirs: true
/etc/salt/minion.d/_gerrit.conf:
@@ -18,6 +19,11 @@
- source: salt://gerrit/files/_gerrit.conf
- template: jinja
+/etc/github/github-projects.secure.config:
+ file.managed:
+ - source: salt://gerrit/files/github-projects.secure.config
+ - template: jinja
+
{{ client.config.key }}:
file.managed:
- mode: 400
diff --git a/gerrit/files/github-projects.secure.config b/gerrit/files/github-projects.secure.config
index e69de29..0dede4b 100644
--- a/gerrit/files/github-projects.secure.config
+++ b/gerrit/files/github-projects.secure.config
@@ -0,0 +1,5 @@
+[github]
+{#
+username =
+password =
+#}
diff --git a/gerrit/files/project.config b/gerrit/files/project.config
index 798b162..1a5a02c 100644
--- a/gerrit/files/project.config
+++ b/gerrit/files/project.config
@@ -4,7 +4,7 @@
{%- if project.description is defined %}
[project]
- description = {{ project.desctription }}
+ description = {{ project.description }}
{%- endif %}
@@ -34,4 +34,3 @@
{%- endfor %}
{%- endfor %}
-
diff --git a/gerrit/files/projects.ini b/gerrit/files/projects.ini
index c9d4919..ec1677e 100644
--- a/gerrit/files/projects.ini
+++ b/gerrit/files/projects.ini
@@ -8,10 +8,12 @@
gerrit-user={{ client.server.user }}
gerrit-committer={{ client.server.email }}
gerrit-key={{ client.config.key }}
+gerrit-replicate={{ client.get('replicate', False) }}
{%- if client.github is defined %}
github-config=/etc/github/github-projects.secure.config
{%- endif %}
has-wiki=False
has-issues=False
has-pull-requests=False
-has-downloads=False
\ No newline at end of file
+has-downloads=False
+has-github=False
diff --git a/gerrit/files/projects.yaml b/gerrit/files/projects.yaml
index d7a9d34..fcb1998 100644
--- a/gerrit/files/projects.yaml
+++ b/gerrit/files/projects.yaml
@@ -1,9 +1,16 @@
{%- from "gerrit/map.jinja" import client with context %}
{%- for project_name, project in client.project.iteritems() %}
- project: {{ project_name }}
+ acl-config: {{ client.dir.acls }}/{{ project_name }}.config
{%- if project.description is defined %}
description: {{ project.description }}
{%- endif %}
+ {%- if project.upstream is defined %}
+ upstream: {{ project.upstream }}
+ {%- endif %}
+ {%- if project.homepage is defined %}
+ homepage: {{ project.homepage }}
+ {%- endif %}
{%- if project.groups is defined %}
groups:
{%- for group in project.groups %}
diff --git a/gerrit/files/pypi-mirror.yaml b/gerrit/files/pypi-mirror.yaml
new file mode 100644
index 0000000..1601c65
--- /dev/null
+++ b/gerrit/files/pypi-mirror.yaml
@@ -0,0 +1,13 @@
+# This file is managed by Salt.
+
+cache-root: /var/cache/pypimirror
+
+mirrors:
+ {%- for mirror_name, mirror in client.mirror %}
+ - name: {{ mirror_name }}
+ projects:
+ {%- for project in mirror.projects %}
+ - {{ project }}
+ {%- endfor %}
+ output: /var/lib/pypimirror/{{ mirror_name }}
+ {%- endfor %}