소스 검색

Merge branch 'feature/pull-formula-review' into 'master'

Formula reset to specific refs (example: Gerrit review)

See merge request !9
tags/0.4
Aleš Komárek 8 년 전
부모
커밋
57f82e58b5
2개의 변경된 파일89개의 추가작업 그리고 2개의 파일을 삭제
  1. +47
    -0
      README.rst
  2. +42
    -2
      salt/master/env.sls

+ 47
- 0
README.rst 파일 보기

@@ -57,6 +57,53 @@ Salt master with alternative installation source and version (optional) - pip
engine: pip
version: 2016.3.0rc2

Salt master with specified formula to install through apt-get

.. code-block:: yaml

salt:
master:
enabled: true
...
environment:
prd:
keysone:
source: pkg
name: salt-formula-keystone

Clone master branch of keystone formula as local feature branch

.. code-block:: yaml

salt:
master:
enabled: true
...
environment:
dev:
formula:
keystone:
source: git
address: git@github.com:openstack/salt-formula-keystone.git
revision: master
branch: feature

Salt master with specified formula refs (for example for Gerrit review)

.. code-block:: yaml

salt:
master:
enabled: true
...
environment:
dev:
formula:
keystone:
source: git
address: https://git.openstack.org/openstack/salt-formula-keystone
revision: refs/changes/56/123456/1

Salt master syndicate master of masters

.. code-block:: yaml

+ 42
- 2
salt/master/env.sls 파일 보기

@@ -151,11 +151,50 @@ salt_master_{{ environment_name }}_{{ formula_name }}_formula:
git.latest:
- name: {{ formula.address }}
- target: /usr/share/salt-formulas/env/_formulas/{{ formula_name }}
- rev: {{ formula.revision }}
{% if formula.get("revision", "").split("/")[0] == "refs" %}
- rev: {{ formula.branch|default("master") }}
{%- if grains['saltversion'] < "2015.8.0" %}
- branch: {{ formula.branch|default("master") }}
{%- endif %}
{% else %}
- rev: {{ formula.revision|default(formula.branch) }}
{%- if grains['saltversion'] < "2015.8.0" %}
- branch: {{ formula.branch|default(formula.revision) }}
{%- endif %}
{% endif %}
- force_reset: {{ formula.force_reset|default(False) }}
- require:
- file: salt_env_{{ environment_name }}_dirs
- pkg: git_packages

{%- if formula.get("revision", "").split("/")[0] == "refs" %}

salt_master_{{ environment_name }}_{{ formula_name }}_formula_refs_workaround_fetch:
module.run:
- name: git.fetch
- cwd: /usr/share/salt-formulas/env/_formulas/{{ formula_name }}
- opts: {{ formula.address }} {{ formula.revision }}
- require:
- git: salt_master_{{ environment_name }}_{{ formula_name }}_formula

salt_master_{{ environment_name }}_{{ formula_name }}_formula_refs_workaround_reset:
module.run:
- name: git.reset
- cwd: /usr/share/salt-formulas/env/_formulas/{{ formula_name }}
- opts: --hard FETCH_HEAD
- require:
- module: salt_master_{{ environment_name }}_{{ formula_name }}_formula_refs_workaround_fetch

salt_master_{{ environment_name }}_{{ formula_name }}_formula_refs_workaround_rebase:
module.run:
- name: git.rebase
- cwd: /usr/share/salt-formulas/env/_formulas/{{ formula_name }}
- rev: origin/{{ formula.branch|default("master") }}
- require:
- module: salt_master_{{ environment_name }}_{{ formula_name }}_formula_refs_workaround_reset

{%- endif %}

salt_env_{{ environment_name }}_{{ formula_name }}_link:
file.symlink:
- name: /usr/share/salt-formulas/env/{{ formula_name }}
@@ -245,4 +284,5 @@ salt_master_{{ environment_name }}_{{ state_name }}_state:

{# end new #}

{%- endif %}
{%- endif %}


Loading…
취소
저장